HeadlinesBriefing favicon HeadlinesBriefing.com

Glojure Brings Clojure to Go with Bidirectional Interop Support

Hacker News •
×

Glojure is a new Clojure interpreter implemented in Go that enables seamless access to Go libraries from Clojure code and vice versa. The project, currently at v0.3.0, treats Glojure as a "hosted" language where Go values function as native Glojure values. Developers can run a REPL, execute scripts, or embed the interpreter directly into Go applications.

The interpreter supports a significant subset of core Clojure while providing out-of-the-box interop with Go standard library packages including net/http, fmt, and os. Unlike other Go-based Clojure implementations, Glojure offers extensible interop and proper concurrency support. Users report success in hobby projects despite the early development stage.

Installation requires Go 1.24 or higher, with binaries available via `go install`. The REPL includes vi/emacs editing modes, tab completion, multiline support, and persistent history. Script execution and expression evaluation work through the glj command-line tool.

Embedding capabilities let Go applications expose custom packages to Clojure code, enabling scriptable configurations and plugin architectures. The project differs from JVM Clojure in number type handling, with platform-dependent int sizes and unsigned bytes. While not production-ready, Glojure represents a practical approach to combining Go's performance with Clojure's functional expressiveness.