TL;DR: You can have multiple mutable references to the same data, and even temporarily turn one into a unique reference if you need to modify e.g. unions. Turns out, that fits with RC really well!
New article! This one's about how Ante took a pretty big step forward in making borrow checking and reference counting actually work well together. Enjoy!
https://t.co/JBnkHiYXFu
New article!
https://t.co/CvpNnFkmWr
"The Impossible Optimization, and the Metaprogramming To Achieve It"
TL;DR: If you warp your mind a bit, you can apply metaprogramming to speed up your code by about ~10x.
Enjoy!
Just posted a new article! https://t.co/BfSmG8yxzf
"Group Borrowing: Zero-Cost Memory Safety with Fewer Restrictions"
TL;DR: Nick Smith's epic approach to better borrow checking. Take a look!
I *really* went off the deep end on this one. But it works, and in theory we can now build on top Rust's ecosystem!
https://t.co/nnbDijbYlQ
"Crossing the Impossible FFI Boundary, and My Gradual Descent Into Madness"
@vale_pl This was *really* hard to get working, but worth it! I just called into a Rust crate directly from C without writing any glue code, quite a magical moment.
The hardest part was navigating Rust's AST to resolve imports and aliases, to invoke the correct function. But it worked!
@vale_pl Pretty excited about this one. I've been exploring linear types and higher RAII for *years*, looking for use cases, especially on HN and in the Vale and Austral discords. (@zetalyrae's probably real tired of me bringing it up all the time in there!)
Pretty proud of this technique! (though I'm not the first to find it)
https://t.co/g8vsc35FC6
Basically, batching + layer-wise inferencing from disk, which means we can run large LLMs on tiny devices without losing throughput.
Behold! Higher RAII, and the Seven Arcane Uses of Linear Types: https://t.co/OzJvWzhPeh
It turns out, you unlock pretty sorcerous powers when you make it so only specific functions can destroy a certain type.
Also, it's very weird that a language could help with caching.
New article! "Borrow checking, RC, GC, and the Eleven (!) Other Memory Safety Approaches"
https://t.co/jUZB8mBmGZ
I'm starting to sense a theme in my articles: a lot of archaeology metaphors. Hopefully nobody notices!
Had a ton of fun talking linear types, regions, and Vale with @krisajenkins (of Developer Voices), always enjoy geeking out with fellow programmers about the weird directions programming can go!
https://t.co/aBk6ajyN4Q
@vale_pl Regions are also a way to make colorless fearless structured concurrency (a mouthful I know), without going all in on a Rust-like borrow checker. https://t.co/sjwcQqlCnf
Now that we have a working regions prototype, I can finally start working on concurrency!
@vale_pl This has been a long time coming! Regions are Vale's "killer feature", they let us write in a normal unrestricted way then incrementally optimize. This lets the user choose whether they their is flexible like Java, fast like Rust, or any point in between.
At long last, the first prototype of immutable region borrowing in Vale! https://t.co/pL9mynynR3
This technique removes Vale's memory safety overhead by making borrowing and shared mutability work well together.
Blend #4, though I'm a tad unsure on this one. Something along the lines of the "MMM++" in https://t.co/DG1j7RjE0b with pieces from the theoretical Arrrlang, at https://t.co/NeOXGqqGU7.
Basically, allocating from static type-specific arrays, like embedded code often does.
It turns out, there's a few ways we can make C++ memory-safe, if we blend some obscure techniques.
Blend #1: Vale's gen refs / constraint refs plus Val-style borrowing. I go into it in https://t.co/5CkbqoELFT.
(If only we had something from Vala too, we'd have the whole set!)
Blend #3: Blending arenas (Zig, Odin) with region borrowing (Vale) [1] and Pony's iso [2]. Similar in spirit to Verona [3], without GC.
We alluded to it at Handmade, https://t.co/wUKZSPd68w.
[1] https://t.co/EFdE0AjvTB
[2] https://t.co/izWOXAUVhX
[3] https://t.co/dhQdBSzfEr