Show HN: I made a Clojure-like language in Go, boots in 7ms
Let-go is a Clojure-like language (~90% compatible with JVM Clojure) written in pure Go. It ships as a ~10MB static binary and cold boots in ~7ms - that's about 50x faster than JVM and 3x faster than Babashka. It has decent throughput on algorithmic workloads - within ballpark of the GraalVM-backed sci.I started this project in 2021 as an elaborate practical joke: I wanted to have an excuse for writing Clojure while pretending to write Go.Jokes aside, it turned out to be pretty decent: it feels like real Clojure, it has an nREPL server (supported in Calva, CIDER, etc.), it's easily embeddable in your Go programs (funcs, structs and channels cross the boundary without fuss). It's good for writing CLIs, web servers, data processing scripts and even doing some systems programming - I used it to write a deamonless container runtime. Oh, and it runs on Plan9.Under the hood there is a fairly simple compiler and a stack VM, both handcrafted specifically for running Clojure-like code. The compiler can work in AOT mode producing portable bytecode blobs and standalone binaries (runtime+bytecode).This is not a drop-in replacement for Clojure in general - it does not load JARs, it does not have all Java APIs and it most probably won't run your exiting Clojure projects without modifications. At least not at the moment.Take it for a spin, tell me what you think. Issues and PRs are welcome!
182 points by marcingas - 48 comments
As far as JVM-free Clojure-like, Janet is really nice. I've been using it in production for a while: https://janet-lang.org/ There's also Fennel if you want the Lua vm and libraries.
Gloat is a Glojure AOT automation tool. I worked with James Hamlin to get Glojure AOT going last summer and have been moving it forward since. I've also been working with marcingas (nooga) to get Gloat/Glojure/let-go all cooperating.
Thanks for your work will definitely check it out again once I get over renewed love for cpp (26)
Edit how did glojure go under my radar also a great project from the looks
I think it is brilliant and completely underappreciated :)
I'm trying to avoid adding too much though, I like that let-go fits in 10MB :)
So far Lisette (http://lisette.run) seems to be the best/most active version of a compile to Go language out there.
Is it possible for now?
Excellent work, thank you for sharing it with us ^_^
https://github.com/glojurelang/glojure
You can also refer to the HN post itself - it says why I think it's cool.
i appreciate you taking my feedback with grace.
I genuinely don’t understand why people do this.
Now I work for a fully remote team, can work anywhere in the world, at any moment I want, leading the data / cloud team for a distributed timeseries database.
Can’t complain. :)
Clojure has had a huge, fundamental impact on my way of approaching software development. I actually came from a Haskell / C++ background, but the way Clojure treats data still has a fundamental impact on how I reason about data, architecture and simplicity.
I did have some issues with how Clojure is managed and do not always subscribe to Rich’s vision (I think core.spec makes no sense, a heavily macro based global state registry is fundamentally not how I would design this, and malli is infinitely better. same for core.async vs manifold), but that is a minor detail in what was a transformative experience for me.
I believe I am not alone when I say this.
I’m still following things from a distance. Considering the current thread, I’m actually very interested in yank, which is Clojure on LLVM, and have been sponsoring that project for a few years. That would be very nice if it could enter stable state, I may take another look again.
https://github.com/nooga/let-go/tree/d9dc094822b2983ebf44604...
In 2023 he had a working Clojure compiler with:
Macros with syntax quote, Reader conditionals, Destructuring, Multi-arity functions, Atoms, channels & go-blocks a'la core.async, Regular expressions (the Go flavor), Simple json, http and os namespaces, Many functions ported from clojure.core, REPL with syntax-highlighting and completions, Simple nREPL server that seems to work with BetterThanTomorrow/calva,