1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00
bobbylisp/README.md

50 lines
987 B
Markdown
Raw Normal View History

2022-01-23 16:33:43 -06:00
# bobbylisp
2022-01-21 17:43:50 -06:00
another lisp dialect
2022-01-25 21:54:07 -06:00
> Also available on https://git.ablecorp.us/azur/bobbylisp
2022-01-21 17:43:50 -06:00
```lisp
2022-01-23 16:33:43 -06:00
; example/s.blsp
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-26 02:41:31 -06:00
Input(file) -> Parser -> Compile(Bytecode) -> Interpret
String SExprs Bytecode IO
|-> Compile
Assembly(?)
2022-01-23 15:42:08 -06:00
```
2022-01-24 14:08:41 -06:00
## Installation
```bash
$ make
```
or
2022-01-25 21:54:07 -06:00
```bash
2022-01-24 14:08:41 -06:00
$ make debug
```
The binary will be installed in `~/bin/blspc` run it with:
2022-01-25 21:54:07 -06:00
```bash
2022-01-24 14:08:41 -06:00
$ blspc -h
```
2022-01-25 21:54:07 -06:00
### Example
2022-01-26 02:41:31 -06:00
If no `-r` or `-c` specified. It will check for file extension instead.
If found `.blsp`, it will compile, if found `.bsm` it will run vm and interpret the bytecode.
2022-01-25 21:54:07 -06:00
```bash
$ blspc ./example/hello.blsp
2022-01-26 02:41:31 -06:00
$ blspc ./hello.bsm
2022-01-25 21:54:07 -06:00
Hello, World!
```
2022-01-24 14:08:41 -06:00
## Progress:
2022-01-21 17:43:50 -06:00
- [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-26 02:41:31 -06:00
- [X] Compiler