Yesterday I ended up taking a random walk through "the rust memory model is more what you'd call "guidelines" than actual rules".
Today I took a wrong turn and ended up on the LKML, in which I learned that the kernel has its own unique memory model, but also now contains rust code which follows the rust memory model (whatever that turns out to be), and also it's necessary to be able to exchange data back and forth between memory models.
Some days, I'm just amazed that computers sometimes work.
No diss on anyone involved, to be clear. The kernel has reasons for its own memory model, Rust obviously has some memory model even with edge cases (and in some places delegates to c++20, which I'm assuming is partly a consequence of going through LLVM and inheriting a lot of stuff from C++). People are doing hard and productive work to get all these things nailed down and be confident in how computers work.
It's just... could computers work by themselves every now and then please
@danderson This is one of my grumbles with modern systems languages... their memory models are often frustratingly at odds with being able to do what you want to do in a kernel environment. Migrating to C++ in Fuchsia's kernel caused a pile of headaches because of this.
@swetland ... Fuschia migrated the kernel to C++? Wha?
Also if you have any writeups of how system language memory models interfere with kernel things, I'd love to read more! I can very much believe it's an environment that gets forgotten about, but I don't have a crisp understanding of what hurts/breaks.
@danderson Oh yeah that happened while I was still there. I was not a fan, but can't fight progress I suppose. It honestly felt like way more complexity than it was worth for how small the kernel was.
Sadly I don't remember all the various headaches, (been almost a decade) just that we fought with a number of what seemed to me like pointlessly annoying expectations C++ had about things.
Add comment