Hacker News new | past | comments | ask | show | jobs | submit login

Very interesting. As an application dev I'm curious to know what it would take to have a, let's say, Actix-web stack bundled with a unikernel, or a MeiliSearch engine bundled with a unikernel.

Both of these now live in Docker containers along with a whole Alpine system. I'm correct to believe that unikernels could change this, right?




I learned that for MirageOS it was still a long road before it's be possible to use some OCaml webframework on top of it.


Lwt [1] based web frameworks can be used on MirageOS if they provide an interface that allows someone to swap out the unix dependent pieces. One such framework is Opium [2], that provides most of its features in a unix independent code library `opium_kernel`. Its fairly straightforward to run an opium app on mirage. This example needs to be updated to the newest apis in the released version of Opium but this can provide some hints about how to run an opium app on mirage: https://github.com/anuragsoni/ocaml-opium-unikernel.

If a lower level web toolkit is sufficient then ocaml's cohttp [3] library has been available on mirage for quite some time now.

[1] https://github.com/ocsigen/lwt/

[2] https://github.com/rgrinberg/opium

[3] https://github.com/mirage/ocaml-cohttp/


Thanks for chiming in!

Sadly cohttp is (or was) performing so bad that it is kind of at odds with using it on a unikernel.

This one is quite a bit faster:

https://github.com/inhabitedtype/httpaf


The `opium_kernel` example I linked to above is running on top of https://github.com/dinosaure/paf-le-chien which is a mirage layer for httpaf. Opium itself has also moved to using httpaf as the underlying layer.


Wow. That's great. Thanks for setting this straight.

Seems OCaml/Mirage is the pretty far ahead in typed web dev using a unikernel.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: