Hacker News new | ask | show | jobs
by steveklabnik 938 days ago
> It is not designed for,

Making sure Rust can work in embedded environments is absolutely a design goal, and choices around this are made explicitly.

1 comments

>choices around this are made explicitly.

e.g?

A few off the top of my head: the core/std split, making the core language never allocate implicitly, the design of async/await.
> the design of async/await.

I am curious

How is "the design of async/await." for embedded programming?

The design of async/await took "using it in embedded" as a constraint. This is why it doesn't allocate, for example. Even C++ coroutines have one allocation, though they say that it can often be optimized away.

This means RTOS-like projects can use it for tasks, and it works well. Embassy is an example of such a project.

(Yet, I should also point out that you don't have to: at work we keep ours synchronous, for Reasons. Rust lets you do what you want.)

Async/await does not require dynamic memory allocation.