strictness, ci
[minfp.git] / README.md
1 # minfp: a minimal pure lazy functional language
2
3 `minfp` is a functional programming language that aims to be as small as
4 possible while still being feature rich.
5 Most of the code is taken up by type checking.
6
7 ```
8 $ wc -l *.[id]cl
9 23 ast.dcl
10 25 ast.icl
11 5 builtin.dcl
12 13 builtin.icl
13 12 check.dcl
14 168 check.icl
15 6 gen.dcl
16 39 gen.icl
17 7 int.dcl
18 49 int.icl
19 59 main.icl
20 10 parse.dcl
21 124 parse.icl
22 13 scc.dcl
23 41 scc.icl
24 594 total
25 ```
26
27 ### Features
28
29 - Polymorphic type inference for the Hindley-Milner type system
30 - Support for let polymorfism
31 - Reasonable interpreter
32
33 ### CFG
34
35 ```
36 minfp := function+
37 function := (op+ ['infixr' | 'infixl'] digit+ | id) id* '=' expr ';'
38 expr := expr op expr
39 | '\' id '.' expr
40 | '(' op+ ')'
41 | '\' id '.' expr
42 | '-'? digit*
43 | 'True' | 'False'
44 | 'code' id
45 | id
46 id := alpha (alnum)*
47 op := '!' | '|' | '@' | '#' | '$' | '%' | '^' | '&' | '*' | '=' | '+'
48 | '/' | '?' | '-' | '_' | '|' | ''' | '"' | '\' | ''' | '<' | '>'
49 | '.' | ':'
50 alpha := a | b | .. | z | A | B | .. | Z
51 digit := 0 | 1 | .. | 9
52 alnum := alpha | digit
53 ```
54
55 A program always has to have a `start` function that takes no arguments.
56
57 ### Code instructions
58
59 See `builtin.icl` for all builtin instructions that you can use with `code`
60
61 ### Todo
62
63 - Code generation
64 - ADTs