Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> the rest of your program doesn't have to be an explicit state machine; it can use structured control flow with nested loops and conditionals and subroutines

This works well until the requirements change and you have to run two structured control flows simultaneously. If I find myself in such a situation and have no SRAM for a second thread, rust async may be the quickest way to accomplish the goal without a major rewrite into manual event driven code.



i don't have experience with rust async, although i used to maintain a csp protocol stack in python async, which is pretty similar, so tell me if this is wrong

i feel like the same kind of thing can happen even if you start entirely async, because something that was previously synchronous may have to become asynchronous, which leads to having to revalidate all your concurrency assumptions all the way up its (static) call stack. wherever you were depending on not getting preempted, you need to change the code to not depend on that anymore. but if ram is so tight that you're concerned about the sram for a second stack, maybe that's a pretty small task rather than a major rewrite

that said, i don't recall having actually had that problem




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: