Rust offers practical purity through const functions and compiler guidance, balancing Haskell-like safety with Lisp-like flexibility, making it a pragmatic evolution beyond C++ for everyday development.
Formal methods and Haskell offer strong safety guarantees but are too expensive and complex for everyday web development, so the best compromise is ML-inspired languages like Rust. Tris argues Rust is not merely "C++ but better," but rather a hybrid of Haskell's purity and Lisp's flexibility hidden inside a C-like language, allowing it to sneak into production. Rust achieves practical purity through const functions, whose output depends only on inputs, enabling caching, parallelization, and predictable behavior—though with restrictions similar to Haskell's IO, excluding file access, printing, and mutable references. Clippy and the compiler actively guide developers, such as flagging when a function can be made const, showing that side-effect safety is encoded in the type system without a formal purity system. The core thesis, "Rust is as pure as possible, but no purer," sums up this pragmatic balance between soundness and usability.
▶ 0:00 Formal methods provide strong safety guarantees for critical systems, but they are expensive, require unusual verification languages, and slow down iteration — making them impractical for everyday web development.
▶ 1:54 Haskell's functional purity, enforced via type signatures without IO, helps manage side effects and eliminates about half of the "nightmare errors" in Tris's experience.
▶ 2:35 Like formal methods, Haskell is too complicated for general programming, so the best compromise is ML-inspired languages that offer compile-time type safety, functional programming, and side-effect elimination.
▶ 5:09 After years with Scala, Haskell, Clojure, Nim, and Go, he found Rust in 2020; its ML roots show through OCaml's influence on the language's design.
▶ 5:25 Rust is not "C++ but better" — it's "Haskell standing on Lisp’s shoulders, hiding in C’s coat to sneak into production."
▶ 6:10 For Rust tooling, enable all lints and run Clippy in a terminal; the first error is the one you must fix.
main.rs, enabling static type-checking for literate programming; the test prelude and fixture attribute configure pretty errors.const function, and the fix is to “obey the compiler” by making it const—showing Rust’s type system already encodes side effects without a formal purity system.std::env!) is allowed—macros act as the escape hatch for strict const rules.Load the full timestamped transcript on demand and click any time to jump in the video.