Glojure is an interpreter for Clojure, hosted on Go. Glojure provides easy access to Go libraries, similar to how Clojure provides easy access to Java

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-11-29 10:00:06

Glojure is an interpreter for Clojure, hosted on Go. Glojure provides easy access to Go libraries, similar to how Clojure provides easy access to Java frameworks.

Glojure is in early development; expect bugs, missing features, and limited performance. Backwards compatibility is not guaranteed until a v1 release. That said, it is used successfully in hobby projects and runs a significant subset of the (transformed) core Clojure library.

Note that unlike most other Go implementations of Clojure, Glojure is a "hosted" language - a term used to describe languages that are implemented in terms of a host language (in this case, Go). This means that all Go values can be used as Glojure values and vice versa.

Glojure ships with interop with many standard library packages out-of-the-box. Go package names are munged to avoid ambiguity with the use of / to refer to namespaced symbols; instances of / in package names are replaced with $. Here's a simple example:

To expose additional packages, you must generate a "package map" and compile your own executable that imports both your package map and the Glojure API. See the section below for more details.

Leave a Comment