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