What would make OCaml serverless ready?
17 points by avsm
17 points by avsm
unikernels and https://mirage.io not mentioned is a bit of a bummer.
Mirage works fine; the everything-as-a-library approach there means that it's just a matter of adding one of Chris' serverless targets as a linking backend.
worth a mention, isn't it?
The original reason I called the project "Mirage" was in the hope that it would disappear and just become the default way most (OCaml) code was written. So it's not great from a publicity perspective, but rather wonderful from an ideological perspective to see this style of programming be so pervasive in OCaml these days.
That's interesting. I always thought "Mirage" was just another camel-themed name, since camels and mirages are usually found in the same locations.
Thomas Gazagnaire helped me pick terms that are cognate in French and English :-) The previous iteration of the project was called "Melange" https://github.com/avsm/melange
I sadly have no experience with ocaml, how is the startup of its runtime? Id say thats probably the most important part for anything used in serverless computing
OCaml does very little work at startup. OCaml 5+ does a little bit more with the setup of thread machinery, but it's the reason why we could get the kinds of low latency numbers with OCaml unikernels in research like https://www.usenix.org/system/files/conference/nsdi15/nsdi15-paper-madhavapeddy.pdf
Its mentioned in the article that the cold start time is roughly the same as Go or Rust, a few milliseconds
How are Go and Rust similar in this? https://maxday.github.io/lambda-perf/
Right? I see rust is 4 times faster starting up
A very quick test for a no-op program:
$ echo '' > iefbr14.ml
$ ocamlopt ./iefbr14.ml -o iefbr14
$ time ./iefbr14
________________________________________________________
Executed in 2.99 millis fish external
usr time 0.00 millis 0.00 micros 0.00 millis
sys time 3.08 millis 815.00 micros 2.27 millis
The performance comparison of AWS lambda startup times is interesting, I'm surprised that Swift is slower or comparable to Python there.
I've been experimenting with using zig to enable the easy creation of OCaml cross-compilation environments
Is there any progress on this? Being able to generate macOS/Windows binaries on Linux would be a huge help.