|
|
|
|
|
by DixieDev
1528 days ago
|
|
My original reply is kind of sloppy, here's a snippet to better illustrate my confusion: https://gitlab.com/-/snippets/2290425 Specifically, examine this: fn foo() void {
bar();
std.log.info("foo() is finished", .{});
}
It looks dead simple, but it's a pain in the butt to use because it's actually async, and you can know neither that nor how to get this function to actually finish without looking inside of bar(). |
|
Not in a trivial way either. A good async language will never let std.log.info print until/unless bar resumes.
The difference between a "blue foo" and a "red foo" is also subtler than we pretend it is. Both will finish eventually, unless they don't, and both may be paused for as long as the OS wants in any preƫmptive operating system.