Fork me on GitHub
#portkey
<
2019-12-13
>
stathissideris13:12:05

hello, I was wondering about the Kryo mechanism: would it not be easier to target Lambda node.js and rely on the Cljs compiler (+Closure) to do all the packaging/tree shaking of cljs code (instead of clj)?

stathissideris13:12:40

(and that would take care of the startup time as well)

cgrand14:12:46

portkey goal was to experiment with a repl-driven workflow (think use cloud resources as a coprocessor for explorative programming, one-off tasks etc), not to deploy “poduction” lambdas. Without this requirement there’s no need for kryo. On JS VMs, there’s no way (unlike things have changed) to examine a closure (to get the closed over values), so no way to serailaze a live graph of objects. Advanced compilation + Closure gives you static treeshaking, while for this repl stuff it was dynamic tree shaking that was required. Graph of code modules vs graph of objects.

cgrand14:12:12

Do you see what I mean?

viesti14:12:45

in portkey, you would start tree-shaking from a function object at the repl, closing over whatever state you had in the repl

viesti15:12:50

Graal/native-image gives nice startup time and you can keep the synchronous programming model + Java ecosystem (to a degree that works nice with native-image)

viesti15:12:09

for JavaScript, I think shadow-cljs is a nice option, since consuming npm libs works well and Closure compacts the JavaScript outputted by CLJS + minifies npm libs

viesti15:12:14

the previous two options have both their merrits, but differ from the dynamism that portkey was experimenting with

stathissideris15:12:57

@cgrand @viesti thanks for the insight, I hadn’t thought of the live aspect of it!

stathissideris15:12:53

I’m considering experimenting with cljs+aws lambda+terraform for “production” lambdas

viesti15:12:45

btw. Terraform has a nice way of creating Lambda zip file, and upload it if shasum changes

stathissideris15:12:05

I am aware 🙂

👍 4