You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
allow functions to be marked as async, which makes the compiler convert the function to a struct which contains all the locals and temporaries, and a step function which takes the current state and returns either a new state or the return value.
this allows for many cool things:
yield(): lazy and/or infinite collections
lightweight threads: by scheduling for example 32 function calls on a pool of 4 threads
async I/O obviously
pause a function while some other important event is happening (can also be achieved by other ways)
problems
how to properly integrate that with the existing type system?
The text was updated successfully, but these errors were encountered:
The type system already works with this design in mind, however the backend doesn't really handle this abstraction cleanly. It still expects mostly traditional functions. However, the Fragment model is a strong backbone to build on, it just currently is in an unfortunate state.
how this should work in theory
allow functions to be marked as
async
, which makes the compiler convert the function to a struct which contains all the locals and temporaries, and a step function which takes the current state and returns either a new state or the return value.this allows for many cool things:
yield()
: lazy and/or infinite collectionsproblems
how to properly integrate that with the existing type system?
The text was updated successfully, but these errors were encountered: