Sign in

Dion Dokter

@diondokter.nl
702 followers 107 following 1.1K posts

Embedded tech lead at Tweede golf. I love programming in Rust. Also at: @diondokter@fosstodon.org Check out device-driver.com Netherlands

PostsRepliesMedia
Dion Dokter @diondokter.nl · 03/10/2026
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.
072
Dion Dokter @diondokter.nl · 30/09/2026
Apparently Firefox decided it would look better with that awful vibecodey LLM style. Gradients and neons, all the stuff I would have loved as an 8 year old. You can install this neutral theme to have it colored relatively normal again: addons.mozilla.org/en-US/firefo...
New updateWith the proton theme
030
Dion Dokter @diondokter.nl · 25/09/2026
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)
Very slow LSP operations with some of them pushing well into 200msVery fast LSP operations where those previously slow ones are now all less than a millisecond
1180
Dion Dokter @diondokter.nl · 16/09/2026
Oh, variation! He's used a dot!
230
Dion Dokter @diondokter.nl · 13/09/2026
LSP preview! Outline, semantic highlighting and inlay hints. I was hoping to get away with not having to implement a textmate grammar, but I think I have to. Comments are not captured in the AST, so I can't give them a semantic highlight and thus will have the default text color
Vscode window with outline, semantic highlights and inlay hints
2110
Dion Dokter @diondokter.nl · 06/09/2026
Started work on an LSP for device-driver
Some DDSL code in vscode with error and warning squiggles
050
Dion Dokter @diondokter.nl · 02/09/2026
Btw, a fairy (who goes by the name @wassasin.bsky.social) left me a Pico de Gallo under my pillow 😄
130
Dion Dokter @diondokter.nl · 30/08/2026
When I eventually sell device-driver to an AI company for hundreds of millions of dollars, I'll exclusively post weird graphs with questionable numbers to generate hype, while you wonder why the numbers were that bad to begin with
A big bold 2.9x faster with two horizontal bars showing the difference
120
Dion Dokter @diondokter.nl · 30/08/2026
Nice (Quite specific benchmark, but an O(n) algo was replaced with an O(1) algo, which is great for big drivers)
New ddc is 2.9 times faster. Hyperfine shows the old executable took 240ms and the new one took 83ms
140
Dion Dokter @diondokter.nl · 11/08/2026
Devilish 😈 (Also more than I ever had on Twitter, so thanks for following me!)
Screenshot of my profile that shows 666 followers
0110
Dion Dokter @diondokter.nl · 10/08/2026
Even in a vacation week I get confronted with the principle of memory safety
Game crash window:

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000000001b8

ManorLords_Win64_Shipping
150
Dion Dokter @diondokter.nl · 25/07/2026
Nooooooo! Clara!
Notification that Clara died in a hunting accident. Sorrow overtakes the Court.
000
Dion Dokter @diondokter.nl · 25/07/2026
Oh heck yes
Crown Princess Clara Theodorokanos with 100-100-100 stats (screenshot from EUV)
100
Dion Dokter @diondokter.nl · 20/07/2026
Spoiler, this will print "welcome administrator"
#include <stdbool.h>
#include <string.h>
#include <stdio.h>

/* if you compile this source to ./a.out,
 * what is the result of "echo filfail | ./a.out" ? */

struct {
        char name[7];
        bool is_restricted;
} user;

int main(void) {
        user.is_restricted = true;

        printf("Name: ");
        fflush(stdout);
        gets(user.name);

        if(strcmp(user.name, "admin") == 0) {
                user.is_restricted = false;
        }

        if(user.is_restricted) {
                puts("access is denied");
                return 1;
        } else {
                puts("welcome administrator");
                return 0;
        }
}
030
Dion Dokter @diondokter.nl · 13/07/2026
An inverse big bool is when an NXP engineer decides to be cheeky and use the opposite bit pattern to mean the same thing :P
/// All true variants mean the same to the boot rom
#[bitenum(u2, exhaustive = true)]
#[derive(Debug)]
pub enum BigBool {
    False = 0b00,
    True = 0b01,
    True1 = 0b10,
    True2 = 0b11,
}

