Dion Dokter

Dion Dokter

@diondokter.nl

Embedded tech lead at Tweede golf. I love programming in Rust. Netherlands

717 followers108 following1.1K posts

Pinned

Device-driver release time! Version 2.2.0 introduces the LSP support I've been teasing for a while. This is coupled with a vscode extension. But the LSP should work anywhere you can hook it up to. Lots of internal changes too, probably the biggest MIR change since 1.0.

Dion Dokter reposted

Finding out how many panics your Rust code contains isn't trivial. When existing methods weren't a good fit for our client, Wouter created Call Graph Analyzer, the first tool to make this practical. Read how it works: tweedegolf.nl/en/blog/242/... @wassasin.bsky.social #rustlang #embeddedrust

buff.lyFinding panics with Call Graph Analyzer — Tweede golfFor and with Microsoft under the Open Device Partnership, we have developed and released the Call Graph Analyzer (CGA), a tool to extract the callgraph from monomorphized MIR. This callgraph can be…

Dion Dokter reposted

If you like the idea of it, try it out and share your findings! If you *don't* like the idea, also try it out! Find the situations you think where this flag is a bad idea and share your findings.

Dion Dokter reposted

Hey friends, I’m looking for my next gig - ideally something deep in a perf-sensitive stack, somewhere in Rust land. Would appreciate a boost!

Device-driver release time! Version 2.2.0 introduces the LSP support I've been teasing for a while. This is coupled with a vscode extension. But the LSP should work anywhere you can hook it up to. Lots of internal changes too, probably the biggest MIR change since 1.0.

I really need a crater-like tool for device-driver to make sure new releases don't break anyone. Went through some existing drivers manually and found 2 bugs! That said, I feel like the codebase has grown bigger than the current test infra can handle, so I need to improve that too

In the device-driver lsp, when you hover over a register you'll get to see everything you need to know. Names, properties and descriptions. But also a rendered table that contains all the fields and what their reset values are!

This is the last feature I had planned for the initial LSP release. Only thing left is tidying up things and then it's release time!

Someone should invent a (fast) computer that doesn't care about memory alignment. The streets would fill with cheering crowds and the dancing would continue to dusk.

Dion Dokter reposted

For his internship, Camiel dove into using TrustZone-M with Rust. In this blog, he describes how TrustZone-M currently helps you secure your embedded device and shares a minimal working example for the Raspberry Pi Pico 2: buff.ly/mrqtUs2 #rustlang #embeddedrust #security

buff.lyUsing TrustZone-M in Rust on the Raspberry Pi Pico 2 — Tweede golfSecurity on embedded devices can be tricky, but TrustZone-M can help. We'll explain how it works, what works well, and less well when using TrustZone-M in Rust. We'll also share a quick-start repo…

Dion Dokter reposted

Please, install and test the latest probe-rs. @dbuga.bsky.social merged all of my proposed fixes/improvements. If you have cortex-m devices, make sure to check that there are no known regressions. I checked with STM32G071RB, MCXA266, MSPM0G3519, and STM32F405.

I've got 2 bugs and 2 enhancements for sequential-storage that require a "disk-breaking" change. So at some point I'll come with a properly breaking release. I don't think I want to maintain two disk formats. So if you have an idea for a (disk) breaking change, please open an issue!

View full thread

Half a page state is at worst just one byte. 2 bits minimum are used for the state, so there's 6 bits left. Double up every bit and you have 3 bits or 8 versions. So maybe just a parity bit? Then there's 5 bits for 32 versions. At this rate s-s could then support 80 years of development

Btw, I won't be maintaining two disk versions *for free*. The equation changes if the extra work is paid for. So ehh, hit me up if that sounds attractive. There could even be slow transition where old pages are read using the old format and new pages are written in the new format

I've got 2 bugs and 2 enhancements for sequential-storage that require a "disk-breaking" change. So at some point I'll come with a properly breaking release. I don't think I want to maintain two disk formats. So if you have an idea for a (disk) breaking change, please open an issue!

I could add a little disk format version field in the page state I think. That could be nice to have. Not sure. At least there could be a (runtime) error for version mismatch. But that has to be bitflip resistant too, just like the rest of the code.

3 days later, yep definitely a bad situation 🤒

Dion Dokter@diondokter.nl

I've got the beginnings of a sore throat but I've also got "goto definition" working in the LSP, so it's unclear whether this is a good situation or not

I've got the beginnings of a sore throat but I've also got "goto definition" working in the LSP, so it's unclear whether this is a good situation or not

Dion Dokter reposted

Rust 1.99.0 has been released, and this time both Folkert and Björn have 100+ contributions to their name, and Folkert co-hosted the Changelog video! Watch the video here: buff.ly/vjDOnDE Read the blog here: buff.ly/PmnSmbd @trifectatech.bsky.social #rustlang

buff.lyRust Release Changelog - 1.99.0Hi, hello. Welcome to another video in the Rust Release Changelog Series In this episode, we are Folkert de Vries (https://github.com/folkertdev) Cameron Dershem…

So it seems like some people like to have control over the impl'd traits regardless of breakage. Interesting. Maybe my compiler should have a way to opt in or out trait impls somehow as a flag. But I'm not sure I like that because you'd have to provide that flag at every compilation. Annoying

Dion Dokter@diondokter.nl

Question: You're using a macro that generates a new type. You decide to impl a trait on that generated type. Later you update the macro crate and now it too impls that trait which causes your compilation to fail. The macro crate update was released as a minor semver bump. Would you be angry?

Opt-out has the disadvantage that people aren't going to opt-out on their own for nothing. So adding new traits will still break people in practice. The advantage is that a default user just gets everything which is likely what you want.

Opt-in is the opposite where reasonable users must always provide a list. The advantage is that they will do so because they must. So... I don't like either of these options.

Question: You're using a macro that generates a new type. You decide to impl a trait on that generated type. Later you update the macro crate and now it too impls that trait which causes your compilation to fail. The macro crate update was released as a minor semver bump. Would you be angry?

Got renames working in the LSP! Had to do a lot of internal refactoring to make this work well without hacky-ness. The internal MIR is now a couple of flat vecs instead of a tree. That makes the core compiler ~5-10% faster too as a bonus.

Ah, annoying difference between HashSet and HashMap in #rustlang: With map, an insert updates the old value. With set, an insert keeps the old value. Good to look out for if you're changing between them!

My Rust compiler dev achievements: - [x] Amanieu reviews your PR - [ ] Amanieu likes your PR More work to do :P

Who knew caching would make an LSP faster!? The change here is that the translations from byte spans to line/columns is now somewhat cached (line index to byte offset)