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

Except function colouring is a symptom of two languages masquerading as one. You have to choose async or sync. Mixing them is dangerous. It’s not possible to call an async function from sync. Calling sync functions from async code runs the risk of holding the run lock for extended periods of time and losing the benefit of async in the first place.

I don’t have anything against async, I see the value of event-oriented “concurrency”, but the complaint that async is a poison pill is valid, because the use of async fundamentally changes the execution model to co-operative multitasking, with possible runtime issues.

If a language chooses async, I wish they’d just bite the bullet and make it obvious that it’s a different language / execution model than the sync version.



I think this analogy is too extreme. That said, modern languages should probably consider the main function/threading context default to async.

Calling sync code from async is fine in and of itself, but once you're in a problem space where you care about async, you probably also care about task starvation. So naively, you might try to throw yeilds around the code base.

And your conclusion is you want the language to be explicit when you're async....so function coloring, then?




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

Search: