> For the complete documentation index, see [llms.txt](https://osl.mistium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://osl.mistium.com/introduction/readme.md).

# What is OSL?

**OSL** is a small, fast, compiled programming language. You write `.osl` source files in a clean, readable syntax and the OSL compiler turns them into a **single self-contained native binary** - no interpreter, no dependencies to ship.

```javascript
import "osl/serve"

string port = "8080"
*serve.Router app = serve.new()

app.GET("/", def(*serve.Context c) -> (
  c.string(200, "Hello from OSL!")
))

log "Listening on http://localhost:" ++ port
app.serve(":" ++ port)
```

Compile it and run the binary:

```bash
osl compile server.osl   # produces ./server
./server
```

## What is it good for?

OSL is designed for writing **servers, command-line tools, scripts, and small applications** quickly, with a batteries-included standard library. Out of the box you get HTTP servers and clients, WebSockets, an embedded SQL database, JSON/YAML/CSV/XML, cryptography, file-system and process utilities, a terminal-UI toolkit, image/PDF/QR generation, and much more - all documented in the [Packages](/packages/packages.md) section.

Because programs compile to a native binary, they start instantly and run fast, while the language itself stays approachable and dynamic-feeling.

## Key ideas

* **Readable, command-style syntax.** Code reads top-to-bottom. There is no `main()` to write - the file *is* the program (see [The Execution Model](/introduction/getting-started.md#the-execution-model)).
* **Optional types.** Variables and function parameters can be untyped (`x = 5`) or typed (`int x = 5`). Types are checked at compile time when you use them.
* **A rich standard library.** Capabilities are grouped into [packages](/packages/packages.md) you pull in with `import "osl/<name>"`.
* **Methods and functions everywhere.** Values have methods (`"hi".toUpper()`, `[1,2,3].map(...)`), and there is a large set of built-in [functions](/builtins/math.md).

## Where to go next

| If you want to…                          | Read                                                                                                                                                                  |
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Install OSL and write your first program | [Getting Started](/introduction/getting-started.md)                                                                                                                   |
| Learn the language                       | [Types](/the-language/types.md) · [Syntax](/the-language/syntax.md) · [Functions](/functions-and-classes/functions.md) · [Classes](/functions-and-classes/classes.md) |
| Browse the standard library              | [Packages](/packages/packages.md)                                                                                                                                     |
| Build a web server                       | [`osl/serve`](/packages/web/serve.md)                                                                                                                                 |
| See the old originOS graphical OSL       | [Legacy OSL](/legacy-osl-originos/legacy-osl.md)                                                                                                                      |

***

> **A note on history.** OSL began as the scripting language of **originOS**, a graphical desktop environment, where every program was a window. This documentation covers **OSL.go**, the modern compiler that brings the same syntax to standalone native programs. Most language features carry over; the windowing/graphics features now live in the [`osl/window`](/graphics-osl-window/window.md) package, and originOS-only features are preserved for reference under [Legacy OSL](/legacy-osl-originos/legacy-osl.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://osl.mistium.com/introduction/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
