Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bryal/carth

The Carth programming language. Mirror of https://sr.ht/~jojo/Carth/
https://github.com/bryal/carth

carth compiler lang language

Last synced: about 3 hours ago
JSON representation

The Carth programming language. Mirror of https://sr.ht/~jojo/Carth/

Awesome Lists containing this project

README

        

The Carth programming language
==============================

Visit for an overview of the language and more info.

WORK IN PROGRESS
------------------

Just as a little disclaimer: this project is still in alpha
development, so there are no guarantees of stability etc.

Features
--------

- Scheme-inspired syntax and feel
- Static, Hindley-Milner typechecking à la ML
- Currying
- Closures
- Algebraic datatypes
- LLVM backend

Roadmap
-------

This is a high-level overview of what is planned for the language, and
some of the points are just tentative. See [TODO.org](./TODO.org) for
more extensive list of planned features and more detailed descriptions.

- Typeclasses
- Type families
- Higher kinded types
- Effect system
- Linear types

Building Carth
--------------

The compiler is written in [Haskell](https://haskell.org) and uses the
[Stack](https://www.haskellstack.org/) build system, while the
core-library is written in [Rust](https://rust-lang.org). The external
dependencies required are [LLVM](https://llvm.org/) version 9.

To build the project and install the `carth` binary, the core library,
and the standard library, simply run `make install`, which defaults to
installing the binary in `~/.local/bin`, the core library in
`~/.local/lib`, and the modules of the Carth standard library in
`~/.carth/mod`.

Building with Carth
-------------------

At compiler runtime, the dependencies are `libsigsegv`, `libdl`,
`libpthread`, `libm`, and `libgc`, which are linked into the executables
produced by Carth.

Carth must further be able to find the core library and standard library
modules, so you must have added the directory of the installed core
library (default `~/.local/lib`) to your `LIBRARY_PATH` environment
variable, the directory of the installed standard library (default
`~/.carth/mod`) to your `CARTH_MODULE_PATH` environment variable.

Running
-------

```bash
# General help
carth help
carth -h
carth --help

# Help for a specific subcommand
carth help c

# Compile and run a program with default output filename
carth c examples/fizzbuzz.carth
./examples/fizzbuzz.bin

# Run with the JIT compiler
carth run examples/fizzbuzz.carth

# Compile a program with a specific output filename
carth c -o examples/fizzbuzz examples/fizzbuzz.carth
./examples/fizzbuzz
```

License
-------

Carth is dual licensed under the Anti-Capitalist Software License or
the AGPL version 3 or later. See [LICENSE-ACSL](./LICENSE-ACSL) and
[LICENSE-AGPLv3](./LICENSE-AGPLv3) for the full license texts. For
more information about the licenses, go to
[anticapitalist.software](https://anticapitalist.software) or
[gnu.org](https://www.gnu.org/licenses/agpl-3.0.en.html).