Skip to main content

In development

A fast, readable programming language.

Sarlin aims to combine explicit, readable syntax with native compiled performance. It is a general-purpose language, and it is still being built.

hello.sar
func main() {
    print("Hello, world!")
}

Language direction

Readable by design

Sarlin favours explicit and understandable syntax.

Native compilation

Sarlin is intended to compile to native code and target high performance.

Explicit typing

Types are explicitly declared rather than relying heavily on inference.

Composition over inheritance

Sarlin uses reusable define components which classes can compose rather than relying on traditional class inheritance.

Composition, not inheritance

A define is a reusable component holding fields and functions. A class composes the defines it needs instead of inheriting from a parent class. Defines may themselves compose other defines.

A composed define is namespaced on the class instance under a lowercase name, so its fields and functions stay grouped and obvious at the call site.

usage
local var player Player = Player.new()

player.health.heal(20)
print(player.health.current)
Read about defines
player.sar
define Health {
    var current int32 = 100
    var maximum int32 = 100

    func heal(amount int32) {
        current = current + amount

        if current > maximum {
            current = maximum
        }
    }
}

class Player [
    Health {
        current = 100
        maximum = 100
    }
] {
}

Start learning Sarlin

Read a first program, then follow the language reference as it is written.

Get started