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

3
4
5
6
7
8
9
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](https://git.ps.informatik.uni-kiel.de/curry/pakcs) and
Fredrik Wieczerkowski's avatar
Fredrik Wieczerkowski committed
10
[KiCS2](https://git.ps.informatik.uni-kiel.de/curry/kics2).
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
11

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

Fredrik Wieczerkowski's avatar
Fredrik Wieczerkowski committed
14
* Make sure that a recent version of Haskell Stack is installed on your computer
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
15

16
## Building
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
17

Fredrik Wieczerkowski's avatar
Fredrik Wieczerkowski committed
18
19
* To build the project, run `make`.
* To test the project, run `make runtests`.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
20

Fredrik Wieczerkowski's avatar
Fredrik Wieczerkowski committed
21
The built executable will be located at `bin/curry-frontend`.
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
22

23
## Usage
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
24

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

27
`curry-frontend --help`
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
28

29
### Available Formats
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
30

31
```
32
33
34
35
--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
36
```
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
37

38
39
40
41
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
42

43
44
45
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
46

47
## Remarks
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
48

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

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

56
57
58
59
60
61
- 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
62

63
## Known Issues
Bjoern Peemoeller's avatar
Bjoern Peemoeller committed
64

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