Felix is a Scripting Language
Felix allows you to run source code directly. The sample program:
// file: hello.flx #import <flx.flxh> print "Hello world\n";
is run by just typing the command
flx hello
Comments? can be introduced by // as in C++ or /* .. */ as in C.
The import? preprocessor directive is used to provide access to the Felix standard library, which provides the print command for you.
Felix is Fast
Behind the scenes, Felix translates Felix source code into C++, and then uses your C++ compiler to translate that into native code. The Felix compiler flxg performs high level optimisations and the C++ compiler performs low level optimisations, making Felix the fastest scripting language available.
Felix is Very Fast
In fact, Felix is so fast it is often faster than most compiled languages, and sometimes faster than C! On AMD64 using gcc-4 the Felix version of Ackermann's function is approximately twice as fast as native C code, as well as Gnat Ada and Ocaml native code compiler.
Felix catches Errors Early
Felix uses an advanced static typing system which catches many more errors than a C++ compiler can.
Felix is Expressive
There's another reason Felix is good for writing safe code: it's twice as expressive as C++, and so you can express your ideas in half the amount of code, which makes for half the bugs!
Felix upgrades C++
There's yet another reason Felix is safe and expressive: you can easily reuse you existing C++ functions and classes in Felix. Whereas other languages have Foreign Function Interfaces (FFIs), Felix provides a Native Interface. Here's an example:
type myclass = "myclass*"; gen new_myclass : unit -> myclass = "new myclass"; proc draw: myclass = "$1->draw();"; proc move: myclass * int * int = "$1->move($2,$3);"; fun xpos: myclass -> int = "$1->xpos()"; fun ypos: myclass -> int = "$1->ypos()";
The following procedure:
var x = new_myclass(); move (x,10,10); draw x; print "pos="; print (xpos x); print "," print (ypos x); endl;
will generate roughly this C++:
x = new myclass; x->move(10,10); x->draw(); cout << "pos="; cout << x->xpos(); cout << ","; cout << x.ypos(); cout << endl;
If you think this looks almost the same as the Felix version .. well that's entirely the point! Felix is C++ with a better syntax and a better type system.
Felix is platform independent
Felix is designed so you can write code that runs on all computers the same way. The library abstracts platforms differences for a number of important resources such as threading and sockets. It currently runs most major platforms with any processor and can be configured to support any C++ compiler which can compile ISO C++.
