An interpreter for fpl
an applicative functional programming language.
The language is structured on using functions to do integer and sequence manipulation.
The interpreter is called fplr
, which stands for Functional Programming Language REPL.
The Read Evaluate Print Loop is the main user interface to the system.
The REPL has capabilities for simple automation of tasks through writing scripts.
The extension for script files is .fpl
.
There are 3 main parts: memory management, parser, and evaluator.
There are 2 levels, the outer level handles the memory management and system tasks.
The inner level parses and evaluates the fpl
statements.
- make
- g++11
- graphviz
- a2ps
- ps2pdf
- pdfunite
Following these steps will build the interpreter and the documentation manual.
$ git clone https://github.com/vastopol/FPL_Interpreter.git
$ cd FPL_Interpreter
$ ./setup.sh # build interpreter and documentation
$ bin/fplr # run interpreter
For comprehensive documentation of the syntax see section on syntax in the manual.
This section will show some of the more important basics of interaction.
The fpl
language is built around the application of functions.
The function application operator is :
New functions can be created with function composition.
The function composition operator is .
A variable is either an integer or a sequence of integers.
Comments are with #
Below are some basic examples of fpl
code.
print Hello World
Hello World
def factorial = prod.intsto
factorial:5
120
let l = <1,2,3,4,5,6,7,8,9,10>
def sum_squares = sum.map{square}
sum_squares:l
385
I started this project after reading some research papers written by John Backus. I wanted to study functional programming and built a tool based on the FP/FL style notation.
These goals explore: Development and design of system level software, programming language theory, parser construction, interpretation of code, etc...
For notes and more technical documentation see the manual.