Wrote an implementation of thread local storage in #no_std #rust, for Linux x86_64, with options to a) use libc's thread local storage, b) leverage libc's thread local storage that something in the same process has set up, or c) work without native thread local storage at all.
Toying with the idea of publishing it as a crate but, uh, I guess these requirements are pretty niche.
I built a Rust crate to parse MacBinary files and resource fork data. As something of a testbed I created a webpage that uses the crate compiled to WebAssembly to show the data contained within a file you select and allow you to download individual parts, all client-side.
Parsing is done without any heap allocations with makes it `no_std` (embedded) compatible too.
#retrocomputing #vintagemac #rust #no_std
Exploring programming patterns can get tedious, when you're rewriting the same example for the third time, each version having different shortcomings.
It's useful to check the ground truth once in a while and see how the piece connects to the bigger system, but that's still more potentially wasted effort.
In totally unrelated news, coding #rust with #no_std is hard mode :)
Because the crate I made yesterday (https://crates.io/crates/microasync) didn't have much to offer except for the sync function and yet got so much positive feedback, I thought I'd make another *very small* #rust crate to provide a more proper #async #runtime and IO.
This entire crate and its one dependency together are smaller than the futures-executor crate, while having more features. It's also got #no_std support (only for the runtime, not the IO)!
#rust #async #runtime #no_std #rustlang
@hergertme@mastodon.social ah, but the context pointer - and context data - is only ever on the stack unless you explicitly Box<> it. So it's definitely not going to do any sneaky implicit allocation/deallocation which would indeed be problematic.
Indeed, for kernel modules you'd be using #no_std, which implies you *can't* allocate IIUC.