4 ms·
For many languages I absolutely agree: stackful coroutines are the way to go since the programmer experience is much smoother, with fewer hiccups like having di
by shellac 3y ago
For many languages I absolutely agree: stackful coroutines are the way to go since the programmer experience is much smoother, with fewer hiccups like having different kinds of functions, or being unable to yield in loops. Lua, Go, and now Java got this right; python, javascript, and c# have to live with a bit of a mess.
But Rust is not a language which can dictate its execution environment. It needs to be able to exist in a C-ish world, and that's not something that supports yielding. It's a shame, but at least you can write kernel modules in Rust.
- thesuperbigfrog 3y ago>> But Rust is not a language which can dictate its execution environment. It needs to be able to exist in a C-ish world, and that's not something that supports yielding. It's a shame, but at least you can write kernel modules in Rust. Ada is also used in embedded and low-level environments where the execution environment can be limited. The way that Ada "gets around" such limitations is through language "annexes". Annexes are optional language extensions for specialized use cases: https://www.cambridge.org/core/books/abs/programming-in-ada-2012/specialized-annexes/A052B2FE3D0E1B1CF3B0FD2C4F106349 https://www.cambridge.org/core/books/abs/programming-in-ada-... http://www.ada-auth.org/standards/22rm/html/RM-1-1-2.html http://www.ada-auth.org/standards/22rm/html/RM-1-1-2.html Rust partially does this already with [no_std] (https://docs.rust-embedded.org/book/intro/no-std.html https://docs.rust-embedded.org/book/intro/no-std.html), so the concept is not too different.