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 | shCheck the installed commands:
osl version
opal versionTo build from source:
git clone https://git.rotur.dev/osl/.go osl
cd osl
go build -o osl .
./osl setupWrite a program
Create hello.osl:
string name = "world"
log "Hello, " ++ nameRun it:
osl run hello.osllog 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