Hacker News new | ask | show | jobs
by MatthewPhillips 4765 days ago
Most disappointing part of most -> js languages is that they adopt the async nature of JavaScript, thus making them pretty dissimilar from their native environments. Is it that difficult to rewrite a sync workflow to an async one by the interpreter?
2 comments

You mean async to sync workflow, this is possible with generators https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_... it similar to what is done in gevent. BUT, such sync code for async is just style, the code is still async you just write it like it sync code. In this sens it can be understood as a feature of the language but generators are meant for more than that.
That's because an synchronous client-side scripting language would be useless for the web.