Korrin

A small, deliberate programming language.

Blocks are indentation. Statements end at the newline. The reserved words fit on one line, and for anything you want to do there is one obvious way to write it.

Korrin is dynamically typed. It has string interpolation, exceptions, and a module system with a small standard library. It runs real programs today.

words.kor
words = "the quick brown fox".split(" ")

for word in words:
    print("{word} has {word.len()} letters")
$ korrin run words.kor
the has 3 letters
quick has 5 letters
brown has 5 letters
fox has 3 letters

Read the guide or the specification

Indentation is the block

No braces, no end. The structure you see is the structure that runs.

A newline ends a statement

No semicolons. Two statements never share a line.

Twenty-five keywords

The whole reserved vocabulary:

and as break class continue elif else except false finally fn for if import in nil not or pass raise return super true try while

Dynamically typed

No annotations. Values carry their type; you carry the intent.

One way to write it

When two features would do the same job, Korrin keeps one and leaves the other out.

A short program that uses a class, the math module, and string interpolation. It reads close to how you would describe it out loud.

circle.kor
import "math"

class Circle:
    fn init(self, r):
        self.r = r

    fn area(self):
        return math.pi * self.r * self.r

for r in [1, 2, 3]:
    c = Circle(r)
    print("radius {r}: area {math.round(c.area())}")
$ korrin run circle.kor
radius 1: area 3
radius 2: area 13
radius 3: area 28

Everything about the language is written down.

Korrin is not packaged for install yet. Build it from source with a recent stable Rust toolchain.