Reference
Look-up pages for the OSL language, its tools and its history: syntax, types, operators, built-ins, methods, the command line and more.
Pages for looking things up. Every entry has a short example you can edit and run. To learn the language in order, start with the course.
log "Hello, OSL".toUpper()
log [3, 1, 2].sort()
log {a: 1} ++ {b: 2}
log 2 ^ 8Click the code to edit it
Language#
Syntaxcomments, literals, declarations, every statement and keyword, reserved wordsTypesevery type, generics, conversions,
typeof, assignabilityOperatorsevery operator with precedence and associativityBuilt-in functionscommands, global values and global functionsStringsevery string method and propertyArraysevery array method and propertyObjectsevery object and typed map methodNumbersevery int and number method, and the arithmetic rulesTools#
Command line
osl run, compile, test, fmt, fix and the restOpalprojects, packages and opal.jsonTestingtest blocks and osl testEditor supportthe language server and editor setupDiagnosticserrors and warnings the compiler gives, and what they mean