Flix is a functional, imperative, and logic programming language developed at Aarhus University with funding from the Independent Research Fund Denmark[2] and by a community of open source contributors. Flix supports algebraic data types, pattern matching, parametric polymorphism, currying, higher-order functions, extensible records[3], channel and process-based concurrency, and tail call elimination.
Flix | |
---|---|
Paradigm | Multi-paradigm: functional, imperative, logic |
Developer | Aarhus University, open-source contributors |
First appeared | 10 August 2015 |
Typing discipline | inferred, static, strong |
Platform | JVM |
License | Apache License 2.0[1] |
Filename extensions | .flix |
Website | flix |
Influenced by | |
F#, Go, Haskell, OCaml, Scala |
Flix supports Datalog constraints as first-class values that can be passed around, compose with other constraints, and solved.
The Flix type and effect system supports Hindley-Milner-style type inference. The system separates pure and impure code. If an expression is typed as pure then it cannot produce an effect. Higher-order functions can enforce that they are given pure function arguments or alternatively they can be effect polymorphic in the effect of their arguments. The effect inference algorithm is based on Boolean unification.
History
Examples
Hello World
print_endline "Hello World!"
Algebraic Data Types and Pattern Matching
...
Higher-Order Functions
...
Extensible Records
...
Notable Features
Polymorphic Effects
First-class Datalog Constraints
Principles
The Flix language design includes a collection of stated principles that shape the language[4]. These include:
- Everything is an expression
References
- ^ "Apache License 2.0" – via GitHub.
- ^ "Forskningsprojekter". Danmarks Frie Forskningsfond (in Danish).
- ^ Leijen, Daan. "Extensible records with scoped labels". Trends in Functional Programming.
- ^ "The Flix Programming Language". flix.dev. Retrieved 28 August 2020.
{{cite web}}
: Text "Principles" ignored (help)