KiCS2: Compiling Curry to Haskell


KiCS2 is a new implementation of the multi-paradigm declarative language Curry. KiCS2 compiles Curry programs into Haskell programs, i.e., it uses the Glasgow Haskell Compiler as its back end. Similarly to many other implementations of Curry, it also has an interactive environment (read/eval/print loop) to ease the development of Curry applications.

The benchmarks for KiCS2 shows that Curry programs without non-determinism are executed as fast as Haskell programs and the efficiency of non-deterministic programs can compete with or outperforms other existing implementations of Curry. The current implementation includes all the essential features of Curry like non-deterministic operations, logic variables and unification, encapsulated search, as well as advanced features like functional patterns and various search strategies. Furthermore, this implementation has been also used for non-trivial applications including web-based information systems like the module database for the curricula in computer science in Kiel.

Libraries and tools

The KICS2 distribution comes with a collection of libraries that are useful for application programming. A short description of these libraries can be found here.

The KICS2 distribution also contains various tools for Curry programs, like


In order to get some idea about the use of KiCS2 and its features, there is a short description of getting started with KiCS2. There is also a detailed manual (PDF) which describes the use of the system and the minor restrictions of KiCS2 compared to Curry. Since this document compares only KiCS2 to Curry, you may have a look at the Curry report which describes the full language.

The following papers describe the basics of the implementation of KiCS2.

KiCS2: A New Compiler from Curry to Haskell
This paper describes the basic ideas of the KiCS2 compiler and contains the results of various benchmarks of the first implementation of KiCS2.
Implementing Equational Constraints in a Functional Language
This paper describes the implementation of equational constraints and functional patterns in KiCS2.
Search Strategies for Functional Logic Programming
This paper describes the features of KiCS2 for encapsulated search and the implementation of various search strategies and compares their efficiency by some benchmarks.

This work has been supported in part by the DFG grant Ha 2457/5-1.