CrAC with Clojure
Anton Kozlov
akozlov at azul.com
Tue Jul 26 09:20:05 UTC 2022
Hi Ethan,
You may refer to [1] as the entry point. A step-by-step guide [2] should provide a basic understanding of the flow.
For the command-line examples please refer to PR [3] and [4]. These have a demo code and another example workflow.
And for packing as a docker image, you may refer to a java lambda example [5].
Thanks,
Anton
[1] https://github.com/CRaC/docs
[2] https://github.com/CRaC/docs/blob/master/STEP-BY-STEP.md
[3] https://github.com/openjdk/crac/pull/21
[4] https://github.com/openjdk/crac/pull/16
[5] https://github.com/crac/example-lambda
On 7/25/22 21:45, Ethan McCue wrote:
> Hey all,
>
> I'm looking into how CrAC could be used to improve startup time for the specific case of Clojure programs.
>
> Clojure in particular has a longstanding issue with startup time related to the initialization of its runtime environment. This is a big issue with runtime environments like AWS lambda.
>
> The solutions in the community are to compile ahead of time with graalvm or to use an alternative clojure implementation like babashka or nbb. Both of those have some asterisks attached, so it would be nice if a potential flow could be
>
> 1. Spin up a JVM in CI
> 2. Load Clojure code and do the expensive stuff like var initialization
> 3. Dump the state of that JVM with CrAC
> 4. Package up that state dump into something like a Dockerfile
>
> I'm able and willing to help with the clojure side of things, but I don't feel like I have a good enough understanding of the CrAC prototype to pull off the rest so I'm reaching out here in case there are any interested folks who know how to do.
More information about the crac-dev
mailing list