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

>In both cases it's the same set of CPU instructions

It's actually a very different set of CPU instructions. the function EatADonut is the same set, but "async" means the kernel needs to take time out of its execution to do some action as small as accessing an open thread, or as large as "gain access into a completely different piece of hardware" before putting that set of instructions onto that different thread. Not the program, the actual scheduling process between your program and the OS you are executing on. Then it needs a way to to get that result and sync it back onto whatever thread spawned it and access the result.

It is in fact a huge action, so marking it with Async is basically a very explicit warning.

>Which is cognitively expensive for no added benefit.

On the contrary, I can't even begin to imagine the amount of compiler optimizations it saves on as well to have that be explicit in code. I'm sure Go has to do all that on the fly while a colored language gets to allocate all those potential processes before the program runs. It's only no added benefit if you dont care about performance. But to be frank, you probably don't need more than a single thread if your problem isn't bounded by perormance. Parallel programming is all about getting something done faster after all.



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

Search: