2022-01-21 17:43:50 -06:00
|
|
|
# vl
|
|
|
|
another lisp dialect
|
|
|
|
|
|
|
|
```lisp
|
2022-01-23 15:49:27 -06:00
|
|
|
(fun factorial (x)
|
2022-01-21 17:43:50 -06:00
|
|
|
(if (<= x 1)
|
|
|
|
1
|
|
|
|
(* x (factorial (- x 1)))))
|
|
|
|
|
|
|
|
(do
|
2022-01-23 15:49:27 -06:00
|
|
|
(print (factorial 7)))
|
2022-01-21 17:43:50 -06:00
|
|
|
```
|
|
|
|
|
2022-01-23 15:42:08 -06:00
|
|
|
Compliation flow:
|
|
|
|
```
|
2022-01-23 15:49:27 -06:00
|
|
|
Input(file) -> Parser -> Interpret(TODO)
|
|
|
|
String SExprs IO
|
|
|
|
|-> Compile(TODO)
|
|
|
|
File
|
2022-01-23 15:42:08 -06:00
|
|
|
```
|
|
|
|
|
2022-01-21 17:43:50 -06:00
|
|
|
Progress:
|
|
|
|
- [X] Lexer & Parser
|
2022-01-22 15:36:13 -06:00
|
|
|
- [ ] Syntax checker & Type checker
|
2022-01-23 15:49:27 -06:00
|
|
|
- [ ] Interpreter
|
2022-01-22 15:36:13 -06:00
|
|
|
- [ ] Compiler
|
|
|
|
|
|
|
|
Problems:
|
|
|
|
- Parser can't detect `(()))` syntax error.
|