Origin is a Python-backed programming language designed for developers and AI systems that need expressive, readable code without sacrificing hardware-level control. With mandatory type annotations, a natural English-like syntax, and built-in commands for Raspberry Pi GPIO and PCA9685 servo control, Origin bridges the gap between high-level readability and low-level hardware precision. Scripts use theDocumentation 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.
.or extension and run on any Python 3 environment — with full hardware features unlocked on Raspberry Pi.
Key features
Strict Typing
Every variable declaration requires a type annotation (
let x: int = 10). This enforces predictable state across your program and makes Origin naturally safe for AI-generated code.Hardware Control
Native, parenthesis-free commands for Raspberry Pi GPIO pins and PCA9685 servos. Servo angles are automatically clamped to 0–180° to prevent physical damage.
Python Interop
Drop into raw Python at any point using
py { } blocks. Origin compiles to Python under the hood, so any Python library is accessible without special wrappers.Parallel Execution
The
parallel block spawns threads automatically — either one per statement in the block, or a fixed number of worker threads via parallel(n).Module System
Import modules with aliases (
import math as m) or pull in specific names (from robotics import drive). Origin resolves .or library files and standard Python modules alike.Binary Builder
Compile any
.or script into a standalone, zero-dependency executable using origin build <file.or>. Powered by PyInstaller behind the scenes.How Origin works
When you runorigin <file.or>, your source code passes through a four-stage pipeline entirely implemented in Python:
-
Lexer (
lexer.py) — The source text is scanned line by line and converted into a flat list of typedTokenobjects. Whitespace and comments are discarded. All reserved keywords (let,const,for,parallel,set,py, and more) are identified at this stage. -
Parser (
parser.py) — A deterministic recursive-descent parser consumes the token list and builds an Abstract Syntax Tree (AST) made of typed node classes such asAssignNode,ForNode,SetNode, andParallelNode. -
Interpreter / Code Generator (
interpreter.py) — TheInterpreterclass walks the AST and emits equivalent Python source code as a string. Type annotations are checked at this stage; mismatches raise aTypeErrorbefore any code runs. -
Execution — The generated Python string is handed to Python’s built-in
exec()with a controlled globals dict that pre-loadsmath,random, and the hardware runtime helpers (_execute_set_pin,_execute_i2c_read,_execute_i2c_write).
origin build command follows the same pipeline but saves the generated Python to disk and feeds it to PyInstaller to produce a standalone binary.
A first look at Origin syntax
The example below shows typed variable declarations, a list, afor loop, and print — the building blocks you will use in almost every Origin script.
v1.7.5 is the current stable release of Origin. All syntax and behaviour documented on this site refers to this version.