3 ms·
My bro and my bestie worked on a Vert.x project. So I got to hear all about it. I can only comment thru comparison. Due to multiple poor life choices, I'm curr
by specialist 8y ago
My bro and my bestie worked on a Vert.x project. So I got to hear all about it.
I can only comment thru comparison. Due to multiple poor life choices, I'm currently stuck maintaining multiple large nodejs code bases.
I'm "maturing" our code base from callbacks to promises (futures) to async/await as able.
It's terrible.
Whatever the future of async I/O programming is, it's not events, promises, callback. I've been reading about and playing with actors, CSP, Erlang/Elixir/Phoenix. If I was doing greenfield, that's where I'd place my bets.
- BenoitP 8y agoThere is a great approach in Quasar [1] where you program simple blocking code, and the runtime (bytecode manipulation with a Java agent) unmounts and remounts thin contexts in the fat thread you are in. A light thread, if you will. No events/promises/callbacks. It does require unmounting-aware APIs, though; making you incur the usual fat thread mounting/unmounting cost if they are not available. The author of this project is currently implementing the base element of this approach (continuations) in the JVM [2]; probably along the required rewrite of the Java standard library. I'm very excited about this! You could start writing code in Quasar, IIRC they said it will use these continuations when they are made available. I would not be surprised if it is one of the first frameworks to make use of it. [1] http://docs.paralleluniverse.co/quasar/ http://docs.paralleluniverse.co/quasar/ [2] http://cr.openjdk.java.net/~rpressler/loom/Loom-Proposal.html http://cr.openjdk.java.net/~rpressler/loom/Loom-Proposal.htm...
- ofrzeta 8y agoLatest news on the website from 2016. Latest commit on Github from January; build broken. Wouldn't be my first choice for starting a new project, I guess.
- bpicolo 8y ago> unmounting-aware APIs Does that mean libraries need to be rewritten to support it? In my experience, important IO-driven libraries like database access/ORMs tend to be extremely poorly supported for non-language-native concurrency strategies, or even concurrency strategies added late in a language's lifecycle.
- BenoitP 8y ago> Does that mean libraries need to be rewritten to support it? Yup. Here are the list of supported libraries [1]. > even concurrency strategies added late in a language's lifecycle Quasar code uses a regular Java Exception as a trick to stop execution and unmount, to sort of piggyback on the language features. Fibers do also implement the Thread interface; I think what you pointed at was indeed a concern of the author. I don't know how the Loom initiative look like. If you want to see how a library is adapted, here is JDBC [2]. [1] http://docs.paralleluniverse.co/comsat/#getting-started http://docs.paralleluniverse.co/comsat/#getting-started [2] https://github.com/puniverse/comsat/tree/master/comsat-jdbc/src/main/java/co/paralleluniverse/fibers/jdbc https://github.com/puniverse/comsat/tree/master/comsat-jdbc/...