6 ms·
Running Clojure in WASM with GraalVM
- rgyams 1y agoNice, I will revisit closure to try this out
- millerm 1y agoClojure. ;)
- 90s_dev 1y agoYou have no idea how many times I typed clojure when I meant to type closure throughout my career. Bizarrely backwards.
- tomjakubowski 1y agoFor quite some time (maybe even still today?), ClojureScript was compiled to JS using the Google Closure Compiler. I felt sympathy for anyone who had to discuss that out loud.
- sjrd 1y agoThe trick is to call the latter GCC. Much less confusing. ;-)
- tonyarkles 1y agoAnd now I've got coffee in my sinus. Thanks for that :D
- shawn_w 1y agoImagine the pain of talking about Clozure Common Lisp.
- kazinator 1y agoLucky we can do "CCL".
- superhoops540 1y agoWould have been good to create a pamphlet to inform on the differences. A Clojure/Closure Brochure, if you will
- timgilbert 1y agoFor sure.
- _mlbt 1y ago> The output WASM of this simple program is 5.6MB binary, which can be pruned a bit via wasm-opt tool, just make sure that it doesn't break anything for you. Luckily when compressed (gzip, brotli, etc) the binary becomes just ~2.5MB in size. That’s much better than I expected! Very impressive work here. It actually looks viable for certain applications.
- sjrd 1y agoIt's acceptable. Meanwhile 5.6MB of Wasm is about the size of the entire test suite of Scala.js. :-p GraalVM is excellent technology, but when it comes to targeting Wasm, I believe the core language compilers will always have an edge.
- tiffanyh 1y ago> Starting from v25 GraalVM added support for WASM GraalVM is so amazing technically, but gets so little love by HN.
- gavinray 1y agoJust to clarify -- GraalVM had support for RUNNING WASM for quite a long time. This post references the ability to compile programs via native images to WASM as an output format.
- sureglymop 1y agoWhen I tried it it was great but also not easy to use. Things become hard quickly, e.g. If your jvm code uses something like reflection.
- 90s_dev 1y agoI vaguely remember using it about 10 years ago for work, can't remember what for, or anything about that situation, but the one takeaway that I do remember is that it was neat and innovative, but ultimately not good enough to overthrow whatever we were using instead.
- 1y ago
- zusammen 1y ago[dead]
- nzoschke 1y agoGraalVM is neat. I used it to make a program that logs all activity happening on the Pioneer CDJs. The best reverse engineering of the Pioneer protocols is a Java project, but I wanted to write the rest of my application in Go. GraalVM plus a GitHub action spits out native binaries that I can exec and interact with over stdio from Go. If/when the WASM backend supports UDP networking and threads I'd love to run it as WASM instead of a binary. - https://github.com/nzoschke/vizlink https://github.com/nzoschke/vizlink - https://github.com/nzoschke/vizlink/blob/main/.github/workflows/ci.yaml https://github.com/nzoschke/vizlink/blob/main/.github/workfl...
- deleted 1y ago[deleted]
- croemer 1y agoThe analysis of the benchmark is wrong. Native is faster than JVM for 2 out of 4 operations. The 2-3x vs 5-12x are hence not correct.
- apignotti 1y agoShameless plug: CheerpJ is our solution to run any JVM language in the browser, including Clojure. Reflections, Multithreading and Swing / AWT apps are all supported. https://labs.leaningtech.com/blog/cheerpj-4.0 https://labs.leaningtech.com/blog/cheerpj-4.0 And yes, it can run Minecraft :-) https://browsercraft.cheerpj.com/ https://browsercraft.cheerpj.com/
- pjmlp 1y agoThe more the merrier.
- alabhyajindal 1y agoNitpick maybe: It should be Wasm not WASM. https://youtu.be/nnDo0i6NbsI?si=XSqgSVoV6ISBWg2n&t=185 https://youtu.be/nnDo0i6NbsI?si=XSqgSVoV6ISBWg2n&t=185 https://webassembly.org/ https://webassembly.org/
- gitroom 1y agoyes sir, i kinda love seeing all the different ways folks mash stuff together to get dev setups working, so much trial and error that never gets seen - you ever feel like the real blocker is always some weird little detail nobody warns you about?