Evergreen: A Provably Safe Systems Language evergreenlang.net · 52 points · 30 c...
HN Best 200 @best
Evergreen: A Provably Safe Systems Language evergreenlang.net · 52 points · 30 comments · HN thread
TL;DR Evergreen is an early-stage systems programming language by jordan_bonecut, built with heavy AI assistance over a couple of weeks, that adds preconditions, postconditions and data invariants as compiler-checked obligations. The site presents it as provably safe, using a 'plane' model of memory in place of Rust-style lifetimes, with an escape hatch called trustme for claims the compiler cannot prove.
- Preconditions (where), postconditions (ensures) and data invariants sit beside the function they describe and are checked by the compiler, e.g. fn increment(n: usize) where n < usize::MAX ensures result > n.
- Memory is modeled as a tree of 'planes': the stack is a plane, each function and variable is a node, and a struct allocation gets a child plane per field.
- The author says that without trustme, the compiler guarantees a value is not addressed as the wrong type and that references are live at compile time, so invalid pointers cannot be created.
- Lifetimes and some Rust pointer-mutability rules are deliberately omitted; the author argues Rust rejects safe code such as swapping two mutable elements of a Vec.
- Dependent types are approximated through 'ideal Generics' where a type is generic over a value; commenters judged the system closer to refinement (Liquid) types.
- The README and docs are admitted to be rough and partly written as a prompt for an AI, and the language is described as not yet useful, with no standard library or batteries yet.
Discussion The thread is a mix of curiosity and skepticism about a young language. Most comments dig into the technical design: whether the plane model really prevents use-after-free, how it compares to Rust lifetimes, refinement versus dependent types, and existing systems like SPARK and Valen. The author replies patiently and often, but several commenters push back on unclear documentation and on the AI-assisted origin of both the code and the prose. Background debates about AI and language adoption, and about the ugliness of :: namespacing, come up too. Overall the mood is interested and polite, with sharp questions rather than hostility.
- Interesting concept, but docs are too shallow to evaluate (most): Several commenters could not understand the syntax or the memory model from the README and asked for a real specification, with skybrian pointing to Go's spec as a model. They also flagged prose that reads as AI-generated and unclear, such as the plane description.
- Safety claims about planes and threads are unproven (some): 0c3ca83 and nicce questioned how the plane model prevents use-after-free and what happens with allocations and threads. The author said threads are still unresolved, which left the central safety claim open to doubt.
- Closer to refinement types than dependent types; idea is good (some): throwaway17_17 and ch4s3 said the examples look like Liquid-style refinement types, and ch4s3 said adding liquid types to a Rust-like language is a good idea. They compared it to their own refinement-type work and to Z3-based approaches.
- Too similar to SPARK or Valen to stand out (some): gtutino said it resembles SPARK with C-like syntax, and LiamPowell argued the author must state what differs from existing languages. tancop compared group borrowing to Valen.
- Language adoption is the hard part, not the design (a few): sblom said success depends on community and interop, and noted that a language needs an HTTP server, JSON parser and similar libraries. The author agreed batteries are planned later.
- Doubts about building languages for AI agents (a few): 0c3ca83 asked why anyone would write a language they do not intend to code in themselves, arguing agents favor mainstream languages with large training sets. gchamonlive and jeremyloy_wt answered that strict languages with clear compiler feedback help agents.
- Namespace syntax with :: is a bad design choice (a few): kreco said the xxx::yyy::zzz namespace style is unnecessary outside C++ and reflects copying rather than reasoning, and aeve890 preferred PHP's backslash style.
#programmingLanguages #formalVerification #rust #refinementTypes #aiAssistedCoding