Greetings loafers! (ฮป-gophers haha, get it?)
This is supposed to be a compiler and bytecode VM for a language resembling Clojure as close as possible.
Now, I know about candid82/joker and I ๐ it. Though, it has some drawbacks and design choices that I'd like to avoid.
Here are some nebulous goals in no particular order:
- Quality entertainment,
- Implement as much of Clojure as possible - including persistent data types and true concurrency,
- Provide comfy two-way interop for arbitrary functions and types,
- Serve primarily as an embedded extension language,
- AOT (let-go -> standalone binary) would be nice eventually,
- Strech goal: let-go bytecode -> Go translation.
- Pure Go, zero dependencies.
Here are the non goals:
- Stellar performance,
- Being a drop-in replacement for clojure/clojure at any point,
- Being a linter/formatter/tooling for Clojure in general.
Can compile and eval basic Clojure flavored lisp.
(test "Y combinator"
(let [Y (fn [f] ((fn [x] (x x))
(fn [x]
(f (fn [y] ((x x) y))))))
fac-gen (fn [func] (fn [n] (if (zero? n) 1 (* n (func (dec n))))))]
(= 120 ((Y fac-gen) 5))))
See tests for more examples.
Building or running let-go from source requires Go 1.16. There are no binary releases yet.
Sure, you can! Just keep in mind that we're not there yet and it will likely blow up in your face. Just remember to leave an issue when it does ๐
The best way to take let-go
for a spin right now is to clone this repo and run the REPL like this:
go run .
To run an expression:
go run . -e '(+ 1 1)'
To run a file:
go run . test/hello.lg
Use the -r
flag to run the REPL after the interpreter has finished with files and -e
:
go run . -r test/simple.lg # will run simple.lg first, then open up a REPL
go run . -r -e '(* fun 2)' test/simple.lg # will run simple.lg first, then (* fun 2) and REPL
To build the standalone interpreter:
make
This will produce the lg
executable.
Follow me on twitter for nightly updates! ๐