Idris
Idris programming language
Idris is a general-purpose, purely functional programming language with full dependent types, allowing types to depend on values so that many correctness properties can be checked at compile time.
Definition
Idris is a general-purpose, purely functional programming language with full dependent types, allowing types to depend on values so that many correctness properties can be checked at compile time.
Overview
Idris extends the ideas found in functional languages like Haskell by adding dependent types as a core feature rather than an experimental extension. In a dependently typed language, types can be parameterized by actual values — for example, a function's type signature can state that it takes a list of exactly length 5 and returns a list of exactly length 5, and the compiler will verify this statically rather than at runtime. This lets developers encode much stronger correctness guarantees directly into a program's types. Beyond dependent types, Idris supports type-driven development, an approach where programmers write precise type signatures first and let the type system guide (and sometimes largely determine) the implementation, aided by tooling that can suggest valid function bodies based on the required type. Idris also compiles to multiple backends, including C and JavaScript, and supports effect systems for tracking side effects such as file I/O or state mutation within the type system. Idris is used primarily in research, safety-critical software, and by developers exploring formal-methods-adjacent programming rather than in typical industry application development, given its steep learning curve and smaller ecosystem compared to mainstream functional languages. It sits alongside languages like Agda, Coq, and Lean in the small but influential category of dependently typed languages, with Idris distinguishing itself by aiming to be more practical and general-purpose than proof assistants like Coq or Agda, which are used primarily for formal mathematical proof rather than everyday programming.
Key Features
- Full dependent types allowing types to depend on runtime values
- Type-driven development workflow with interactive tooling support
- Compile-time verification of properties like array length or invariants
- Multiple compilation backends including C and JavaScript
- Effect system for tracking side effects within the type system
- Purely functional core language design
- Smaller but active research-oriented community