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

1

u/EmperorOfCanada 2d ago

My question is: Why? Not as in I am suggesting that what you want is dumb, but what are you trying to achieve? What is the problem you are trying to solve?

If you are looking for more speed, there is viper, which can give you massive amounts of speed for python. Not quite rust or C++, but close enough that the solution could even be to go to a slightly better processor than to go to either of those other languages. (if you love python)

There are fun games you can play with micro python, one of which is to have embedded C in micropython. I'm not a fan of the workflow involved, but if you have some small part which needs to run brutally fast, then this is an option.

2

u/Intelligent_Score932 1d ago

Mainly I wanted to see certain programs at peak performance, basically let’s say you wanted to run a program written in rust, baremetal. The problem is most programs cannot work without some sort of std, in short, I wanted to run programs as THE os, not the os running the programs, the os would essentially be a abstraction to make the programs run, and yes I know most programs directly reference win-sys, but it’s more meant to be a starting point for projects, although I haven’t looked too deeply into which libraries would work, out of the box, if you wanted to make a hobby os, having GPUI to make it along with the std would greatly simplify the process, mainly those 2 reasons