Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
1–10 of 63 posts
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#2Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#3What's wrong with async/await?
Other languages come either with great concurrency support out of the box (Go, Erlang) or enough constructs to implement cooperative schedulers without having to specify async/await (Lua).
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#4What's wrong with async/await?
It's a kludge. Syntactic sugar to remove one level of nesting. Other languages come either with great concurrency support out of the box (Go, Erlang) or enough constructs to implement cooperative schedulers without having to specify async/await (Lua).
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#5What's wrong with async/await?
It's a kludge. Syntactic sugar to remove one level of nesting. Other languages come either with great concurrency support out of the box (Go, Erlang) or enough constructs to implement cooperative schedulers without having to specify async/await (Lua).
[Edit] JS has long been criticized (fairly or not) for offering clunky "concurrency" strategies. If you must down vote, please have the decency to offer a counter perspective.
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#6What's wrong with async/await?
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#7>> global.nsynjs = global.nsynjs || require('nsynjs');
Don't do this. The module pattern is pretty well known and you can use it to return a singleton. Global has some built in node.js stuff but I wouldn't mess with it.
>> Example of wrapper to setTimeout, that will be gracefully stopped in case if pseudo-thread is stopped:
This seems overly complex and unintuitive. Also, there are lots of references to `synjs` but the project's name is `nsynjs` which seemed confusing to me.
Honestly, like I mentioned at first, cool project but callback hell is very easy to avoid even without Promises or async / await as long as you follow solid development patterns.
I would be interested if you have benchmarks / comparisons against callbacks, promises and async / await.
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#8What's wrong with async/await?
2 main reasons: 1. If some nested function is async/await, all the callers (and whole graph) need to be converted to async/await. I feel that language shouldn't force programmer to do this type of tedious work. 2. It's not compatible with some browsers, only via Babel
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#9What's wrong with async/await?
It's a kludge. Syntactic sugar to remove one level of nesting. Other languages come either with great concurrency support out of the box (Go, Erlang) or enough constructs to implement cooperative schedulers without having to specify async/await (Lua).
If you have transparent async, then:
Then how do you know what blocks and what doesn't ? What's asynchronous and what's going to trigger a switch ? What's a disguised callback and what's the next line ?
What's the solution then ?
Re: Show HN: Nsynjs – JS engine with stoppable threads and without callback hell
#10What's wrong with async/await?
Overall it just ends up being a bit inconsistent for my tastes. But I like that we're trying more things to evolve the language to avoid common pitfalls like callback hell