Carth

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

Table of Contents

Welcome to the homepage of the Carth programming language!

1WORK IN PROGRESS

Just as a little disclaimer: this project is in the very early stages of development, so there are no guarantees of stability etc.

2Why Carth?

3Documentation

4Development

All development on the Carth project happens openly on Github in bryal/carth. The source for this website is also on Github in bryal/carth-website.

5Example

Just to give you a quick taste. More examples can be found in the examples directory in the repository.

(import std)

(define main fizzbuzz)

(define (fizzbuzz Unit)
  (for (range 1 100)
       (<o display fizzbuzz')))

(define (fizzbuzz' n)
  (match (Pair (divisible? n 3) (divisible? n 5))
    (case (Pair False False) (my-show-int n))
    (case (Pair True False) "Fizz")
    (case (Pair False True) "Buzz")
    (case (Pair True True) "Fizzbuzz")))

(define my-show-int
  (fmatch
    (case 1 "one")
    (case 2 "two")
    (case n (show-int n))))

6Related work

7License

Both the Carth project and this website itself are licensed under the AGPL, version 3 or later. See LICENSE.

Note that by default, all programs written in Carth will have to be distributed under the AGPLv3 license as well, as not just the compiler itself, but also the standard library you include and the core library you link with are AGPLv3 licensed. Technically you could write your own standard library and core library with some non-copyleft license to avoid this, but I hope you won't! ;)

7.1Notice

Copyright (C) 2020 Johan Johansson

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.