Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m not going to read this 229-page doctoral dissertation book for two reasons.

First, it is too long to be practical. Please don’t push the doctoral things on me, we all know that 99.(9)% of what we do in js is not a rocket science. If you want me to feel stupid before someone more educated, fine, I’m okay with that. But even if that’s true, people love to experiment and find their best ways to do something. Also it’s not me who implemented coroutines in Lua this way, it’s PUC Rio guys who made it looking at Scheme. I trust them better than a committee that required 30(?) years to make something bearable without transpilation from the future and hundreds of polyfills.

Second, I’ve asked this question before, and it was browser guys who said that they are not willing to do that, because the legacy is real. And webassembly will not support that neither, because it works in a browser and should obey its rules. Whatever that dissertation concluded, it is committee+browser decision to strip all possible source languages from having such coroutines when targeted at webassembly. It is simply not fair, freedom restricting and has nothing to do with someones educated opinion.



JS is designed in part based on lessons learned from the mistakes of past languages.

Scheme doesn't have coroutines as such; it has first-class continuations.

You can definitely implement cooperative threading in a compiler whose target language doesn't have any kind of threads. You know the 386, SPARC, and PDP-11 don't have threading? It's all simulated. (Wasm probably will have first-class shared-memory threads though. It's being trialed in Chrome already.)


>You can definitely implement cooperative threading in a compiler whose target language doesn't have any kind of threads

I can’t find that thread in my comment history, but there was a wasm guy who basically said nope, not gonna have it, loud and clear, exactly in the context you noted. If that was not true, and all browser vendors will allow it, good.


You can just compile to explicit CPS or equivalent.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: