KiCS2: Compiling Curry to Haskell

Description

KiCS2 is an implementation of the multi-paradigm declarative language Curry which 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, packages, and tools

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

In addition to these system libraries, the recent distribution contains also the Curry Package Manager CPM which supports the easy installation of further libraries and tools. There are more than 140 packages available (use the list or search command of CPM to browse through the current set of packages). Some of the tools, which can be installed via CPM, are described in the KiCS2 User Manual. Thus, if you install KiCS2, you have easy access to

Download and test

You can download the KiCS2 distribution here. Alternatively, you can also run your Curry program using Smap, a web-based interactive environment to execute Curry programs with KiCS2 (and other systems). Note that there is time limit for the execution of Curry programs and some predefined system functions (like reading/writing files) are not available due to security reasons.

Documentation

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 some aspects 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.
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.
Implementing Equational Constraints in a Functional Language
This paper describes the implementation of equational constraints and functional patterns in KiCS2.
Integration of Finite Domain Constraints in KiCS2
This paper describes an approach to implement finite domain constraints in KiCS2.

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