days
-4
-3
hours
-1
-8
minutes
-2
-8
seconds
-3
-5
search
Smaller binaries, less memory usage, and it fits into constrained devices!

Meet Osaka, a Rust async for explicit, well-defined code that doesn’t take up too much space

Jane Elizabeth
Osaka
© Shutterstock / Ghing

Having trouble fitting Tokio into constrained devices? For developers who want to use aysnc applications in Rust, Osaka is here to make embedded apps simpler than ever. Save space and time with this explicit, well-defined approach to Rust!

Rust is a great programming language if you’re looking for something without a lot of runtime dependencies and a well-developed ecosystem. However, for developers looking to write embedded async applications on constrained devices, the preexisting Tokio sometimes isn’t the best choice. That’s where Osaka comes into play.

Osaka is designed for continuations, not combinators. It gives developers a more readable flow while maintaining a smaller footprint. Inspired by Go and the Clay programming languages, Osaka is an attempt to make async more simplistic.

Asynchronous coding makes it possible for applications to wait for resources. While some developers might use threads, they do take a fair amount of space with their executable stack.

Embedded devices are generally small and they spend an awful lot of time hanging around and waiting for network packets. Async is the ideal solution, since they are much more lightweight than threads and they can wait until the CPU resources appear.

To be fair Rust already has an async option: Tokio. While Tokio does provided a solid platform for fast and reliable network apps, there is room for improvement for embedded devices.

Things are easy to understand in Osaka. All behavior is well defined and there are no implicit dependencies. Everything is explicit, from the code, the behavior, and even the errors! Basically, Osaka was designed to make things more unambiguous to the developer. Sometimes the simpler approach is the easiest!

Designed for the “if it compiles, ship it” workflow, Osaka has a few main differences from async/await. There’s no task queue, no hidden singleton task registry, and considerably less magic.

Probably the most impressive thing about Osaka (aside from the castle) is that it can drastically reduce the binary size and memory usage. Get rid of racing bugs and dangling resources, simplify your code, and fit your async apps on embedded devices.

SEE ALSO: Speedy Rust framework for web apps burns through the sky

Getting Osaka

Osaka is available on GitHub. In theory, it can be ported to bare metal. More information about this Rust async for embedded devices is available here.

Author
Jane Elizabeth
Jane Elizabeth is an assistant editor for JAXenter.com.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of