MyNixOS website logo
Description

Compile the functional logic language Curry to several intermediate formats.

The Curry front end consists of the executable program "curry-frontend". It is used by various backends to compile Curry programs to an intermediate representation. The code is a stripped-down version of an early version of the Muenster Curry Compiler (http://danae.uni-muenster.de/curry/) which has been extended to produce different intermediate representations. For further information, please check http://curry-language.org

Curry Frontend

The frontend lexes, parses, type-checks and transforms Curry source files into a variety of intermediate formats, including

  • FlatCurry for program analyzers and backends
  • AbstractCurry for program manipulation tools
  • HTML for documentation

It is used by the two major Curry compilers, PAKCS and KiCS2.

Requirements

  • Make sure that a recent version of Haskell Stack is installed on your computer

Building

  • To build the project, run make.
  • To test the project, run make runtests.

The built executable will be located at bin/curry-frontend.

Usage

For a detailed overview of the available options, you can use the following command:

curry-frontend --help

Available Formats

--flat  : Generate a FlatCurry (.fcy) and FlatInterface (.fint) file
--xml   : Generate a FlatXML (_flat.xml) file
--acy   : Generate a (type-inferred) AbstractCurry (.acy) file
--uacy  : Generate an untyped AbstractCurry (.uacy) file

The generation of an untyped AbstractCurry program is performed without type checking (i.e. programs with type checks will compile). All functions will either have the type signature specified in the source or, if not available, the dummy type prelude.untyped.

FlatCurry files will always be generated for the imported modules, since the interfaces are required for static-semantic analysis and type inference (only for typed AbstractCurry).

Remarks

  • To use the PAKCS libraries (especially for the Prelude), the environment variable PAKCS_LIB has to point to the correct paths, e.g. using

    export PAKCS_LIB=[pakcs path]/pacs/lib:[pakcs path]/pacs/lib/meta:...

    where [pakcs path] is the directory containing the PAKCS distribution.

  • In contrast to PAKCS, the frontend allow use of anonymous variables (denoted by an underscore _) in type declarations, e.g.

    data T _ = c
    

Known Issues

See GitLab.

Metadata

Version

2.0.0

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows