5 ms·
Callback hell is gone with promises, and async/await is shipping in ES7. what's wrong with es6 syntax and dependencies? I haven't used elixir, but I see a lo
by chmln 10y ago
Callback hell is gone with promises, and async/await is shipping in ES7.
what's wrong with es6 syntax
and dependencies?
I haven't used elixir, but I see a lot of discontent with JS. Almost like its trendy to hate JS and constantly complain about JS fatigue.
There are some issues indeed, but I find they're generally exaggerated.
- ch4s3 10y ago>and dependencies? My gripe with node dependency management has been the lack of a .lock file, until yarn was released. Also, the ecosystem has kind of a mess of transitive dependencies, which are sometimes in practice not resolvable to a working set of modules for a given dependency list. >Callback hell is gone with promises, and async/await is shipping in ES7. Sure, this particular problem is "solved" but due to the single threaded nature of js, even if you may async code look friendlier, its still the only tool you have for parallelizable tasks. And some of those tasks are a poor fit for async event loops. Tools like Elixir give your more concurrency tools, so that you don't have to shoehorn everything into async functions.
- Arnavion 10y ago>async/await is shipping in ES7. ES2017 / ES8.
- gamache 10y agoI'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.