Skip to content

Repository files navigation

Scarlet programming language

A statically typed, expression-oriented programming language. It is not finished, and the syntax and standard library still change between releases.

Documentation


import scarlet/array

type Shape {
	Circle(r Float)
	Rect(w Float, h Float)
}

fn area(s Shape) Float {
	match s {
		Circle(r) -> 3.14159 * r * r
		Rect(w, h) -> w * h
	}
}

pub fn main() {
	shapes = [Circle(r: 2.0), Rect(w: 3.0, h: 4.0), Circle(r: 1.0)]
	println('total area: ${array.fold(shapes, 0.0, fn(acc, s) acc + area(s))}')
}
curl -fsSL scarlet.industries/install.sh | bash
scarlet run <file.scrl>         Run a program
scarlet repl                    Start an interactive REPL
scarlet check <file.scrl>       Type-check without running
scarlet fmt [path]              Format source files

About

A productive programming language

Resources

Stars

38 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages