-
-
Notifications
You must be signed in to change notification settings - Fork 1
Functional Programming
Functional Programming is supported within the compiler internals based on the semantics of System F<: with Specialization. When using functional programming in applied contexts it often becomes necessary to use a variety of data structures that may have runtime costs.
Functions in LM are not limited to the ALGOL "let's put it on the stack" style of programming. Instead, LM Functions are treated as traditional mathematical objects: i.e. a set of pairs (a,b) that map domain objects to range objects.
However, in practice, compilers still need a finitary representation so we use Terms and Fragments.
- Terms are traditional functions or expressions, no surprise here
- A fragment is a key-value map of Strings to S-Expressions.
Between these two representations, we find that most mathematical ideas can be expressed naturally and efficiently.
- Closed Data Representation for Closures
- Closed Calling Convention for Higher Order Functions
- Open Pack / Unpack Closures
LM is not explicitly eager or lazy, it just generates code to follow whatever pattern you ask for. The compiler itself is eager, but that doesn't mean your code needs to be the same.
- Open Implicit Coercions
The λ☶ source code and documentation are released under the terms of the attached permissive MIT license. This license is intended only to protect the future development of the project while otherwise allowing people to use the code and IP as they would like. Please, just be nice.