felix-lang/felix
{ "createdAt": "2010-03-02T07:11:15Z", "defaultBranch": "master", "description": "The Felix Programming Language", "fullName": "felix-lang/felix", "homepage": "", "language": "C", "name": "felix", "pushedAt": "2024-09-23T10:54:31Z", "stargazersCount": 814, "topics": [ "c-plus-plus", "code-generator", "compiled", "compiler", "coroutine-framework", "coroutines", "functional-programming", "ocaml", "parametric-polymorphism", "performant", "platform-independent", "polymorphism", "programming", "programming-language", "scripting-language", "static-analysis", "type-classes" ], "updatedAt": "2025-11-20T02:53:45Z", "url": "https://github.com/felix-lang/felix"}An advanced, statically typed, high performance scripting language with native C++ embedding.
Features
Section titled “Features”Autobuilder
Section titled “Autobuilder”This file:
println$ "Hello World";can be run directly:
flx hello.flxIt 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
Section titled “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
Section titled “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 headerheader vector_h = '#include <vector>';
// C++11 for smart pointersheader memory_h = '#include <memory>' requires package "cplusplus_11";
// typestype vector[T] = "::std::shared_ptr<::std::vector<?1>>" requires vector_h, memory_h;
type viterator[T] = "::std::vector<?1>::iterator" requires vector_h;
// constructorctor[T] vector[T] : unit = "::std::make_shared<::std::vector<?1>>()";
// operationsproc 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 usevar v = vector[int]!();v.push_back 42;println$ *v.stl_begin;Getting Started
Section titled “Getting Started”Prerequisites
Section titled “Prerequisites”- Python 3
- Ocaml 4.06.1 (only for source build)
- C++ compiler: g++, clang++, or msvc
Extras (can be installed later)
Section titled “Extras (can be installed later)”- SDL2 for graphics
- GNU GMP, GNU GSL
Build from Source
Section titled “Build from Source”git clone https://github.com/felix-lang/felix.gitcd felix. buildscript/linuxsetup.shmakesudo make install # optional!git clone https://github.com/felix-lang/felix.gitcd felix. buildscript/macosxsetup.shmakesudo make install # optional!Building with Nix
Section titled “Building with Nix”On platforms supporting Nix, you can set up a build and runtime environment by running:
git clone https://github.com/felix-lang/felix.gitcd felixnix-shell shell.nix. buildscript/linuxsetup.shmakeThis 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.
Windows
Section titled “Windows”Follow the instructions on the Wiki.
Packages
Section titled “Packages”Arch Linux
Section titled “Arch Linux”Use provided [PKGBUILD]!(./src/misc/PKGBUILD) to make an installable package. It is also available in the AUR repository
cd src/miscmakepkgsudo pacman -U felix-VERSION.pkg.tar.xzTarballs
Section titled “Tarballs”http://github.com/felix-lang/felix/releases
Build Status
Section titled “Build Status”Appveyor, Windows build:
Travis, Linux build:
| Title | URL |
|---|---|
| Documentation Master | http://felix-documentation-master.readthedocs.io/en/latest/ |
| Felix Tutorial | http://felix-tutorial.readthedocs.io/en/latest/ |
| Installation and Tools Guide | http://felix-tools.readthedocs.io/en/latest/ |
| Felix Language Reference Manual | http://felix.readthedocs.io/en/latest/ |
| Felix Library Packages | http://felix-library-packages.readthedocs.io/en/latest/ |
| Articles on Modern Computing | http://modern-computing.readthedocs.io/en/latest/ |
| Felix Home Page | http://felix-lang.github.io/felix |
| Felix Wiki | https://github.com/felix-lang/felix/wiki |
| Git Repository | https://github.com/felix-lang/felix |
| Binary Download | http://github.com/felix-lang/felix/releases |
Mailing List
Section titled “Mailing List”mailto:felixpl@googlegroups.com
Licence
Section titled “Licence”Felix is Free For Any Use (FFAU)/Public Domain.