Fexl - an interpreter for a language based on functions

Fexl is an interpreter for a programming language based on functions. The interpreter is written in standard C and compiled with strictness and optimization. It is designed to be small, efficient, and suitable for embedded or sandboxed applications. The language has a small grammar and a small implementation. Here is some sample code.

Now here are some instructions for various things you might want to do.

NOTE: A new "fresh" branch is now available 2012-12-03

You can browse the "fresh" branch on Github. You can see an overview here.

To clone and build it, use:

git clone git@github.com:chkoreff/Fexl.git fresh
cd Fexl
./build

See the README file for other instructions, such as how to run the self-test:

.  alias
.time a1

Note that this fresh branch does not contain the entire "kitchen sink" of predefined functions that the master branch has. But I'm working on adding those, and I also have a fresh, more flexible approach to this entire issue.

Legacy instructions for the old "master" branch

Browse the code

You can browse the Fexl source code on Github.

Download and install using git

To download and install directly into the standard system directory "/usr", do this:

git clone git@github.com:chkoreff/Fexl.git
cd Fexl
sudo ./build install

You can then run fexl as simply:

fexl

To install in a place other than "/usr"

You might want to install in some other directory of your own, such as "~/myfexl", so you don't need root privileges. Use this build command:

./build install in ~/myfexl

You can now run that version of fexl as:

~/myfexl/bin/fexl

This is handy if you want to use Fexl on a system where you don't have administrator privileges to install it. It also lets you install different versions of Fexl in different places so you can test them independently.

Download without using git

Alternatively, you can download the code as a compressed archive, and unpack it with:

tar -xzf <filename>

Apart from the weird file names you'll see if you download this way, the other instructions on this page still pertain.

Build and run in the download directory without installing anywhere

You can build the fexl program right in the download directory so you can test it without installing:

./build
Then run the local version as:
bin/fexl

How to run the quality assurance tests

The "alias" file has some handy shell commands for testing and benchmarking. Source it into your shell as follows:

. alias

Then you can run the tests as follows:

.time a1
.time a2
.time a3
.time a4

Note that a1, a3, and a4 run quickly, but a2 takes about 18 seconds.

How to download the code and immediately run the quality assurance tests

Also note that you can run those tests immediately after downloading the code, like this:

git clone git@github.com:chkoreff/Fexl.git
cd Fexl
. alias
.time a1
.time a2
.time a3
.time a4

The aliases automatically do a quiet build so you never have to think about it. The .time alias runs the test and compares its output with the reference standard output. If you want to run the tests and actually see the output to your screen, use the .run alias like this:

.run a1
.run a2
.run a3
.run a4

Completely unrelated projects

Clump - a simple program to compile and link C programs

The clump program lets you write C code and simply type "clump" to compile and link it. No makefiles are necessary. It automatically detects and checks dependencies.

Note that I do not use clump to build fexl. I used to do that, but found that I needed more fine-grained control about building the shared library and installation.

Download or browse the code at Github.

Download the code directly from this site as a compressed archive.