Skip to content
The Felix Programming Language
Branch: master
Clone or download
skaller Fix bug typing matches in functions with specified return type.
The specified type was propagated too far into expressions.
Fixing this exposed another issue, binding explicit return
statements didn't allow the type to be a subtype of the
specified return statement. This broke a library case
where a uniq list was returned but the function specified
a plain list.
Latest commit d9d4c3b Apr 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
buildscript Minor name changes in preparation for config. Sep 16, 2018
buildsystem Hopefully fix #133. Jan 14, 2019
doc doc [ci skip] Mar 31, 2019
docs Doc. Mar 1, 2019
fbuild Try to fix process management in windows fbuild. Oct 16, 2018
installscript Add support for clang on Linux64. Jan 12, 2019
licences Remove more stuff.. and note, sqlite test fails now ;( Dec 7, 2010
pdfs Docs [ci skip] Sep 11, 2018
speed doc [ci skip] Jul 25, 2018
src Fix bug typing matches in functions with specified return type. Apr 10, 2019
.gitignore Cleaning up root folder (moving pdfs) Oct 19, 2017
.gitmodules Remove fbuild submodule. May 3, 2012
GNUmakefile Simplified and added dependencies to PKGBUILD Apr 9, 2019
Makefile Get more stuff right. Nov 8, 2018 Simplified and added dependencies to PKGBUILD Apr 9, 2019
VERSION Add support for clang on Linux64. Jan 12, 2019
build.fpc Rework flx. Jan 9, 2015
concurrent_coroutines.flx Three concurrency measurements. Dec 21, 2018
concurrent_coroutines2.flx Three concurrency measurements. Dec 21, 2018
concurrent_pipeline.flx Allocate 100Meg stacks for spawned threads. Dec 22, 2018
concurrent_pipeline2.flx Fix deadlock. Add another test. Dec 24, 2018 Minor name changes in preparation for config. Sep 16, 2018
flxsetup.bat fix this up a bit Nov 29, 2015
hello.flx Add some extras to win32 install [ci skip] Oct 27, 2015 Cleaning up root folder (moving pdfs) Oct 19, 2017
mul.flx Fix the thread pool code. Dec 6, 2018 New version 2016.04.10-rc1 Apr 10, 2016
rope.flx Keep the rope test for the moment. Oct 30, 2018
setupdebug.bat Add personal debugger setup. Sep 27, 2015
shell.nix specify exact ocaml version Nov 12, 2018 fix Oct 29, 2015
vcvarsall.bat Add Windows 10 setup for Turkey. Aug 29, 2015
vssetup.bat Add a setup batch file I can run from Startup Menu. Sep 19, 2015
wbuild.fpc Fixes... Oct 5, 2015


An advanced, statically typed, high performance scripting language with native C++ embedding.



This file:

// hello.flx
println$ "Hello World";

can be run directly:

flx hello.flx

It just works. No makefiles. No compiler switches. Automatic caching and dependency checking for Felix and C++. Uses a flx_pkgconfig database consisting of a directory of *.fpc files to specify and find libraries and header files based on in language abstract keys.

Hyperlight Performance

The aim is to run faster than C.

Underneath Felix generates highly optimised machine binaries which outperform most interpreters, bytecode compilers, virtual machines, and sometimes compiled languages including C and C++.

Felix is an aggressive inliner which performs whole program analysis and high level optimisations such as parallel assignment, self-tail call elimination.

Felix generates optimised C++ which is then compiled and optimised again by your system C++ compiler.

Compiler Ack Takfp
Felix/clang 3.71 6.23
Clang/C++ 3.95 6.29
Felix/gcc 2.34 6.60
Gcc/C++ 2.25 6.25
Ocaml 2.93 8.41

C and C++ embedding

Felix is a C++ code generator specifically designed so that all your favourite C and C++ libraries can be embedded with little or no glue logic:

// required header 
header vector_h = '#include <vector>';

// C++11 for smart pointers
header memory_h = '#include <memory>' 
  requires package "cplusplus_11"
// types
type vector[T] = "::std::shared_ptr<::std::vector<?1>>" 
  requires vector_h, memory_h

type viterator[T] = "::std::vector<?1>::iterator"
  requires vector_h

// constructor
ctor[T] vector[T] : unit = "::std::make_shared<::std::vector<?1>>()";

// operations
proc push_back[T] : vector[T] * T =  "$1->push_back($2);";
proc push_back[T] (v: vector[T]) (elt:T) => push_back(v,elt);

fun stl_begin[T] : vector[T] -> viterator[T] = "$1->begin()";
fun deref[T] : viterator[T] -> T = "*$1";

// example use
var v = vector[int]();
v.push_back 42;
println$ *v.stl_begin;

Getting Started


  • Python 3
  • Ocaml 4.06.1 (only for source build)
  • C++ compiler: g++, clang++, or msvc

Extras (can be installed later)

  • SDL2 for graphics

Build from Source


git clone
cd felix
. buildscript/
sudo make install # optional!


git clone
cd felix
. buildscript/
sudo make install # optional!

Building with Nix

On platforms supporting Nix, you can set up a build and runtime environment by running:

git clone
cd felix
nix-shell shell.nix
. buildscript/

This will do an in place "install" of the Felix binaries. Note that this should work on OS X with Nix, but needs to be tested.


Make sure git, Python3 and Ocaml are on your PATH. You can download a pre-built Ocaml 4.06.1 for Windows.

Open a cmd.exe console with Visual Studio 2015 or above environment established or run vcvarsall x86. See vcvarsall.

git clone
cd felix
. buildscript/
nmake install # optional!


Arch Linux

Use provided PKGBUILD to make an installable package. It is also available in the AUR repository

cd src/misc
sudo pacman -U felix-VERSION.pkg.tar.xz


Build Status

Appveyor, Windows build: Build Status Travis, Linux build: Build Status


Title URL
Documentation Master
Felix Tutorial
Installation and Tools Guide
Felix Language Reference Manual
Felix Library Packages
Articles on Modern Computing
Felix Home Page
Felix Wiki
Git Repository
Binary Download

Mailing List


Felix is Free For Any Use (FFAU)/Public Domain.

You can’t perform that action at this time.