https://github.com/preetam/mini-lisp
A small Lisp implementation in Go
https://github.com/preetam/mini-lisp
go lisp
Last synced: 4 months ago
JSON representation
A small Lisp implementation in Go
- Host: GitHub
- URL: https://github.com/preetam/mini-lisp
- Owner: Preetam
- License: mit
- Created: 2019-03-03T02:29:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-27T20:47:05.000Z (almost 4 years ago)
- Last Synced: 2025-05-30T10:57:51.958Z (7 months ago)
- Topics: go, lisp
- Language: Go
- Size: 23.4 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mini-lisp
A small Lisp implementation in Go.
## Examples
```lisp
;; Factorial
(define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1))))))
(fact 5)
; 120
;; sum2 demonstrating tail recursion optimization
(define sum2 (lambda (n acc) (if (= n 0) acc (sum2 (- n 1) (+ n acc)))))
(sum2 1000 0)
; 500500
```
## Features
* REPL
* Lambdas
* Tail recursion optimization
## References
* [mal - Make a Lisp](https://github.com/kanaka/mal/)
* [(How to Write a (Lisp) Interpreter (in Python))](http://norvig.com/lispy.html)