2 ms·
Looking forward to giving this a tryout. We have a server-side Node.js project where performance is terrible, and memory leaks happen that are almost impossible
by lobster_johnson 9y ago
Looking forward to giving this a tryout. We have a server-side Node.js project where performance is terrible, and memory leaks happen that are almost impossible to track down; I need to rewrite it, and I was thinking Go, but this project also has a bunch of code that is also used by JS clients; so something JS-compatible would be better.
What's BS's story when it comes to interfacing with async code? In particular, all my Node.js code these days is promise-based (I promisify all callback-type functions, except for event-based ones that I try to wrap) using async/await. Do you still have to use promise calls in BS? Or are compatibility operators offered for chaining async calls more elegantly?
What about async in general? OCaml has LWT -- can you use that with BS and still run on Node.js or in the browser?
- yawaramin 9y agoRight now we are using bindings to JS promises: https://www.npmjs.com/package/bs-promise https://www.npmjs.com/package/bs-promise We also have Lwt compiled with BuckleScript: https://github.com/mzp/bs-lwt https://github.com/mzp/bs-lwt But, bs-lwt right now is not compatible with promises--it is a straight port of the OCaml implementation. I'm told that someone is working on an Lwt backed by JS promises for BuckleScript.