4 ms·
Is there any other languages that let you use async on embedded/bare metal? I think Rust could learn from them. Especially on the ergonomics side. Otherwise, wh
by sbt567 3y ago
Is there any other languages that let you use async on embedded/bare metal? I think Rust could learn from them. Especially on the ergonomics side. Otherwise, what Rust might currently do is blazing a trail through a forest.
- FpUser 3y ago>"Is there any other languages that let you use async on embedded/bare metal?" So you do not know if there are and what kind and other important details. >"I think Rust could learn from them." Yet you think
- marcosdumay 3y agoThere is no other language that does what Rust is trying to do. But that is not "using async on embedded/bare metal", this one is easy, jut use a garbage collector.
- brabel 3y agoHm, I think Pony did try doing what Rust is doing, with an even more advanced system for "borrows" (there's several types of borrow, not just two): https://www.ponylang.io/ https://www.ponylang.io/ Also, Vale is on the way: https://vale.dev/ https://vale.dev/ And D is also working on it: https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in...
- kaba0 3y agoWhat should it learn? If you combine async with Rust’s nested lifetimes, you get quite a bit of complexity from the borrowchecker, period. There is not much else to it.
- jamesmunns 3y agoFrom a net-effect standpoint, Rust's implementation of async/await is fairly similar to protothreads, which were used even on smaller AVR and MSP430 targets where rtos threads weren't practical. That being said, protothreads were implemented using wildly cursed C macros, and offered none of the safety guardrails that Rust has, nor the ergonomics, and had some insane constraints, like "you can't use local variables at all, only statics" because like rust, they were stackless coroutines that meant you would have no control of the stack across await points. If you were VERY CAREFUL, you could get the same lightweight concurrency with almost the same fundamental model. Woe be on you if you ever had to debug though. edit - here's a look at how protothreads were expanded: https://dunkels.com/adam/pt/expansion.html https://dunkels.com/adam/pt/expansion.html
- SeenNotHeard 3y agoVala offers async/yield and compiles down to native code (after being transpiled to C): https://wiki.gnome.org/Projects/Vala/Tutorial#Asynchronous_Methods https://wiki.gnome.org/Projects/Vala/Tutorial#Asynchronous_M... More info: https://vala.dev/ https://vala.dev/