Fork me on GitHub
#unrepl
<
2018-01-15
>
pesterhazy09:01:48

@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

dominicm16:01:39

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

pesterhazy16:01:42

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

dominicm16:01:24

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

cgrand16:01:10

@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

dominicm16:01:24

@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.

cgrand16:01:33

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

cgrand16:01:51

lumo doesn’t snapshot everything

cgrand16:01:25

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

dominicm16:01:07

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.

cgrand16:01:29

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

dominicm17:01:18

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 😄

richiardiandrea17:01:14

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

hlolli20:01:22

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).

richiardiandrea21:01:52

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

hlolli22:01:41

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