5 ms·
It's not a javascript compiler as Clojure is a hosted language.
by smcn 4y ago
It's not a javascript compiler as Clojure is a hosted language.
- Barrin92 4y agoclojurescript absolutely compiles to javascript, as per the official docs: https://clojure.org/about/clojurescript https://clojure.org/about/clojurescript
- smcn 4y agoBut that's not what nbb is.
- Borkdude 4y agoNbb isn't a compiler, but a Clojure interpreter. Clojure is a hosted language, but can be compiled or interpreted. The ClojureScript compiler compiles Clojure to JavaScript, but nbb only interprets Clojure.
- kretaceous 4y agoCan anyone explain what a hosted language is?
- ahungry 4y agoCompiles/transpiles into code that runs on a "host" language execution environment (nodejs, JVM, CLR) instead of it's own VM implementation, or native code.
- iLemming 4y agoBasically, you take a programming language and make it work on a platform that meant to be programmed using a different PL. Clojure is hosted by design - it's not Java, but can be used to program for JVM. It ain't Javascript, yet can be used to target nodejs and browser; not an [official] CLR language, but you can write .Net programs. You can use Clojure to make Flutter apps with ClojureDart. You can integrate Python into Clojure with libpython-clj. Or write Clojure to target Erlang/OTP; or Rust; or R; There's even a clojure-like language for Lua - Fennel. There's something about Clojure people like so much, they want it to work atop any platform. https://github.com/Tensegritics/ClojureDart https://github.com/Tensegritics/ClojureDart https://github.com/clj-python/libpython-clj https://github.com/clj-python/libpython-clj https://github.com/clojerl/clojerl https://github.com/clojerl/clojerl https://github.com/clojure-rs/ClojureRS https://github.com/clojure-rs/ClojureRS https://github.com/scicloj/clojisr https://github.com/scicloj/clojisr https://fennel-lang.org https://fennel-lang.org