4 ms·
I really wish there was a Clojure-like Lisp that wasn't married to the JVM. Yes, I know there are a few, but nothing compiled :(
by packetlost 4y ago
I really wish there was a Clojure-like Lisp that wasn't married to the JVM. Yes, I know there are a few, but nothing compiled :(
- MegaSec 4y agoDepending on what you're going for, you could use GraalVM.
- packetlost 4y agoSure, but the real problem is you're tied to the JVM ecosystem of tooling to some extent
- haimez 4y agoOne persons problem is another persons… enormous stack of existing tooling. You’re not wrong, but the knife cuts both ways on that point.
- djha-skin 4y agoIt is ridiculously difficult to use native-image. The only one I know of to successfully pull this off in a broad wide-ranging program is the author of babashka, Michael Borkent. The man is a legend, and using his work I was able to get my program to run on Linux, but getting it to run Windows was a whole nother hurdle and I wasn't willing to continue. Keeping track of all of those jira issues and matching Clojure releases with native-image releases and getting all the configuration files right and writing the scripts that you need to write the configuration files, and then waiting 30 minutes for anything of value to compile, not really an ideal development cycle scenario.
- kasajian 4y agotbh, it worked pretty easily under windows. 1. use vcvars64.bat, usually in ...\Community\Common7\Tools\vcvars64.bat or ...\Enterprise\VC\Auxiliary\Build\vcvars64.bat 2. lein uberjar 3. Setup GraalVM: set JAVA_HOME=C:\Program Files\GraalVM\graalvm-ce-java17-22.3.0 4. native-image --no-fallback -jar target\default+uberjar\clojuresque-0.1.0-SNAPSHOT-standalone.jar (you have to tweak with the paths above, depending on your system. The resulting executable isn't small, but it starts quickly and doesn't depend on anything on the system other than MS C-runtime redistributable.
- djha-skin 4y agoSure, sure, the base case is easy. I would be more impressed with an example that has datalevin or SQLite as a dependency, though. Also Cheshire and/or jetty. Real-world dependencies make it difficult.
- thih9 4y agohttps://janet-lang.org/ https://janet-lang.org/
- packetlost 4y agoJanet seems cool!
- owyn 4y agoCheck out https://ferret-lang.org https://ferret-lang.org? Mostly Clojure syntax (files are .clj) but reduces to C++. Seems to be mostly for embedded/microcontroller applications, Arduino, raspberry etc. Doesn't depend on the stdlib and can run with or without a GC and in as little as 2k of RAM apparently, which is pretty neat!
- djha-skin 4y agoColor me intrigued.
- pyb 4y agoClojurescript
- mtlmtlmtlmtl 4y agoThere's Cloture which is a partial implementation of Clojure on top of Common Lisp. Though it's unfinished and seemingly abandoned for now.
- drikerf 4y agoWhy? Just curious. I've found the JVM to be surprisingly stable and great to work with.
- ARandomerDude 4y agoI love Clojure but the JVM is admittedly resource hungry.
- drikerf 4y agoI haven't found that to be an issue. For small programs there's also babashka.
- djha-skin 4y agoSuper long startup times and large binary size are what turned me off. This is clojure specifically not jvm specific. I find the JVM to be fine, but when I looked for another lisp I did want one that was compiled just because it was easier to distribute my programs.
- didibus 4y agoYou can compile it to a native binary, then you get super fast startup times and small-ish binary sizes.
- djha-skin 4y agoI invite you to try it. Put together a modest CLI that does SQLite, some network calls, and unzips files. ( https://github.com/djhaskin987/zinc https://github.com/djhaskin987/zinc ). Using native-image with any reasonable set of dependencies like this is *horrendous*. Just because you can doesn't mean it's tractable. I spent 10% of my time writing the tool and 90% of it trying to get it to compile. Absolutely the worst experience trying to get something to build in my life, and I'm a devops engineer. Building and shipping code is my thing.
- 4y ago
- djha-skin 4y agohttps://github.com/carp-lang/Carp https://github.com/carp-lang/Carp Clojure like syntax, Rust like internals.
- kitd 4y agoBabashka is Clojure running natively. It uses a simplified version of the Clojure runtime compiled to native code. No JVMs involved at runtime. https://babashka.org/ https://babashka.org/
- nathell 4y agoBabashka is interpreted, though (with SCI), so it doesn’t quite meet the GP’s dream.
- kitd 4y agoGood point. Alternative is to compile your Clj uberjar using GraalVM. Here's a project to document how to do that and which common libraries are compilable: https://github.com/clj-easy/graalvm-clojure https://github.com/clj-easy/graalvm-clojure
- didibus 4y agoIf you have it working in babashka though, it means it can also be used with Clojure and compiled to native using GraalVM. So anything that runs in babashka can be compiled to native as well. At least in theory.
- didibus 4y agoThis isn't usable yet, but in active development by the author, and looks promising: https://jank-lang.org/ https://jank-lang.org/