# Reference

> Look-up pages for the OSL language, its tools and its history: syntax, types, operators, built-ins, methods, the command line and more.

This is the Markdown version of https://osl-lang.org/reference. Every page of the OSL docs has one: add .md to its path. https://osl-lang.org/llms.txt lists them all.

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](/learn.md).

```osl
log "Hello, OSL".toUpper()
log [3, 1, 2].sort()
log {a: 1} ++ {b: 2}
log 2 ^ 8
```

Output:

```text
HELLO, OSL
[1,2,3]
{"a":1,"b":2}
256
```

## Language

- [Syntax](/reference/syntax.md): comments, literals, declarations, every statement and keyword, reserved words
- [Types](/reference/types.md): every type, generics, conversions, `typeof`, assignability
- [Operators](/reference/operators.md): every operator with precedence and associativity
- [Built-in functions](/reference/builtins.md): commands, global values and global functions
- [Strings](/reference/strings.md): every string method and property
- [Arrays](/reference/arrays.md): every array method and property
- [Objects](/reference/objects.md): every object and typed map method
- [Numbers](/reference/numbers.md): every int and number method, and the arithmetic rules

## Tools

- [Command line](/reference/cli.md): `osl run`, `compile`, `test`, `fmt`, `fix` and the rest
- [Opal](/reference/opal.md): projects, packages and `opal.json`
- [Testing](/reference/testing.md): test blocks and `osl test`
- [Editor support](/reference/editor.md): the language server and editor setup
- [Diagnostics](/reference/diagnostics.md): errors and warnings the compiler gives, and what they mean

## History

- [Legacy OSL](/reference/legacy.md): how the language changed, and what older code looks like
