HN user

mfikes

226 karma
Posts3
Comments64
View on HN

I haven't. But I suspect that's next. If you compare things like Lumo / Planck (ClojureScript) to Babashka (GraalVM-based Clojure), you can clearly see the perf benefits of going native.

This stuff is arguably just an initial foray into the embedded world. You could imagine a Clojure dialect or compiler that emits WASM, or C, or even native code.

The primary challenge is RAM. The (simplistic) approach I took with establishing a ClojureScript REPL is to have the standard library available, and that requires a lot more RAM than most Espruino boards have. Even with the ESP32, I had to make a few tweaks to Espruino in order to make more of the ESP32's RAM available.

Perhaps a more sophisticated approach could be devised involving "faulting in" ClojureScript standard library functions on demand as they are used, and by doing this use less RAM and reduce startup latency. If that were done, things would run on a broader range of chips (less RAM needed).

I personally mainly use Replete for quick checks of things when AFK (seeing what a particular form might evaluate to, checking a docstring, etc.) In, short I've never really used Replete for any heavy development.

When Lisping existed (it is evidently no longer available), I was never really motivated to use it to develop code with Replete.

For those curious, Replete relies on the ability of ClojureScript to self-host, and thus essentially carry its compiler with it.

Replete iOS was one of the first applications of self-hosted ClojureScript (around 2015, the first time we could evaluate ClojureScript forms directly on iOS, no JVM in sight).

Just recently Replete was ported to Android, via some amazing work of Roman Liutikov.

It is all open source, for those interested in how it works: https://github.com/replete-repl/

I'm astounded by the pace of progress. It was only mid-2015 that ClojureScript first self-hosted [1], roughly year ago when it was stable [2], and mid-2016 when I had first heard that Google Closure runs in JavaScript [3], and now this.

Bravo António! Keep up the great work. :)

[1] http://swannodette.github.io/2015/07/29/clojurescript-17

[2] https://twitter.com/mfikes/status/702243790225068032

[3] https://twitter.com/swannodette/status/752957621204692992

CLJS Fiddle is based on bootstrap (self-hosted) ClojureScript, so it includes the entire compiler in the JavaScript downloaded. But, there are things that can be done to improve things, even in this situation (work to make artifacts smaller, bring up UI while things load, etc.)

This is cool, IMO. My main ClojureScript experience to date has been non-web (mobile, bootstrap, etc.), but this fiddle even makes it ridiculously easy for someone like me to quickly try an idea out and just experiment.

No need to run through the ClojureScript "Quick Start"—this is just "Start". :) Bravo!

This reminds me of one of the points pg makes in What Made Lisp Different [1], under #9:

  "compiling at runtime is the basis of Lisp's use as an extension language in programs like Emacs"
This Excel capability is an extremely cool demonstration of where ClojureScript's self-hosting capability can take us. Seems like there's no stopping it. Kudos to Christian Felde!

[1] http://www.paulgraham.com/diff.html

I believe nvbm's demo running Bocko on Android using ClojureScript is actually using JavaScriptCore.

Rhino is indeed much slower; that's why Tahmid Sadik is motivated to covert Replicator to use JavaScriptCore over Rhino.

If you're referring to the 5× — 7× speed difference for Bocko I included at bottom of the article, I'd be interested in knowing as well. :) Perhaps nvbm (the author) could shed some light. I can only hazard to guess that JavaScriptCore is simply more heavily optimized to reduce startup latency, with this really paying off in the mobile environment.