LLMpediaThe first transparent, open encyclopedia generated by LLMs

Idris (programming language)

Generated by DeepSeek V3.2
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy

No expansion data.

Idris (programming language)
NameIdris
ParadigmFunctional programming, Dependent type
DesignerEdwin Brady
DeveloperUniversity of St Andrews
Latest release version2.0.0
Latest release date2023
TypingStatic typing, Strong typing, Dependent typing
Influenced byHaskell (programming language), Agda (programming language), Epigram (programming language)
InfluencedF* (programming language)
Operating systemCross-platform
LicenseBSD licenses

Idris (programming language). Idris is a purely functional programming language with first-class dependent types, designed to facilitate the development of correct and verifiable software. It was created by Edwin Brady at the University of St Andrews, drawing significant inspiration from languages like Haskell (programming language) and Agda (programming language). The language emphasizes type-driven development, where types are used not only to prevent errors but also to guide the program construction process and formally express specifications.

Overview

The primary goal of Idris is to bring the power of dependent types to general-purpose programming, making formal verification more accessible. It is named after a dragon from British television series, reflecting its ambitious nature. Unlike many research languages focused solely on theorem proving, Idris is compiled, with a backend targeting the Chez Scheme compiler, and is designed to generate efficient executable code. The language community is active, with development discussions often taking place on platforms like GitHub and the IRC.

Features

Idris incorporates several advanced features from modern functional programming. It supports algebraic data types, pattern matching, and type classes similar to those in Haskell (programming language). A key feature is its support for interactive development through a REPL and editor integration, leveraging the Elaborator Reflection mechanism. The language also includes a foreign function interface for interoperability with C (programming language) and JavaScript, and features a built-in package manager for managing libraries and dependencies.

Type system

The type system of Idris is its most defining characteristic, based on a dependent type theory similar to the one used in Coq. This allows types to depend on values, enabling the expression of precise invariants directly in the type signatures. For example, it can encode a type for vectors that includes their length, preventing out-of-bounds access. The system supports proof construction and Curry–Howard correspondence, allowing programs to also serve as mathematical proofs about their own behavior. Type checking is aided by a powerful, programmable tactic system for automating proof search.

Development and implementation

The initial development of Idris began around 2009, with its design and implementation led by Edwin Brady. The first version was implemented in Haskell (programming language), but the major rewrite to Idris 2, which is self-hosted, was completed in the early 2020s. The new compiler uses the Chez Scheme runtime for efficient code generation. Key contributors and research have been associated with the University of St Andrews and other institutions, with funding from organizations like the Engineering and Physical Sciences Research Council. The language's source code is managed openly on GitHub.

Applications and use cases

Idris is primarily used in research and for building high-assurance systems where correctness is critical. Its applications include the development of verified cryptography libraries, secure network protocols, and domain-specific languages with guaranteed safety properties. It has been used in teaching at universities to illustrate concepts in type theory and formal methods. Some projects also explore its use for systems programming and creating verified components for larger applications written in languages like Rust (programming language).

Comparison with other languages

Compared to Haskell (programming language), Idris offers more expressive power through its first-class dependent types, whereas Haskell's type-level programming is more restricted. Unlike Agda (programming language)], which is primarily a proof assistant, Idris places a stronger emphasis on generating executable programs and general-purpose software. When contrasted with Coq, another dependent-typed environment, Idris prioritizes language ergonomics for programming over interactive theorem proving, though it shares the Curry–Howard correspondence foundation. It is also distinct from F* (programming language), which is geared towards program verification for low-level systems and has a different metatheory.

Category:Programming languages Category:Dependently typed programming Category:Functional languages