Skip to content

Latest commit

 

History

466 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSL

OSL is a compiled scripting language. The compiler reads .osl source, generates Go, and builds a native executable.

import "std:serve"

*serve.Router app = serve.New()

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

app.run(":8080")

Run a source file while working on it:

osl run main.osl

Build an executable when you want a binary:

osl compile main.osl -o app
./app

Read this first

Start with Install and run OSL. The rest of the guide follows the order in which the language becomes useful:

  1. Programs and variables
  2. Types
  3. Arrays and objects
  4. Control flow
  5. Functions
  6. Structs, enums, and classes
  7. Operators
  8. Errors and results
  9. Imports and project structure

The examples use the same style as the production code in originchats-osl: type-first declarations, narrow functions, directory imports, typed package handles, explicit assertions at dynamic boundaries, and parentheses around mixed arithmetic.

Find an API

Language-level functions and methods are listed in Built-ins and value methods. Imported APIs live in the standard-library package reference.

Compiler and project commands have separate references:

One rule worth learning now

OSL arrays and strings are 1-indexed. The first item is at index 1. This affects indexing, loops, slicing, and every example in this guide.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors