Documentation

Learn OSM.

The official home for learning the language, understanding the compiler, and finding your way around the syntax.

The project documentation is still growing. This page is the first polished structure; the language reference can be expanded as OSM evolves.

Getting started

OSM is transpiled to C. The current workflow uses Rebol for the transpiler and GCC to compile the generated C code.

./r3 boil.r3 myprogram.osm

Compiler pipeline

The current project describes the compilation pipeline as:

.osm sourceParserASTIRCGCC

Primitive types

OSM follows Meta for most types. The detailed reference can grow here as the implementation settles.

Functions

Functions can be user-defined:

add-these: func [
    a [WHOLE!]
    b [WHOLE!]
    /return [WHOLE!]
] [
    return a + b
]

write add-these 10 20

Control flow

The current language includes IF, EITHER, UNTIL, WHILE, LOOP and REPEAT.

What is OSM good for?

  • Small, dependency-free binaries
  • Interfacing with C libraries through FFI
  • Expressive Rebol-like syntax
  • Gradual learning for developers coming from dynamic languages
  • Building shared and static libraries with headers