Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daneelsan/tinylisp
Lisp implemented using NaN boxing
https://github.com/daneelsan/tinylisp
lisp zig
Last synced: 22 days ago
JSON representation
Lisp implemented using NaN boxing
- Host: GitHub
- URL: https://github.com/daneelsan/tinylisp
- Owner: daneelsan
- Created: 2023-01-10T15:35:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T00:41:33.000Z (over 1 year ago)
- Last Synced: 2024-11-14T20:37:40.584Z (3 months ago)
- Topics: lisp, zig
- Language: Zig
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tinylisp
A lisp implemented using NaN boxing and in Zig.
## Examples
### Arithmetic
add, sub, mul, div:
```lisp
In[]:= (add 1 2 3 4)
Out[]= 10
``````lisp
In[]:= (div 3.4 4)
Out[]= 0.85
```### Structural
car, cdr, cons:
```lisp
In[]:= (car '(1 2 3))
Out[]= 1
``````lisp
In[]:= (cons 1 2)
Out[]= (1 . 2)
```## Build
Compiled using zig version:
```shell
$ zig version
0.11.0
```Compile the main.zig file using `zig build-exe`:
```shell
$ zig build-exe src/main.zig$ ./main
```Or run it directly using `zig run`:
```shell
$ zig run src/main.zig
```## TODO:
- [] Compile to .wasm and add a javascript REPL
- [] Expand documentation## Resources
* [Lisp in 99 lines of C and how to write one yourself - Robert-van-Engelen](https://github.com/Robert-van-Engelen/tinylisp#lisp-in-99-lines-of-c-and-how-to-write-one-yourself)