WIP
This is a new functional language with the first-class array support
and planned object-oriented features. ficus
compiler generates
a portable C/C++ code out of .fx files.
The code is distributed under Apache 2 license, see the LICENSE
The compiler has been written in OCaml and needs ocaml
(including ocamlyacc
and ocamllex
utilities),
ocamlbuild
and make
utility to build it.
Tested with OCaml 4.07-4.10.
(In the near future it's planned to rewrite the compiler entirely in ficus)
cd <ficus_root>/src
make
./ficus -run -O3 ../examples/fst.fx # can also try other scripts in <ficus_root>/examples
run ficus --help
to get more complete up-to-date information about command line parameters
here is brief summary:
ficus [-c|-app|-run|...] [-O0|-O1|-O3] [-I<extra_module_path>] <scriptname.fx> [-- <script arg1> <script arg2> ...]
-app
(the flag is set by default) generate C code for the specified script as well as for the imported modules (one .c file per one .fx file), then run the compiler for each of the generated .c files and then link the produced object files into the finaal app. UseFICUS_CFLAGS
andFICUS_LINK_LIBRARIES
environment variables to pass extra options to C compiler, e.g.-ffast-math -mavx2
-lmimalloc
etc. The compiled app, as well as the intermediate.c
and.o
files, is stored in__build__/<scriptname>/<scriptname>
. Override the output name with-o
option.-run
builds the app (see flags-app
) and then runs it.
(see #4 for the decryption and the status)
The compiler was inspired by min-caml (http://esumii.github.io/min-caml/index-e.html) by Eijiro Sumii et al.