1 Running Programs
Suppose we have a felix program hello.flx
:
println$ "Hello World";
which we expect to print
Hello World
To run this program we just type
flx hello.flx
That's it. Behind the scenes, it is translated to C++, compiled, linked, and executed.
1.1 Performance
The first time, it will take around 5 seconds.
1.2 Dependency Checking
However, if you do it again, it's much faster. That's because, if the program binary is up to date, Felix just runs it.
~/felix>time flx hello Hello real 0m0.581s user 0m0.476s sys 0m0.086s
1.3 Caching
You may wonder where the binary is. Indeed, you may
wonder where the generated C++ is. If you look at the
directory containing the hello.flx
file, you will not
see these files.
These files are considered temporaries, and are stored
in a cache, usually in $HOME/.felix/cache
somewhere.
1.4 Binaries
That isn't the end of it, though. Most scripting languages make it insanely difficult to generate a portable binary. Just take a look at projects such as py2exe, PyInstaller, OCRA, srlua, and many more similar projects. However, Felix makes it easy. Just run:
flx -c --static -o hello hello.flx
You should now have a working hello
binary! This combination
of being able use Felix like a scripting language and then
generate portable binaries for distribution is very powerful.