Live data from Hacker News

Clojure Scripting on Node.js

github.com

31–35 of 35 posts

Re: Clojure Scripting on Node.js

#32
post #10

Earlier quoted context omitted.

It's not a javascript compiler as Clojure is a hosted language.

Can anyone explain what a hosted language is?

Basically, 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/clj-python/libpython-clj

https://github.com/clojerl/clojerl

https://github.com/clojure-rs/ClojureRS

https://github.com/scicloj/clojisr

https://fennel-lang.org

Re: Clojure Scripting on Node.js

#34

Just as an FYI for the interested, there is a self-hosted version of clojurescript now, it enables macros in the same runtime with some caveats but the main downside (AFAIK) is increased bundle size, which is less relevant for node.js.

There was a self-hosted CLJS project for Node.js which is now abandoned. It was called lumo. It came with a custom image of Node.js with lumo built-in for better startup times since the JS bundle of self-hosted CLJS is quite large resulting in not so great startup out of the box. Nbb is just a library that you can use with any Node.js version. That said, it might be worth revisiting the self-hosted CLJS approach at s…

[deleted]

Re: Clojure Scripting on Node.js

#35

Is this similar to Lumo ( https://github.com/anmonteiro/lumo )? I would assume Lumo has a faster start time since it boots from a V8 snapshot, but otherwise I'd assume the two projects are similar (except that, of course, lumo is EOL)

Nbb still has faster startup time with any system-installed Node.js than lumo with its v8 snapshot.
Post reply on HN