/// All false variants mean the same to the boot rom
#[bitenum(u2, exhaustive = true)]
#[derive(Debug)]
pub enum InverseBigBool {
    True = 0b00,
    False = 0b01,
    False1 = 0b10,
    False2 = 0b11,
}
020
Dion Dokter @diondokter.nl · 13/07/2026
The code NXP will have you write. #BigBoolIsBestBool
Rust code:
```
.with_fast_boot_en(InverseBigBool::True)
.with_enf_tzm_preset(BigBool::False)
```
170
Dion Dokter @diondokter.nl · 05/07/2026
Oh, this is cool! New rust-analyzer command. "rust-analyzer: Evaluate Predicate" Then type in the type and bound and it'll tell you whether it holds. So, you don't have to go through source code anymore. #rustlang
PropertyInfo<u32>: Unpin
> predicate holds
1556
Dion Dokter @diondokter.nl · 27/06/2026
Sickos yes
040
Dion Dokter @diondokter.nl · 25/06/2026
That exists yeah. But they're still not great. A sliding window AC unit seems much better to me. Also, the portable AC unit will still literally suck. I don't think that's the case with sliding window AC, right?
120
Dion Dokter @diondokter.nl · 25/06/2026
European (or really German) style windows don't work well with AC. There are typically no sliding windows here. If there were I think window ACs would be much more popular. So, the only thing left are those portable AC units, and you definitely know, they suck!
671
Dion Dokter @diondokter.nl · 24/06/2026
I'm looking for some syntax I can have for stride. But I can't find something that's good. Looking for feedback. What do you like? [4 by 3] [4 => 3] [4 *> 3] [4 +> 3] [4 :+ 3] [4 :* 3] [4; stride: 3] [4;3] Or something else? Bonus points if it exists in other languages (especially HDL's)
/// This register is repeated 4 times with a stride of 3
register FooRepeated[4*3] {
    address: 3,
    fields: FooFields,
}
200
Dion Dokter @diondokter.nl · 19/06/2026
Here's my license to post, officer! Hope everything is in order? apexdevelopment.github.io/bluesky-lice...
A sort of ID card or passport with bluesky information
040
Dion Dokter @diondokter.nl · 10/06/2026
I guess I'm holding it wrong? Any idea?
diond@PC-DION:~/repos/sequential-storage$ cargo soteria
Compiling... done in 0.59s
error: Fatal: No entry points found
diond@PC-DION:~/repos/sequential-storage$ cargo soteria ./src/item.rs
Usage: soteria-rust exec [--help] [OPTION]… PATH
soteria-rust: too many arguments, don't know what to do with ./src/item.rs
200
Dion Dokter @diondokter.nl · 08/06/2026
2019 during my graduation
100
Dion Dokter @diondokter.nl · 06/06/2026
Don't sleep on refactoring your code, people!
Git diff of a sequence of passes. The left removed side is messy, the righ is added and is a clear one pass per line
3290
Dion Dokter @diondokter.nl · 04/06/2026
Rust constants are slowly but surely getting more powerful! On stable you can parse constants from environment variables. I remember having to pull in weird crates & macros to be able to do this. #rustlang
const TASK_COUNT: usize = {
    let input = if let Some(string) = option_env!("PERFMON_TASK_COUNT") {
        string
    } else {
        "16"
    };
    match usize::from_str_radix(input, 10) {
        Ok(val @ 2..) => val,
        Ok(_) => panic!("PERFMON_TASK_COUNT must be 2 or higher"),
        Err(_e) => panic!("Could not parse `PERFMON_TASK_COUNT`"),
    }
};
410311
Dion Dokter @diondokter.nl · 04/06/2026
I haven't been tweeting much about device-driver lately, but the work is continuing! The remaining work is just quite straightforward and not as interesting :) Also, who decided to increase the scope every release!? 😇 #rustlang
Graph with commits over time. 0.7 had some commits, 1.0 had 4x the commits of 0.7 and 2.0 so far has 3x the commits of 1.0
160
Dion Dokter @diondokter.nl · 30/05/2026
Ok, time to confess! Who's cloned my repo 245 times yesterday?
Github graphs showing amount of clonesWho are you people? With Patrick Star meme
190
Dion Dokter @diondokter.nl · 24/04/2026
Anybody here knows Chumsky? I'm using select in a bunch of places to support *any* value of the token. Is there a better way? I'm experimenting with debug info, but it's showing a lot of 'any's. I've tried converting to a parser that starts with `any()`, but then the debug info remains the same.
120
Dion Dokter @diondokter.nl · 12/04/2026
Anybody know why rust-analyzer is showing me an extra '/' in the inline doc view? This happens when I generate code using the doc attr and with '///'. Rustdoc is rendering it fine, so... RA bug? Just wanna make sure I'm not missing anything before I open an issue :)
Showing the extra '/' in the RA outputShowing rustdoc rendering it without the slash (correctly)Output of RA macro expansion has the extra slash too
021
Dion Dokter @diondokter.nl · 11/04/2026
Cool! I can now tell people about DDSL features through Rust error messages. This is pretty neat :) #rustlang
```rust
#[diagnostic::on_unimplemented(
    message = "no `register-address-mode` is specified in the driver, so multi-register operations are not possible",
    label = "not supported for this driver",
    note = "if you are the author of the driver, specify `register-address-mode` in the device config to enable this feature if the device supports it",
    note = "not all devices support this feature"
)]
#[doc(hidden)]
pub trait AddressMode {
    #[doc(hidden)]
    fn next_address<A: Address>(current_address: A, current_size: usize) -> A;
}
```The previous code, but now applied to a Rust error message. It uses the provided text and changes the default error
2150
Dion Dokter @diondokter.nl · 10/04/2026
Always nice to start the weekend on a positive note. Not this weekend though. Seems like someone's hitch didn't like my car
Dented radar module, paint damage and a broken grille on the front of a car
000
Dion Dokter @diondokter.nl · 31/03/2026
People would think, surely he meant gallons! But no, I looked it up and they really do advise galleons! The saying exists for a reason: 10k galleons a day keeps the Spanish at bay
Cornelis Verbeeck, A Naval Encounter between Dutch and Spanish Warships, 156252 original.jpg

