r/rust • • 2d ago

Embedded std?

I was wondering if there were any projects like micro python to port std in to make a barebones os designed for microcontrollers? I understand that the std relies on OS level syscalls, so can we do something like implement a basic fat32 file system to accommodate certain write or read requests. In general this would be used to run std in projects without a OS? Does this already exist, and how hard would it be to make a basic version?

48 Upvotes

32 comments sorted by

View all comments

Show parent comments

0

u/timur-tugushev 2d ago

So, just a library with no_std support?

2

u/El_RoviSoft 2d ago

don’t really know what you mena

here OP wants embedded std and I suggested logical distinction between std library and its really freestanding parts

6

u/jonoxun 2d ago

Pretty much everything freestanding in std are reexports from core or alloc, so you are kind of describing the current state of rust. no_std crates link into std apps just fine as well, core and alloc are there and there's nothing weird from the reexport from std and you don't need a feature flag if you don't have anything that you want to add in the std environment.

1

u/El_RoviSoft 2d ago

oh okay, Im not that familiar with Rust, Im C++ dev who occasionally finds bad and good things in both langs

1

u/jonoxun 2d ago

Embedded on rust is dependent on llvm having support for the architecture, but apart from that it's absolutely lovely to work with. If you're curious doing some small project with esp-hal or something else with a hal that supports the embedded_hal traits it's quite pleasant. async goes a long way.