unrepl

discussing specification of an edn-based repl and its implementations.
pesterhazy 2018-01-15T09:45:48.000466Z

@cgrand no, but it should be possible 1) compile the cljs into a bundle and then 2) use browserify or whatever to bundle that into a single self-standing js file

dominicm 2018-01-15T16:09:39.000268Z

@pesterhazy I think the magic of Lumo is that it gets the cljs startup time into a reasonable boundary by using aggressive caching.

pesterhazy 2018-01-15T16:25:42.000432Z

@dominicm it'll always be slower to run everything through the cljs compiler at runtime (via lumo) than compile ahead of time

dominicm 2018-01-15T16:34:24.000386Z

I'm not 100% certain of that. Isn't there some serious v8 caching going on in lumo?

cgrand 2018-01-15T16:43:10.000696Z

@dominicm isn’t this the same thing but one layer below? AOT Cljs to js is faster than JIT Cljs AOT js to native is faster than JIT js

dominicm 2018-01-15T16:45:24.000630Z

@cgrand Lumo uses this to start cljs fast: https://v8project.blogspot.de/2015/09/custom-startup-snapshots.html and I think there's some work involved in getting cljs to play nicely with it.

cgrand 2018-01-15T16:47:33.000070Z

@dominicm ok my “native” was a bit handwavy 🙂

cgrand 2018-01-15T16:47:51.000587Z

lumo doesn’t snapshot everything

cgrand 2018-01-15T16:48:25.000637Z

that’s why source code is split between bundled and snapshot directories.

dominicm 2018-01-15T16:55:07.000334Z

No, sure. I was just of the impression that there was a lot more magic to it than being able to compile cljs->js aot & still be fast enough.

cgrand 2018-01-15T16:56:29.000256Z

There may be. Snapshotting is definitely not a free lunch otherwise there wouldn’t be the split, everything would go into snaphsot

dominicm 2018-01-15T17:03:18.000484Z

I think it's work to get code to be compatible. No free lunch, that's why we get to piggieback on Antonio's free work 😄

richiardiandrea 2018-01-15T17:35:14.000129Z

btw folks, there is a patch in progress on packing "executables" with lumo - would be really great to finish it up as library probably (if possible): https://github.com/anmonteiro/lumo/pull/315

2018-01-15T20:58:22.000430Z

yup I'm going to make a seperate npm package for this code. I spent 2 weeks straight on this, was able to create binary but there are many details to think about. If one is serious about creating executeable then compileing cljs to js and take that code and pkg it would be the fastest and cleanest solution, but then we loose the cljs repl. The "problem" with my solution, is that it takes prod-npm deps (all :dependencies from package.json) and bundles it and patches the node module loader to read base64 and evaluate it. It works but is not clean. (beautiful thing about my code is that it only bundles the cljs aot's, so it should be from clean cljs code fast startup).

👍 1
richiardiandrea 2018-01-15T21:31:52.000032Z

Awesome work! What was the exe size? Just curious :simple_smile:

2018-01-15T22:56:41.000276Z

Not counting the database file I embedded, then it was the size of lumo plus <2Mb

richiardiandrea 2018-01-15T23:48:29.000197Z

@hlolli thanks