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!
With this, new languages like Vale are one step closer to being able to reuse the entire Rust ecosystem!
https://t.co/3Wo2w7Zc3s
"Crossing the Impossible FFI Boundary, and My Gradual Descent Into Madness"
If we're right, then this could pave the way towards newer languages calling into and building upon Rust, in the same way C++ built upon C!
https://t.co/RaYEUcfdGq
The most surprising part is that we're sending non-#[repr(C)]'d types into C. Heresy, but effective!
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/VfKkIOuvIE
If anyone knows any more approaches, speak up, would love to expand that list!
@krisajenkins (of Developer Voices) just interviewed Vale's @verdagon, and they talked a lot about linear types, regions, and a few other obscure Vale topics, take a look!
https://t.co/x5x9kGC6lZ
@ShalokShalom Howdy! If you're asking whether Vale has global type inference, it doesn't. It does type inference intra-function, but requires full parameter and return types be specified for all functions. Hope that helps!
@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 #2: Single-threaded RC (Nim), plus region borrowing (Vale) [1], plus copy types (C#, Swift).
Enforced by static analysis checker, of course.
(I think we might also be able to do contiguous ref-counted arrays, but still looking into that.)
[1] https://t.co/EFdE0AjvTB
We often talk about zero-overhead memory safety, but no language has ever really achieved it. Once we use a more holistic definition, we see that memory safety always has a run-time cost. The only question is: where do we want to pay it?
https://t.co/UedF8O7zAh
@vale_pl Linear types (and the higher RAII they enable) are pretty huge. Any time you say "Ah, I forgot to do X", that's a bug linear types help prevent. I wrote about this in https://t.co/ozJxhoAdpL and have been discovering more and more uses for them ever since!
It turns out, one doesn't need borrow checking, RC, or GC to get memory safe single ownership! And with a little twist, we can enable compile-time guarantees that no mainstream language has been able to achieve.
https://t.co/aXPvu50pjE
Enjoy!
One of those little weird little language details that can have potentially *huge* development time benefits: generics and type erasure.
https://t.co/bICpyVDJrD
@vale_pl Fun fact: All these techniques we're designing for Vale could easily be applied to reference counted languages too.
This (plus regions) is why I think RC will make a huge comeback in the next decade, even over tracing GC.
Revelations about where efficient memory safety actually comes from! https://t.co/V1UQfFAsgh
TL;DR: We can combine linear types with other memory safety approaches (like gen refs or ref counting) to reduce overhead down to zero where we want.
There's a *lot* that goes on under the hood for Vale's region borrowing. But hey, nobody said it would be easy to make a completely new memory safety paradigm!
https://t.co/8lLHXDeJ30