3 ms·
Thanks for the shout out. :) It's always great to see more Clojure dialects. For those jankers wondering what Glojure means for Clojure on native, the main thi
by Jeaye 2y ago
Thanks for the shout out. :) It's always great to see more Clojure dialects.
For those jankers wondering what Glojure means for Clojure on native, the main thing to note is that Glojure is an interpreter. No JIT or AOT compilation (right now). Looks like it's a great start for an interpreter, though. Not quite ready for prime time, given some of the todos in the code [0], but the structure of it looks quite intentional. Based on some of the code [1], it looks like the analysis could be largely a port of tools.analyzer, which is honestly a smart way to do it.
To the author, you may be interested in the clojure.core-test intitiative [2]. I'm aiming to get a good test suite for all Clojure dialects.
0: https://github.com/glojurelang/glojure/blob/e54deb6597ceafd39b497c096262adf1d8963c24/pkg/runtime/evalast.go#L270 https://github.com/glojurelang/glojure/blob/e54deb6597ceafd3...
1: https://github.com/glojurelang/glojure/blob/e54deb6597ceafd39b497c096262adf1d8963c24/pkg/compiler/analyze.go#L279 https://github.com/glojurelang/glojure/blob/e54deb6597ceafd3...
2: https://github.com/jank-lang/clojure.core-test https://github.com/jank-lang/clojure.core-test
- jfhamlin 2y agoGlojure author here! Your analysis is spot-on :). I'll definitely take a look at clojure.core-test. As components mature, I focus on improving compatibility by porting tests from Clojure [0], but they often require modifications to accommodate differences in the host language. As you noted, there are still several fundamental features missing — most notably some core data structures. That said, the implementation is robust enough to support another non-trivial hobby project [1]. A bit more detail on some of your observations: > No JIT or AOT compilation (right now). I do plan to implement AOT compilation eventually. JIT, however, is more complex. Go's "plugin" standard library [2] could serve as a mechanism, but its support is limited and not without issues [3]. > it looks like the analysis could be largely a port of tools.analyzer Exactly! Another key implementation strategy has been the handling of clojure.core. Instead of reimplementing everything from scratch, the Clojure 1.11 core libraries are programmatically transformed to work with Go [4]. However, this approach has its downsides — many functions appear to be available but are non-functional because parts of their implementation haven't yet been adapted. And by the way, impressive progress on Jank! I've been following it closely and really admire the work you're doing. [0] https://github.com/clojure/clojure/tree/master/test/clojure/test_clojure https://github.com/clojure/clojure/tree/master/test/clojure/... [1] https://github.com/jfhamlin/muscrat https://github.com/jfhamlin/muscrat [2] https://pkg.go.dev/plugin https://pkg.go.dev/plugin [3] https://github.com/golang/go/issues/19282 https://github.com/golang/go/issues/19282 [4] https://github.com/glojurelang/glojure/tree/808165fdc7e656720b9a1fb270e8ee1ed942e18c/scripts/rewrite-core/originals https://github.com/glojurelang/glojure/tree/808165fdc7e65672...