Hacker News new | ask | show | jobs
by 100phlecs 1290 days ago
When working with Flutter I did dream "It would be pretty amazing to have a Lisp on top of this" - awesome work you're doing here!

Lots of interesting stuff happening in the Clojure space lately.

https://github.com/squint-cljs

It's a strange thought, but I wonder if Clojure (or rather, the clojure community) would somehow "migrate" from the jvm at this rate.

3 comments

No one is "migrating" anywhere.

Clojure has always been about being hosted on different platforms. The best Clojure development experience is probably full-stack Clojure, i.e. JVM Clojure on the backend and ClojureScript on the web—and perhaps ClojureDart for apps. People are implementing Clojure on different hosts because they love the language and want to use it in other contexts, not because they don't like the JVM.

I actually wrote about this phenomenon a few years ago and it reached the top of HN: https://news.ycombinator.com/item?id=22458827

I should probably revisit the topic again, since much has changed in the meantime.

My dream is Clojure hosted on Rust.

It's because Clojure isn't intended to "hide away" the platform underneath and you interact with the platform quite a bit. Since I prefer Rust ergonomics over Java/JVM ergonomics, it'd be awesome to have Rust as a Clojure platform.

One day it will happen - if not by me, then by someone else, I'm sure!

I'm sincerely curious about what you have in mind for "clojure hosted on rust".

Rust has a relatively thin runtime, but heavy static compilation work (types and lifetime and borrowing, etc...) , so it kinda seems like a completely different set of tradeoffs than what clojure favors (dynamicity, late bindings, runtime checks, managed memory, etc..)

Or did you mean "a clojure-like syntax for something that produces rust code to be eventually compiled natively ?"

I think they mean a JIT compiler for a clojure-like language written in rust, with rust interop (instead of Java interop). There would be no static compilation of rust code.
Code is easy, data is hard, the JIT would help with the former only. Rust on JSVM/.NET/JVM/Dart relies on the host platform to provide the underlying object system, reflection, interop with host code, GC etc.
Also, if everything would be ARC then it would be slow as all hell and would leak (it can’t GC circular references)
So basically https://jank-lang.org/ (assuming you don't mean literally it has to be Rust but just any LLVM clojure implementation)
I built a Clojure dialect in Rust called Calcit https://github.com/calcit-lang/calcit . It's ClojureScript at core, despite its indentation-based syntax.
Have a look at Carp for real-time applications: https://github.com/carp-lang/Carp

Carp is a statically-typed, GC-less Lisp that implements Rust’s borrow-checking. It is implemented in Haskell and compiles to C. It shares some syntax with Clojure, but I wish it was more Clojurey.

Carp! A user just turned me onto that, I am looking at porting Matrix to Carp. Matrix started on Common Lisp in the last century. https://github.com/kennytilton/cells
It is called Common Lisp and Scheme.
i dont understand what you mean
No need for Clojure on Rust, when there are already several mature Common Lisp and Scheme toolchains, compiling to native code for the last 40 years.
i am a big advocate for common lisp use but i still don't see your point. are you saying that the whole point of having a clojure on rust is to have native compilation? because i imagine "clojure on rust" for the parent means having a clojure-like-syntax on rust, keeping in mind that rust is a statically typed language (kind of a big point of rust)
Common Lisp supports gradual typing.
Thx! Full marks to the folks at Tensegritics for ClojureDart.

As for migration, Mr. Hickey made a small language, and that made CLJS and CLJD possible. Nice! Now they just have to bring CLJD under the CLJC umbrella...but I suspect that would be a stretch.