FAI (or FAI lang) stands for Functional Alegbraic, and Interpreted language, and that's what it strives to be. FAI is a purely functional language with algebraic syntax. That said, FAI is not just a functional calculator. While FAI borrows syntax from algebra, it in itself is not algebra, and the user must implement any non-basic algebraic functions. For example, if one wanted to solve a trinomial, they could implement the quadratic formula.
quadratic(a, b, c) = (-b +- sqrt(b^2 - 4a*c)) / 2a
quadratic(1, -1, -2)
> (2 | -1)
Other programming languages, especially functional ones, may look intimidating or confusing to new programmers. For example, this scheme code:
(define (factorial x)
(if (= x 1) 1 (* x (factorial (- x 1)))))
A programmer familiar with Scheme (or another LISP-like language) might have no problem reading that, but to someone with no exposure to programming, how would they know what's going on there? Compare that to the FAI code:
factorial(x) = {1 if x = 1; x * factorial(x - 1) otherwise;
That's already much more readable to someone who knows algebra but after being processed through TeXiFAI, a FAI TeXer (on hold until grammar is finalized), that function could be automatically represented like this:
Connecting that to the algebraic notation isn't hard, because it is the algebraic notation.
So as a complete answer to what the purpose of FAI is, FAI exists to serve as a programming language that allows for teaching a functional paradigm within the comfort of algebraic syntax.
A draft specification is currently being worked on at the wiki page.
For plans with language features, look in the issues tab. If you have an idea, feel free to open up a new issue with your proposal.
- Finish TeXiFAI, a FAI TeXer
- Create FAIDE, a FAI IDE