3 ms·
I'll bite. I like Elixir, but that's not why I think JS's concurrency story is a fricking joke. JS allows you to say, in essence: "This code is allowed to run
by gamache 10y ago
I'll bite. I like Elixir, but that's not why I think JS's concurrency story is a fricking joke.
JS allows you to say, in essence: "This code is allowed to run somewhere else." That's your hammer, and you'd better squint at your problem until it starts to look like a nail. This feature can be dressed up to look like callbacks, like promises, like streams, like async/await -- but if the low-level interface isn't what you wanted, you will not get what you want.
I mean, it's better than Python or Ruby, where you don't even get to point out bits of code that can run on the side. But it's still kind of crappy.
Experience in other languages with more control over the concurrency model often leaves JS not looking so good in comparison.
That leaves aside many other factors that make writing safe, concurrent code in JS harder than it has to be: for example, immutability of data, crash supervision, server clustering, shared-nothing architecture. JS doesn't have good stories here either.