https://commons.wikimedia.org/wiki/File:Cornelis_Verbeeck,_A_Naval_Encounter_between_Dutch_and_Spanish_Warships,_156252_original.jpg
041
Dion Dokter @diondokter.nl · 18/03/2026
ngmi
Github PR line diff: +3979 -7550
050
Dion Dokter @diondokter.nl · 26/02/2026
🤡
J.2 Undefined behavior
The behavior is undefined in the following circumstances:

— A nonempty source file does not end in a new-line character which is not immediately preceded by a backslash character or ends in a partial preprocessing token or comment (5.1.1.2).
150
Dion Dokter @diondokter.nl · 10/02/2026
The long sections of drum and bass present at the start and end of EDM (remixes) are the preamble and postamble of music
EDM music and Packet radio are shaking hands for having pre- and postambles for synchronization
000
Dion Dokter @diondokter.nl · 06/02/2026
Cool, migrated the first device-driver error from miette to annotate-snippets. I can show patch suggestions now! :D It's more work and code to write though and the API is not always clear on how it wants to be treated. But I like the results better.
A nice error for 'address out of range'. It suggests to change the address type from a u16 to a u32
070
Dion Dokter @diondokter.nl · 30/01/2026
Was testing out the annotate_snippets crate. For a split second I thought I had a compile error. So, it seems to be working! (annotate_snippets is the crate rustc uses/is gonna use for reporting errors)
Terminal output with:

error: unexpected token
  --> input.ddsl:28:24
   |
28 |     extern Rah -> u64, ()
   |                        ^ expected one of: ...
error: unexpected token
  --> input.ddsl:28:25
   |
28 |     extern Rah -> u64, ()
   |                         ^ expected one of: ...
130
Dion Dokter @diondokter.nl · 28/01/2026
Every project needs a logo/mascot, no? Maybe a truck driver, but the cargo is a giant DIP package. Should probably be very cartoony. Made a quick non-cartoony mockup :P Idle daydreams...
020
Dion Dokter @diondokter.nl · 19/01/2026
It appears the northern lights have made it over here. Very faint, can't really see it with the naked eye, but my camera can. Add note to myself: Travel up to the Arctic some time to really see it.
010
Dion Dokter @diondokter.nl · 09/01/2026
I might have outdone myself with the generics :P Luckily users don't need to look at it! #device-driver #rust
Meme: Big guy shielding a little guy from incoming arrows.

The big guy speaks of a rust function with many many generics.
The little guy sees a really easy to use function.
170
Dion Dokter @diondokter.nl · 08/01/2026
"Integer number stored in binary format" As opposed to what? Sometimes adding extra info makes it more confusing. You mean it's just a normal integer? (And no, this chip doesn't use BCD which is the only alternative I can come up with)
Image of register documentation that says:
Format: Integer number stored in binary format
280
Dion Dokter @diondokter.nl · 04/01/2026
Gives this API. But I think I can simplify more!
    let (foo_repeated, foo) = device
        .multi_read()
        .with(|d| d.foo_repeated(0).plan_read())
        .with(|d| d.foo().plan_read())
        .execute()
        .unwrap();

    println!("{foo_repeated:?} {foo:?}");
010
Dion Dokter @diondokter.nl · 01/01/2026
Nice! Device-driver will now actually check the names of things. It didn't before and just passed it on to the generated code. If you knew what was going on, you'd know how to fix the errors. But if not, they were very confusing. So now d-d has actual rules!
Example output of the new error. It has nice diagrams and points to an offending emoji in a name.

The help section of the error reads:

Identifiers are split into words using the name-word-boundaries. After the split the first character of the first word must be a `_` or a unicode XID start character. All other characters must be a unicode XID continue character.
291
Dion Dokter @diondokter.nl · 24/12/2025
Geordi la Forge meme.

Saying no to: "git commit to craft a clean history".
Saying yes to: "git commit to continue on a different pc".
1160
Dion Dokter @diondokter.nl · 22/11/2025
Segment LCD screens are now supported in Embassy for STM32 :D github.com/embassy-rs/e...
1201
Dion Dokter @diondokter.nl · 13/11/2025
Ha cool, there's more Rust being written into Android now than C++! New android blog: security.googleblog.com/2025/11/rust...
Bar chart. Rust go up, c++ go down
081
Dion Dokter @diondokter.nl · 30/10/2025
Hmmm, not sure! Maybe check this toggle?
000
Dion Dokter @diondokter.nl · 08/10/2025
This is the setup it's gonna be:
Grid in-line topology with PV inverter with a Multiplus-II GX
000
Dion Dokter @diondokter.nl · 26/09/2025
When device-driver starts generating C code, which version of C should it be? Well, it's not gonna C89 lol! (Alt in thread)
210