https://github.com/kenpusney/fed
The Federal of Programming Languages
https://github.com/kenpusney/fed
design-document fed programming-language
Last synced: 3 months ago
JSON representation
The Federal of Programming Languages
- Host: GitHub
- URL: https://github.com/kenpusney/fed
- Owner: kenpusney
- Created: 2016-04-11T06:11:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-11T06:55:07.000Z (almost 10 years ago)
- Last Synced: 2025-03-24T01:35:56.017Z (10 months ago)
- Topics: design-document, fed, programming-language
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fed Programming Language
- Derived from Ng
- Explicit type, although sometimes it can be inferred
- No macros, they are all **bullshit** (instead you can invent one)
- Templates made simple
- ADT && HKT support
- Unified function call syntax
- Value semantics
- Strong type safety
- No GC and lifetime annotation
# Examples
```haskell
-- cons means: Constructor
type List<'t> = cons Cons('t, List<'t>) | cons Nil
-- this is it
type array<'t, arity: Int>
get :: array<'t, n> -> Int -> Maybe 't
-- You can also emit the `array` shit by some compiler magic
val shit: array {1, 2, 3, 4, 5}
-- It's 4, seriously
shit.get(3) |> print
val list: Cons(1, Cons(2, Cons(3, Cons(4, Cons(5)))))
length :: List<'t> -> Int
length l = case l
| Cons(x, xs) => length(xs) + 1
| Nil => 0
type Fact = {
value: x * Fact.value
}
-- Fuck me, please
type Fact<0> = {value: 1}
fact :: Int -> Int
fact n = Fact::value
-- array_of_int<5> == array
type array_of_int = array
-- array_of_char<5> != array
type! array_of_char = array
type ref<'t> = ref 't
(~>) :: ref<'t> -> 't
val shit2 = ref shit
-- :) shit2~>get(3) for short
shit2.~>.get(3)
```