News for hackers. Stuff that matters.
Re:Exotic Programming Ideas, Part 3: Effect Systems by ledauphin on Monday November 23, 2020 @08:18PM (#25194119)
I think this (allowing some form of default for backwards compatibility) is a underrated point.

The common modern example being async functions, I would say it's actually quite surprising that JavaScript can't seem to provide the sane default behavior of "block this non-async function until the async function it calls returns a value".

The reason it can't is simply that it chooses not to provide a runtime with a true threading model - blocking a non-async function means literally blocking the entire runtime. But there's a possible world in which a "colored" (async) function could be used directly in a synchronous function using an escape hatch provided by the runtime, and then async functions would no longer be colored in the same way.

There are no comments on this comment yet.