Open mertyildiran opened 3 years ago
Interesting - basically you're turning the "traditional async" approach on its head into a futures semantics. Shall be quite performant and actually avoid many (most?) of the pitfalls of the "traditional" async (most notably your approach seems to solve the stdlib of double size and mutually incompatible "function colors" split).
Though admittedly I'm curious how you want to implement this under the hood. The only implementation semantically resembling yours is the one in Dao which though uses plain os-level threads. But you seem to indicate that you want to have it single-threaded which would mean either you need to distinguish between return
and yield
(which I can't find anywhere in your description) or simply insert yield
points automatically in compile time (which I also can't find anywhere in your description :wink:). Or I'm missing some other option... IDK
Dare to elaborate :wink:?
@dumblob it's just a syntax proposal at this point. I've no idea how are we going to implement it. Also the current state of master
far from making parallelism possible. Right now, I'm focused on making the language JIT compiled. So this RFC is kind of on hold.
Implement parallelism using
async
keyword on function calls:The output should look like:
The
async
should also be assignable so that using thewait
keyword the execution can wait until the function called byasync
finishes:wait
keyword should be able to accept anum list
:such that the output will look like: