Top all-time · #3092
Embedded in Rust
Personal blog · blog.japaric.ioprogramminghardwaresystems
Embedded in Rust is a personal blog at blog.japaric.io about programming, hardware and systems. Since 2017, 23 different Hacker News readers have linked it 26 times, most often “Embedded in Rust: Brave new I/O”. The last post was in 2019, but the archive is still widely read.
Too few sampled comments (15) to say how often HN recommends it.?
Why HN links it
Jorge Aparicio's embedded Rust blog covers the RTFM concurrency framework, safe DMA, type-based peripheral abstractions and bare-metal setup. HN readers link it as a key embedded Rust resource.
Summarised by Claude from a sample of 15 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
A blog about Rust and embedded stuff
Most-linked posts?
- Embedded in Rust: Brave new I/O6 people · 6 mentions · first linked 2018-01-18
- RTFM v2: real-time for the masses on a Cortex-M with Rust4 people · 4 mentions · first linked 2017-08-01
- Fearless concurrency in your microcontroller4 people · 4 mentions · first linked 2017-05-09
- Rust your ARM microcontroller3 people · 3 mentions · first linked 2017-04-29
- /2 people · 2 mentions · first linked 2017-10-03
What Hacker News says?
I believe rust's safety guarantees are enough to ensure the soundness of passing data to/from interrupt contexts and interrupt handler re-entrancy. See rtfm[0] for an example and a good explanation. I think DMA handling can be made safe by using the right abstractions, and then you'd just need to trust that any piece of code that accesses the memory uses the abstraction instead of accessing it directly. Checking int…
Comment linking /fearless-concurrency/
on “Discover the world of microcontrollers through Rust”Submitted Embedded in Rust: Brave new I/O as a story · 365 points
HN discussionI'm not experienced in this space, but you might be interested in the Real-Time For the Masses[1] project. The author of that is the lead of the embedded devices working group. 1: http://blog.japaric.io/rtfm-v2/
Comment linking /rtfm-v2/
on “Rust's 2018 roadmap”Submitted Rust your ARM microcontroller as a story · 249 points
HN discussionI'm so excited that we're feasibly within a year or two of being able to develop embedded devices in Rust[0] on RISC-V microcontrollers [1] running on open source RTOSes also written in Rust[2]. It's currently already possible but still requires quite a bit of hacking. Plus the RF stacks (Bluetooth in particular) aren't there yet. What a time to be a developer. PS RISC-V on my X220 wouldn't hurt either. [0] http://b…
Comment linking /quickstart/
on “Western Digital Plans to Ship More Than One Billion RISC-V Cores a Year”Submitted Fearless concurrency in your microcontroller as a story · 153 points
HN discussionHaving done a lot of embedded work in both C and assembler, I'm really excited by the prospect of a type-safe, memory safe language with zero-cost abstractions that can compile down to [more or less] the same machine code that C would produce. For those interested, check out Jorge Aparicio's (japaric) RTFM2 series: http://blog.japaric.io/rtfm-v2/ (in particular the sections titled "Preemption" and "Critical sections…
Comment linking /rtfm-v2/
on “Rust's 2019 Roadmap”Submitted Microamp: Asymmetric Multi-Processing on Microcontrollers as a story · 76 points
HN discussionHave a look at RTFM: http://blog.japaric.io/fearless-concurrency/ Theres nothing like it out there. This is zero abstraction, and it works.
Comment linking /fearless-concurrency/
on “GERT: Run Go on Bare Metal ARMv7”Submitted Implementing a static stack usage analysis tool as a story · 4 points
HN discussionFor rust on bare metal target, it is also worth looking at: http://blog.japaric.io/quickstart/ and other work by Jorge Aparicio - https://github.com/japaric .
Comment linking /quickstart/
on “Enabling Rust on Embedded Platforms – Linux, RTOS, Bare Metal”Submitted Rust your ARM microcontroller as a story · 4 points
HN discussionThe latest on this front: http://blog.japaric.io/rtfm-v2/
Comment linking /rtfm-v2/
on “Rust: Not So Great For Codec Implementing”Submitted Real Time For The Masses goes multi-core as a story · 3 points
HN discussionThere has been recent pushes to use Rust in embedded systems, but I agree it'll take a long time. Check out this blog [1]. [1] - http://blog.japaric.io/
Comment linking /
on “C++ and the Culture of Complexity (2013)”Submitted RTFM v0.3.0: safe `&'static mut T` and less locks as a story · 3 points
HN discussionThere are various alternatives, but generally the approach is to know what address you need in advance and create an object for it at compile time that can be accessed type-safely. e.g. https://zinc.rs/apidocs/ioreg/index.html or the longer but more detailed http://blog.japaric.io/brave-new-io/ , which covers various approaches. It even points out that you can use the type system to enforce that peripherals are only…
Comment linking /brave-new-io/
on “NULL: The worst mistake of computer science? (2015)”Submitted Brave new I/O – Embedded in Rust as a story · 3 points
HN discussion> And for real low level to the metal systems programming, everything is unsafe; so you may as well be writing in C. You might want to take a look at this series: http://blog.japaric.io/fearless-concurrency/ .
Comment linking /fearless-concurrency/
on “Why you should, actually, rewrite some of it in Rust”Submitted Brave new I/O as a story · 3 points
HN discussionSo, some quick things: every Rust compiler is a cross-compiler, so that's not the tough part. You need to compile 'libcore' for the target, but https://github.com/japaric/xargo makes that pretty straightforward if your chip isn't one of the ones provided by the Rust project, if it is, then you just need to run a command to download it and you're good to go. https://forge.rust-lang.org/platform-support.html is said t…
Comment linking /
on “The Curious Case of the Longevity of C”Submitted RTFM v2: real-time for the masses on a Cortex-M with Rust as a story · 2 points
HN discussionIt is not just the borrow checker. The ownership system / move semantics and powerful static type system with traits and generics helps to create some interesting abstractions (which have very little run time overhead) - pleas check: http://blog.japaric.io/brave-new-io/ as well as other articles on that blog.
Comment linking /brave-new-io/
on “Should you Rust in embedded yet?”It takes work, but you can write safe DMA code in Rust. A good post by Jorge Aparicio explaining how is at his blog[1]. [1] https://blog.japaric.io/safe-dma/#:~:text=DMA%20stands%20for...
Comment linking /safe-dma/
on “Bjarne Stroustrup Weighs in on Distributed Systems, Type Safety and Rust”Write from scratch, maybe. Rewrite, I don't think it will happen anytime soon. In fact, the more time it passes, the more code needs to be rewritten. Regarding firmware, if the talk was about bare-metal embedded development, then I think Rust is the solution to a problem that no one has. Since the food on my table comes from firmware development, I passed several days trying to understand the reasons to move to the…
Comment linking /brave-new-io/
on “Is It Time to Rewrite the Operating System in Rust? [video]”You can't generally change the direction the stack moves, at least on targets like Cortex-M. Maybe in ASM it'd be feasible to work around, but getting LLVM to do this isn't anything I've ever seen. The "walk off the edge" technique is what is described here [0], in embedded rust we have a tool that does this automatically (from the author of the post) called `flip-link` [1]. It requires a second linker/re-linking pa…
Comment linking /stack-overflow-protection/
on “Measuring Stack Usage the Hard Way (2023)”