Flix (programming language)

Flix
ParadigmMulti-paradigm: functional, imperative, logic
DeveloperAarhus University, open-source contributors
Typing disciplineinferred, static, strong, structural
PlatformJVM
LicenseApache License 2.0.[1]
Filename extensions.flix
Websiteflix.dev
Influenced by
F#, Go, Haskell, OCaml, Scala

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.[3] The Flix language supports algebraic data types, pattern matching, parametric polymorphism, currying, higher-order functions, extensible records,[4] channel and process-based concurrency, and tail call elimination. Two notable features of Flix are its type and effect system[5] and its support for first-class Datalog constraints.[6]

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 at run-time. Higher-order functions can enforce that they are given pure (or impure) function arguments. The type and effect system supports effect polymorphism[7][8] which means that the effect of a higher-order function may depend on the effect(s) of its argument(s).

Flix supports Datalog programs as first-class values. A Datalog program value, i.e. a collection of Datalog facts and rules, can be passed to and returned from functions, stored in data structures, and composed with other Datalog program values. The minimal model of a Datalog program value can be computed and is itself a Datalog program value. In this way, Flix can be viewed as a meta programming language for Datalog. Flix supports stratified negation and the Flix compiler ensures stratification at compile-time.[9] Flix also supports an enriched form of Datalog constraints where predicates are given lattice semantics.[10][11][12][13]

  1. ^ "Apache License 2.0". 27 July 2022 – via GitHub.
  2. ^ "Forskningsprojekter". Danmarks Frie Forskningsfond (in Danish).
  3. ^ "Flix Authors". GitHub. 27 July 2022.
  4. ^ Leijen, Daan. "Extensible records with scoped labels". Trends in Functional Programming.
  5. ^ Madsen, Magnus; van de Pol, Jaco (13 November 2020). "Polymorphic Types and Effects with Boolean Unification". Proceedings of the ACM on Programming Languages. 4 (OOPSLA): 1–29. doi:10.1145/3428222. S2CID 227044242.
  6. ^ Madsen, Magnus; Lhoták, Ondřej (13 November 2020). "Fixpoints for the Masses: Programming with First-class Datalog Constraints". Proceedings of the ACM on Programming Languages. 4 (OOPSLA): 125:1–125:28. doi:10.1145/3428193. S2CID 227107960.
  7. ^ Lucassen, J. M.; Gifford, D. K. (1988). "Polymorphic effect systems". Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '88. pp. 47–57. doi:10.1145/73560.73564. ISBN 0897912527. S2CID 13015611.
  8. ^ Leijen, Daan (5 June 2014). "Koka: Programming with Row Polymorphic Effect Types". Electronic Proceedings in Theoretical Computer Science. 153: 100–126. arXiv:1406.2061. doi:10.4204/EPTCS.153.8. S2CID 14902937.
  9. ^ "Programming Flix - Fixpoints". flix.dev.
  10. ^ Madsen, Magnus; Yee, Ming-Ho; Lhoták, Ondřej (August 2016). "From Datalog to flix: a declarative language for fixed points on lattices". ACM SIGPLAN Notices. 51 (6): 194–208. doi:10.1145/2980983.2908096.
  11. ^ Madsen, Magnus; Lhoták, Ondřej (2018). "Safe and sound program analysis with Flix". Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis. pp. 38–48. doi:10.1145/3213846.3213847. ISBN 9781450356992. S2CID 49427988.
  12. ^ Keidel, Sven; Erdweg, Sebastian (10 October 2019). "Sound and reusable components for abstract interpretation". Proceedings of the ACM on Programming Languages. 3 (OOPSLA): 1–28. doi:10.1145/3360602. S2CID 203631644.
  13. ^ Gong, Qing. Extending Parallel Datalog with Lattice. Pennsylvania State University.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search