4 ms·
ClojureScript: Graal.js REPL Environment
- tosh 8y agoSupports GraalVM 19.0.0 https://twitter.com/mfikes/status/1126627560157253632?s=21 https://twitter.com/mfikes/status/1126627560157253632?s=21
- keymone 8y agoPolyglot Ruby is invoked from Clojurescript which transpiles to JS which runs on GraalJS implementation running on GraalVM extension to the JVM? this is both impressive and terrifying.
- new4thaccount 8y agoYea, I'm sure it's impressive work far beyond my skills, but that sounds like a monument to complexity. There are a lot of things to not like about Smalltalk, Forth, and Lisp, but their systems seem to be so much more knowable. Put another way, I question the longevity of these franken-systems. I doubt people will be maintaining each one of those layers in 10 years let alone 40. I used to make fun on Cobol and Fortran a lot, but now see that we've traded some inefficiencies for a large jump in systems complexity. Yea it only takes 5 pages of code for your app, but another million are being executed. I guess the economics make sense and the developer speed of development and more systems to target makes it worth it.
- Moru 8y agoHave you tried to make a "Hello world" in Microsofts latest creation? Far away are the days of 58 bytes hello world examples.
- new4thaccount 8y agoI'm mostly a high level dynamic language guy, but have played with hello works in Nim, D, Ada, C++, and C on Linux and Windows. I believe most are in the 400kb range iirc.
- new4thaccount 8y agoJust tried GFortran on Linux and it was 16kb if that helps.
- jmiskovic 8y agoI'm not sure this is meant for production? I understood it as way to call other language functions from this REPL, for convenience. You'd replace those calls with ClojureScript code. As for maintenance, I'm not worried about JVM and JS at least.
- new4thaccount 8y agoAh, fair points
- svieira 8y agoActually, since this is Graal the Ruby implementation here is almost certainly https://github.com/oracle/truffleruby https://github.com/oracle/truffleruby so you're invoking Ruby in the same compiler _and process space_ that underlies GraalJS (no transpilation to JS needed). That means the JVM can optimize calls between JS and Ruby (inlining JS values into Ruby method call sites, and vice versa).
- keymone 8y agoright, i meant clojurescript is transpiled, not ruby. still, cool detail, thanks!
- lvh 8y agoI've been working with GraalVM a bunch and one of the things I'm most excited about is that it also supports LLVM via Sulong. This is great because it means I finally have to care a lot less about native v JVM gaps, and it becomes much easier to ship non-JVM code as part of the same app :-)
- the-alchemist 8y agoI had to look up Sulong [1]. Basically, as long as LLVM can compile your code, you can use it with GraalVM. i.e., call C/C++ functions from Javascript through GraalVM. [1] https://github.com/oracle/graal/tree/master/sulong https://github.com/oracle/graal/tree/master/sulong
- mfikes 8y agoAdditionally, the Graal team has done some great work to ensure that the JavaScript produced by ClojureScript runs quickly under Graal.js. For more details, see https://github.com/graalvm/graaljs/issues/29 https://github.com/graalvm/graaljs/issues/29
- harlanji 8y agoSo happy to see options for Cljs expanding. Glad I took those horrendous NodeJS dev jobs after a year of Clojure in the data pipeline, for the modern JS RT exp. I am just chillin’ out of tech and waiting for things like this to make me employable again, as I build my dream stack at Starbucks each morning. It’s like waking up is going into the dream lately :).
- escherize 8y agoI've had a wonderful time designing a Santorini (the board game) clone[0] in clojure/script. The game logic is written once and used on the client for local play and on the server for realtime multiplayer. The polymorphism clojure offers (multimethods here) came in handy for dispatching websocket messages, and for drawing pieces onto the board. [0] https://buildtowers.club https://buildtowers.club