Fork me on GitHub

Hi, stupid question - what are the important differences between lumo and planck? I see that they're using different js engines, but what does that mean in practise? Both engines are presumably running javascript close to Ecmascript, and the differences I know about are: (import style), (default-accessible libraries). If one tried to use Planck to compile a "my-node-bundle.js" then tried to run that in nodejs what concretely wouldn't work? Also if one tried to call planck /from/ nodejs, what wouldn't work?


@zimablue Planck is specifically built around JavaScript Core. The README suggests using lumo if you want to use Node.js libraries: Note that there is now also #nbb, a CLJS interpreter which works on Node.js. Now that lumo is unmaintained, maybe the Planck readme could mention #nbb as an alternative there as well. What do you think of this @mfikes?


@borkdude Yes, if I don't add that feel free to submit a PR


@zimablue Lumo also runs on Windows. For your other question, if you compiled a JS with Planck you might be able to get it to run in Node, but there would perhaps be issues with dependency loading (a JS is typically created per namespace). If you wanted to make a JS file that runs in Node, I'd just use the ClojureScript compiler. In terms of calling Planck from Node, I suppose you can have Node shell out... Planck is just a native process.


thanks for explaining


in terms of calling planck from node, why would you have to shell out? I thought at the bottom there would be a .js file which is "the compiler", why wouldn't it be possible to import that from node?


I get that it might be wrapped in a .sh but there's a javascript file somewhere doing all of the work right


I suspect that this is a very stupid question, sorry


@zimablue Well, Planck is a binary, much like Node is a binary


I think, reading the code, the thing I didn't realize is that Plank uses c for actual work right? I thought it was a bootstrapped cljs compiler but it's actually c at the bottom? Therefore there's no javascript runtime that could call it and run it without using shell, unless the c was compiled to webassembly?


I think I got scrambled, started here: , so someone somewhere made something like a bootstrapped cljs compiler, but that's not what Planck is?


@zimablue Planck is a C-based environment that hosts self-hosted ClojureScript


I think I'm closer to understanding, I read more of the source code. Somewhere, "cljs" files must get turned into "js" files if you're using the closure compiler, but I can't see precisely where. I can see it happening in "", where "" is called, that's the essence of the "bootstrapped compiler" right?


@zimablue Self-hosted ClojureScript is an inherent capability of CloureScript. Plank is just one consumer of that capability. Here is a talk I gave that explains some of the fundamental concepts: