~jojo/Carth

A Scheme-looking, purely functional programming language

4e9b955 Update license preface in README

~jojo pushed to ~jojo/Carth git

19 days ago

771cb45 Change to dual license of Anti-Capitalist software license / AGPLv3+

~jojo pushed to ~jojo/Carth git

19 days ago

#The Carth programming language

Purely functional programming with lisp-syntax. Less infix, more parens!

Visit https://carth.pink/ 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 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 and uses the Stack build system, while the core-library is written in Rust. The external dependencies required are LLVM 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

# 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
./out

# 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

Preface

  • Copyright is a spook & capitalism is killing this planet.
  • The enforcability of the ACSL is questionable. Consider it more a deterrent against capitalist organizations.
  • The (A)GPL is a cool hack that vaguely approximates my ideals, but I have some problems with it, not least that it works "better" the more expansive the reach of the copyright system is. I include it as an alternative to be at least a little pragmatic ;)
  • What's important is the spirit of open source, not the letter of the license. Licences are not sufficient anyways.
  • If you're a fellow hacker and use this software to do good but fail to follow the licenses to the letter, I won't be mad so please rest without guilt! :D

Carth is dual licensed under the Anti-Capitalist Software License or the AGPL version 3 or later. See LICENSE-ACSL and LICENSE-AGPLv3 for the full license texts. For more information about the licenses, go to anticapitalist.software or gnu.org.