3 ms·
What server implementation is the author referring to?
by OtterCoder 9y ago
What server implementation is the author referring to?
- jasim 9y agoBuckleScript is an OCaml to JS compiler. So you can convert your code into JS and run it from Node. Or, you can simply compile it into native OCaml binary and run it just like you run a C or GoLang binary. The choice would depend on whether you use libraries from the npm ecosystem, or from the OCaml ecosystem.
- OtterCoder 9y agoThank you. Is there a particular native OCaml server implementation that is considered best, or at least most popular?
- jasim 9y agoThere is Ocsigen (https://en.wikipedia.org/wiki/Ocsigen https://en.wikipedia.org/wiki/Ocsigen) which lets you write OCaml on the front-end and back-end, and is a fully-featured self-contained server. There is also Opium (https://github.com/rgrinberg/opium https://github.com/rgrinberg/opium) which is a Sinatra-like light-weight web server. Neither has the kind of vast community support like Rails or Django enjoys, and I haven't used them in anger either.
- yawaramin 9y agoYes, Cohttp is from the folks who developed the Mirage unikernel: https://github.com/mirage/ocaml-cohttp https://github.com/mirage/ocaml-cohttp . They make lightweight stuff that runs blazing fast.
- testcross 9y agoBut cohttp is slow. See https://github.com/mirage/ocaml-cohttp/issues/328 https://github.com/mirage/ocaml-cohttp/issues/328 and https://github.com/inhabitedtype/httpaf https://github.com/inhabitedtype/httpaf