Vale was created to be the first fast, safe, and easy programming language.
Generally, languages today have one or two, but not all three.
This article will dive into the details and compare these languages.
Note that Vale is not finished, it's only at v0.1. We make it clear in the asides when we're talking about the design, rather than the implementation.
Keep in mind, this article is written with love; I picked these three languages because they're my favorite in some way:
This post is not meant to be a hit piece, just an honest comparison. Also note that these are just my opinions, and not objective truths!
(I hope this isn't quoted on PCJ!)
It's fun to push the borrow checker's boundaries, especially when traits and closures are involved!
Vale aims to be safe and fast while also remaining easy. 2
To get a sense of what easy means:
Vale is 100% safe, which removes most of C++'s difficulties.
Vale's region borrow checker doesn't have the mutability xor aliasability restriction, which which is the source of Rust's difficulties.
Vale makes a few concessions here:
Vale is still v0.1 (a prototype), and its tooling (compiler, debugging, IDE support, etc.) is very young. This section factors in only the languages themselves.
This principle is called "gradual complexity." Other languages that do this well are C#, Swift, and Go.
Vale has no unsafe, and uses extern isolation to make it so bugs in C code can't trigger memory unsafety in Vale code. You can read more about this at Absolute Safety in Vale.
This stands for Foreign Function Interface, and refers to how Rust can call into C code.
Vale also uses regions to make it much easier to harness alternate allocation strategies.
In practice, Vale could be:
For more thoughts on Rust and Vale (and other languages), check out Beyond Rust: Innovations in Safety, Speed, and Flexibility!
It's important to keep in mind that Vale, C++, Rust, and JS have different strengths which makes them suitable for different use cases.
Compared to Vale:
Vale's combination of speed, safety, and ease are universally useful, but it will particularly shine for:
Until we finish HGM and have benchmarks, this is a goal, not a claim.
See Beyond Rust: Innovations in Safety, Speed, and Flexibility for more on the borrow checker's indirect run-time overhead.
This is still being implemented, but you can read about the design at Hybrid-Generational Memory!
This behavior keeps single ownership and move semantics easy.
One can override this with the inl or yon keywords for a specific allocation. (yon is a temporary name, we're still weighing better keywords.)
Vale could have a file- or function-level compiler directive to require inl or yon keywords on every allocation.
Vale instead uses FFI to call into another language (such as C, C++, or Rust) to do the low-level operations for it.
With regions, it could be faster than C++ in some cases.
See Seamless Speed, Safety, and Reuse Without Frameworks for more on the apps case.