For the complete documentation index, see llms.txt. This page is also available as Markdown.

Install and run OSL

OSL uses Go to build native executables. Install a current Go toolchain on the machine where you compile. The executable produced by OSL does not need Go.

Install the compiler

curl -fsSL https://gosl.mistium.com | sh

Check the installed commands:

osl version
opal version

To build from source:

git clone https://git.rotur.dev/osl/.go osl
cd osl
go build -o osl .
./osl setup

Write a program

Create hello.osl:

string name = "world"
log "Hello, " ++ name

Run it:

osl run hello.osl

log prints a value followed by a newline. ++ converts both operands to text and joins them.

Build a binary

Use -o to choose the output path:

Format source

OSL uses two-space indentation. Let the formatter handle it:

The directory form formats every .osl file below that directory.

Import a package

Packages shipped with the compiler use std:<name>. Continue with Programs and variables, or open the package index when you need a library API.

Last updated