Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/boblio-max/origin/llms.txt

Use this file to discover all available pages before exploring further.

Origin scripts are plain text files with the .or extension. If you can write a sentence, you can read Origin code — and if you know Python, you will feel at home immediately. This guide walks you through writing, running, and building your first Origin program from scratch.
1

Install Origin

Follow the Installation guide to set up Origin on your machine. Once installed, confirm everything is working by running:
origin
You should see Origin Programming Language v1.7.5 printed to your terminal.
2

Create your first script

Create a new file called hello.or and open it in any text editor. Add the following code:
# hello.or — my first Origin script

# Typed variable declarations
let name: str   = "Origin"
let version: float = 1.7
const max_items: int = 3

# Print a greeting
print "Hello from " + name + "!"

# A list and a for loop
let languages: list = ["Origin", "Python", "C"]

for lang in languages {
    print lang
}

# A function definition
def greet(person) {
    let msg: str = "Welcome, " + person
    print msg
}

# Call the function
greet("developer")
greet("Raspberry Pi")
Every variable must carry a type annotation (let name: str = ...). Constants use const and cannot be reassigned. Blocks are delimited with { }.
3

Run the script

In your terminal, navigate to the folder containing hello.or and run:
origin hello.or
You will see output like:
Hello from Origin!
Origin
Python
C
Welcome, developer
Welcome, Raspberry Pi
Origin processes your file through the lexer → parser → code generator → exec() pipeline automatically. No compilation step is needed for normal execution.
If you installed from source rather than the standalone installer, replace origin hello.or with python runner.py hello.or. The standalone installer adds the origin command to your PATH; source installs require invoking runner.py directly.
4

Build a standalone binary

To distribute your script as a self-contained executable, use the build command:
origin build hello.or
Origin transpiles hello.or to Python, then hands the result to PyInstaller. When the build finishes you will find hello.exe (Windows) or hello (Linux/macOS) in the same directory as your source file — ready to run on any machine without a Python installation.
pyinstaller must be installed (pip install pyinstaller) for the build command to work. It is included in requirements.txt when running from source.

Complete example script

The script below brings together every concept from the steps above into a single, runnable file you can copy directly into your editor.
# complete_example.or
# Demonstrates: let/const, print, for loop, list, function def, and function call

# --- Constants and Variables ---
const app_name: str = "MyApp"
let revision: int   = 5
let ready: bool     = true

# --- Print startup info ---
print "Starting " + app_name
print "Revision: " + str(revision)

# --- Iterate over a list ---
let steps: list = ["init", "configure", "run", "cleanup"]

for step in steps {
    print "Step: " + step
}

# --- Function definition ---
def describe_step(label) {
    let out: str = "[*] Running: " + label
    print out
}

# --- Call the function ---
describe_step("init")
describe_step("run")

# --- Conditional logic ---
if ready == true {
    print "System is ready."
} else {
    print "System not ready."
}
Running origin complete_example.or produces:
Starting MyApp
Revision: 5
Step: init
Step: configure
Step: run
Step: cleanup
[*] Running: init
[*] Running: run
System is ready.

Next steps

Variables & Types

Deep-dive into let, const, type annotations, lists, dicts, and tuples.

Hardware Overview

Control GPIO pins and servos with native Origin hardware commands.

Parallel Execution

Spawn concurrent threads using the parallel block for real-time control.

Build docs developers (and LLMs) love