4 ms·
Nbb is to CLJS what babashka is to JVM Clojure. Both scripting environments are implemented using SCI, a Clojure(Script) interpreter which re-uses all the core
by Borkdude 5y ago
Nbb is to CLJS what babashka is to JVM Clojure. Both scripting environments are implemented using SCI, a Clojure(Script) interpreter which re-uses all the core functions when you call those, the rest (creating vars, functions, namespaces) is interpreted "glue code" and that code isn't compiled (to bytecode or JS); instead it uses interpretation while trying to stay as close as possible to the host language. There are some things that are currently not supported, most notably deftype. For SCI on JS this is just a matter of time, but on JVM the target for SCI is mostly GraalVM images which come with the restriction that you can't implement new types at runtime. SCI originates mostly from the work on babashka, but with nbb, I'm adding better support for CLJS over time.
As for third-party libs: it depends if they are written in the subset that SCI supports. If the library is useful enough for scripting then it can be considered for added as a built-in. The classpath support is still something under development, but it already works for gitlibs. Here is an example of running HoneySQL from source in nbb: https://github.com/borkdude/nbb#classpath https://github.com/borkdude/nbb#classpath.
Just let me know if something doesn't work out (on Slack or Github issues/discussions).
- brundolf 5y agoThanks! I'm not sure I'll use it for anything, I haven't really used ClojureScript, I'm just a language geek who was curious :)
- Borkdude 5y agoWell yeah, that might be a good use case for nbb too: people who just want to try out a bit of "CLJS" without spending too much time on setup first.