Evergreen is a systems programming language that integrates explicit contracts, checked invariants, and memory control into a single framework. Unlike many languages that rely solely on runtime checks or basic type systems, Evergreen requires developers to write down what must hold in their code—such as preconditions, postconditions, and data invariants—and then tasks the compiler with proving those obligations. For example, a developer can define a type that is guaranteed to be non-zero; the compiler then ensures that any value assigned to that type satisfies the invariant at the moment of construction.
The language's safety model is built on the concept of 'provable' code. This is achieved through the use of dependent types and formal proofs, which allow the compiler to verify logic before execution. A key design goal of Evergreen is to ensure that these proofs do not impact the final executable's performance. The language utilizes 'ideal computations' and lemmas by induction that are erased after the checking phase, meaning the mathematical work required to prove safety is performed at compile-time, leaving the runtime code lean and efficient.
Evergreen seeks to address specific limitations found in existing systems languages like Rust. While it adopts concepts like ownership and borrowing, it aims to provide more flexibility in how memory is accessed. For instance, the developer of Evergreen noted that the language intends to allow operations that Rust's borrow checker might reject—such as swapping two mutable references in a vector—by using a memory model based on a tree of 'planes' and 'nodes.' However, the project is currently in an early, experimental stage. The documentation is still being developed, and the core focus remains on establishing the fundamental syntax and proving mechanisms rather than building a production-ready ecosystem or library suite.
Because the project is in its infancy, several questions remain regarding its practical implementation. The specific logic of the 'prover'—whether it relies on SAT solving or other formal methods—is not yet fully detailed in a public specification. Additionally, as with any new systems language, the long-term viability of Evergreen will depend on its ability to build a functional ecosystem of libraries and interoperability with existing tools, a challenge that remains an open question for the project's future.
