ICurry is an intermediate format to compile Curry to different imperative languages. Its purpose is to be mostly generic so that different target languages can be supported with a similar effort.
The definition of ICurry is inspired by the Curry compiler Sprite which compiles Curry programs into LLVM code.
icurry package supports two kinds of intermediate formats:
ICurry.Typesfor detailed definitions)
ICurry.Extended.Typesfor detailed definitions)
The package also contains a translator from FlatCurry to ICurry programs (which have the suffix
.icy), a translator from ICurry to Extended ICurry programs (which have the suffix
.eicy), some goodies for dealing with (Extended) ICurry structures and auxiliary to quickly create a build system based on Ninja (see package
The translators are available in the
icurry binary installed with this package.
In contrast to other general compilers which can translate complete applications consisting of several modules, the
icurry compiler translates only single modules so that it should be used as a tool invoked by appropriate build tools (e.g.,
make). In particular, before compiling some module, all its imported modules have to be compiled so that their interfaces (data and function types) are already stored in ICurry type dependencies files (suffix
For instance, to compile the Prelude manually, one can change to the library directory containing the file
Prelude.curry and invoke the following commands:
Prelude.tfcy (the typed FlatCurry file of the Prelude):
pakcs-frontend -i "." --typed-flat Prelude
> kics2-frontend -i "." --typed-flat Prelude
Prelude.icy (the ICurry representation of the Prelude, which also generates the ICurry type dependency file
icurry f2i -I ".curry" .curry/Prelude.tfcy .curry/Prelude.icy
Prelude.eicy (the Extended ICurry representation of the Prelude):
icurry i2e -I ".curry" .curry/Prelude.icy .curry/Prelude.eicy
Now one can compile modules using the Prelude in the same way.