Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Dependently typed Clojure DSL with a Lean4 compatible kernel

Ansatz is a dependently typed Clojure DSL that features a kernel compatible with Lean4, enabling type-safe programming within the Clojure ecosystem.

Background

- **Ansatz** is a new domain-specific language (DSL) embedded inside Clojure that brings *dependent types* — a powerful feature usually found in academic languages like Lean, Agda, or Coq — to a mainstream Lisp environment. - Dependent types allow types to depend on values (e.g., a "list of length 3" is a different type from "list of length 5"), enabling the compiler to catch more logical errors at compile time. - The project advertises a **Lean4-compatible kernel**, meaning proofs and programs written using Ansatz can interoperate with Lean4 (a popular proof assistant and functional language developed by Microsoft Research). - **Why it matters**: Clojure is dynamically typed and designed for pragmatic, data-oriented programming. Adding a dependent type system makes it possible to write formally verified Clojure code — useful for safety-critical domains like smart contracts, protocols, or financial systems — while still leveraging Clojure's ecosystem. - The project is early stage and hosted on GitHub under the replicativ organization, which has a history of experimental data management and distributed systems work.

Related stories