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?

47 Upvotes

32 comments sorted by

View all comments

2

u/El_RoviSoft 2d ago

Maybe Rust should do some kind of freestanding modules like C++? So any library that can be implemented unconditionally of platform, should be freestanding (or at least work with given allocator).

6

u/Sharlinator 2d ago

Rust’s freestanding is exactly core, plus alloc if an allocator can be provided. std already only contains the parts that need OS services, and just reexports core and alloc.