-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support NodeJS as a platform #270
Comments
Interested to see what you have made. Also, it would be nice to run CI tests even of only the existing platform-independent parts of Lwt on Node (see #249). Would be interested to hear about your setup or environment. |
I want this. Any word? Ideally, we would make room for several bindings besides Unix, though practically we would implement the ones that people are most interested in first. Ideally, we could make sure Lwt interacts really well with JS, has a nice mapping to promises. We would compile Lwt with Bucklescript and publish Lwt in |
It's very valuable because many people have existing deployments of node and they can't just drop everything and create an entirely new server environment from scratch. For example, corporate IT departments might have spent a long time vetting infrastructure like node, and therefore that's the easiest way to wedge OCaml into the system. |
I've taken a quick look at NodeJS' API and many things in Lwt_unix would be implementable straightforwardly atop it (minus the type equalities, etc., with @michipili are your NodeJS reimplementations of Lwt_unix (and others) functionality available somewhere for reference? |
On a similar note, we have a bunch of code in https://github.com/docker/vpnkit/blob/master/src/hostnet/sig.ml that abstracts over Lwt_unix vs libuv. It might be useful to build a 'core' set of Unix signatures that could be implemented by multiple libraries for js_of_ocaml, libuv, etc. (cc @djs55) |
@michipili how's your Lwt-on-nodejs project going after couple years? We do something similar with some abstraction over httpaf for native http stack and node http stack, so that services could be run on top of native OCaml or node platforms. |
That's pretty interesting! On my side, I've not been doing much in the topic these days and do not plan to. I guess I still could have my code somewhere but it would probably not be running without upgrading to modern LWT interface at least! |
I am maintaining a codebase running lwt on top of NodeJS, thanks to the excellent js_of_ocaml. Of course the Unix parts of lwt are unavailable but I have written replacements for some of the missing functionalities. I am also happy to say that the resulting programs have been put in production for several month now and display a very satisfying stability and ability to handle large amount of data.
I would be very interesting to make NodeJS being supported next to Unix as a platform, as to ease writing platform-independant code. Is there anybody doing the same, or even just vaguely interest by this?
The text was updated successfully, but these errors were encountered: