README.md 2.2 KB
Newer Older
1
# Curry Frontend
2

3 4
The Curry frontend parses source files (`.curry`), emits errors and
warnings, performs various checks and transformations and 
5
generates FlatCurry (`.fcy`, `.fint`) or AbstractCurry (`.acy`, `.uacy`),
Fredrik Wieczerkowski's avatar
Fredrik Wieczerkowski committed
6
amonst other formats.
7

Fredrik Wieczerkowski's avatar
Fredrik Wieczerkowski committed
8 9 10 11
The project originated from a modified version of the Münster-Curry-Compiler
(MCC) for use with [PAKCS](https://git.ps.informatik.uni-kiel.de/curry/pakcs),
but can also be used with a variety of other backends, most notably including
[KiCS2](https://git.ps.informatik.uni-kiel.de/curry/kics2).
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
12

13
## Requirements
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
14

15 16
* `cabal-install`
* A recent version of the `curry-base` package, installed locally
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
17

18
## Building
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
19

20
To build the project, run `cabal v1-build`.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
21

22
## Running
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
23

24
To run the project, use `cabal v1-run`.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
25

26
Alternatively, you can launch the built executable manually from `dist/build/curry-frontend`.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
27

28
## Usage
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
29

30
For a detailed overview of the available options, you can use the following command:
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
31

32
`curry-frontend --help`
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
33

34
### Available Formats
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
35

36
```
37 38 39 40
--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
41
```
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
42

43 44 45 46
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`.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
47

48 49 50
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).
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
51

52
## Remarks
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
53

54 55 56
- To use the PAKCS libraries (especially for the `Prelude`), the environment
  variable `PAKCS_LIB` has to point to the correct paths, e.g. using
  
57
  `export PAKCS_LIB=[pakcs path]/pacs/lib:[pakcs path]/pacs/lib/meta:...`
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
58

59
  where `[pakcs path]` is the directory containing the PAKCS distribution.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
60

61 62 63 64 65 66
- In contrast to PAKCS, the frontend allow use of anonymous variables
  (denoted by an underscore `_`) in type declarations, e.g.
  
  ```curry
  data T _ = c
  ```
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
67

68
## Known Issues
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
69

70
[See GitLab](https://git.ps.informatik.uni-kiel.de/curry/curry-frontend/-/issues)