XLR - The functional flavor of XL

0! -> 1
N! -> N * (N-1)!

Factorial in XLR

XLR is the functional variant of XL. It is intended to feel familiar to programmers who used languages such as Lisp, Scheme, Haskell, and to a certain extent Python or Ruby.

Key properties

XLR has the following standard features:

Meta-programming in XLR

if true then X else Y -> do X
if false then X else Y -> do Y

Adding "If-then-else" in XLR

XLR is based on XL, so it also offers advanced meta-programming capabilities:

XLR Language Reference Draft

Attached is the current draft of the XLR language reference. This is work in progress.

A major update of this document has been posted here for review in January, 2012, and should be updated on a regular basis. It describes not the state of XLR as it is currently implemented, but where we are trying to go.

Here are some of the major changes in this draft:

  • The "context", which is currently a C++ class (two, actually, "Context" for -O0 and -O3, and "Symbols" for -O1) referencing a few other classes (notably "Rewrite"), is now defined entirely in terms of XLR nodes. I intend to modify the XLR compiler so that all symbol management can be done entirely with XLR data structures.

  • The document finally contains a description of the XLR type system. Types identify shapes of trees, and they can do pretty fancy stuff. I still need to see if I can make this compatible with the type inference we have, which is critical to performance.

XLRef.pdf473.49 KB