OPL is a lightweight programming language with a readable pirate-flavored syntax and a real runtime behind it. It includes an AST interpreter, a stack-based bytecode VM, compiled .oplb files, closures, models, collections, modules, a standard library, CLI tooling, a debugger, LSP support, and a VSCode extension.
OPL source files use the .opl extension.
- Pirate syntax frontend with clean core OPL underneath
- AST interpreter for reference execution
- Stack-based VM with compiled bytecode support
.oplbbuild and inspect workflow- First-class functions and lexical closures
- Models, methods, properties, and
captainbinding - Lists, maps, indexing, for-in loops, and collection built-ins
- Modules/imports and first-party standard library
- CLI, REPL, formatter, diagnostics, and debugger
- LSP-powered VSCode support with hover, definitions, symbols, completions, diagnostics, and DAP debugging
Install OPL:
pip install oplangCreate hello.opl:
bounty x = 5
say x + 1
Run it:
opl run hello.oplExpected output:
6
opl --version
opl run file.opl
opl check file.opl
opl format file.opl
opl replRun on the VM:
opl run file.opl --vmBuild bytecode:
opl build file.opl
opl run file.oplb --vm
opl inspect file.oplbLaunch the VM debugger:
opl debug file.oplUseful debugger commands:
step
continue
stack
locals
inspect name
quit
The VSCode extension lives in vscode-opl/.
It provides:
.oplfile association- Syntax highlighting
- Snippets
- Language configuration
- LSP diagnostics, hover, definitions, document symbols, workspace symbols, and completions
- DAP debugger integration
For local extension development:
cd vscode-opl
npm installThen open the extension folder in VSCode and run the extension host.
Marketplace packaging:
npm install -g @vscode/vsce
vsce packagePublishing:
vsce publishdocs/quickstart.mddocs/language-basics.mddocs/standard-library.mddocs/examples.md
The public website and documentation live in docs/ for GitHub Pages.
The landing page is:
docs/index.html
The static playground is Pages-compatible. It lets users edit and copy OPL examples, then run them locally with:
python -m pip install oplang
opl run app.oplTo publish the website from this repository:
- Open the GitHub repository settings.
- Go to
Pages. - Set the source to
Deploy from a branch. - Select the default branch.
- Set the folder to
/docs. - Save and wait for GitHub Pages to publish.
All website assets use relative paths so the site can be served from a repository Pages URL.
Build distributions:
python -m buildThis creates:
dist/oplang-*.whl
dist/oplang-*.tar.gz
Publish manually with Twine:
python -m twine upload dist/*Do not publish until the release artifacts have been inspected and tested.