25 ms·
I'm looking at the docs -- is there a guide for targeting new host langs? As a starting point, what is the minimum "core" language that needs to be defined in t
by thelazydogsback 7y ago
I'm looking at the docs -- is there a guide for targeting new host langs? As a starting point, what is the minimum "core" language that needs to be defined in the host lang so that the rest of the system can be bootstrapped by Clojure libs? (Clojure.core doesn't seem to be the answer -- there seem to be plenty of non-core/prim functions defined there.
Also, are Clojure libs (either automatically or via attribute on the package) flagged as "pure" (Clojure-only) vs. needing imports from a specific host lang?
- pjmlp 7y agoYes, the special forms. https://clojure.org/reference/special_forms https://clojure.org/reference/special_forms Clojure follows the Lisp convention of providing platform specific behaviour via the reader. https://clojure.org/guides/reader_conditionals https://clojure.org/guides/reader_conditionals
- thelazydogsback 7y agoNot sure I follow -- there are certainly many primitives that must be defined by the host to bootstrap that are not special forms -- starting with list, cons/conj...
- filoeleven 7y agoI doubt there’s a guide anywhere: it’s far from a trivial undertaking. If you want to look at the Java code that builds all the primitives, see the Clojure/Lang folder: https://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang https://github.com/clojure/clojure/tree/master/src/jvm/cloju... Part of what makes it Clojure instead of just a Java-based lisp are the persistent data structures that allow for efficient immutability, and the seq interface for working with collections smoothly. There’s a big (scary, to my eyes) set of classes that underlies all of the convenience. Thankfully it’s very stable so I don’t have to think about it.