Comment

Comment by BinaryIdiot

So interesting project! I'm skeptical on the practicality of it but it's still interesting.

>> 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.

parent BinaryIdiot 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton