Orhun is an actively developed, Turkish-first programming language runtime. It is a stable 1.0 language contract with a working lexer, parser, interpreter, bytecode compiler, VM execution path, standard-library modules, package verification flows, and editor tooling.
The long-term goal is clear: Orhun starts with a C++ bootstrap core, then moves toward self-hosting so more of the compiler and tooling can be written in Orhun itself.
Repository: https://github.com/orhunlang/orhun
Orhun is under active development.
- Current version:
1.1.0 - Stability: 1.0 stable language contract
- Primary implementation language: C++17
- Source extension:
.oh - Default language identity: Turkish-first
- Long-term direction: self-hosting compiler and independent toolchain
Do not treat Orhun as production-stable yet. The project is currently focused on language semantics, VM parity, reliability, developer experience, and the path toward self-hosting.
For a more concrete progress snapshot and the current estimate toward 1.0 /
2.1.0, see docs/PROJECT_STATUS.md.
Stability contracts: docs/COMPATIBILITY_POLICY.md,
docs/KNOWN_ISSUES.md,
docs/RELEASE_NOTES_1.1.0.md.
Quick reference: docs/CHEATSHEET.md.
- Turkish-first syntax and diagnostics
- UTF-8 identifiers and Turkish keywords
- Interpreter and VM execution paths
- Bytecode compiler and strict VM mode
- Functions, default arguments, lambdas, lists, dictionaries, classes, and inheritance
- Beginner-friendly loops including
tekrarla,sürece, andher ... içinde - Error handling with
deneme/yakala - Safe access with
?. - Async/task primitives and
paralel yap - Standard modules for files, JSON, regex, date/time, simple database helpers, server helpers, FFI, and system policy controls
- Orhun-source helper modules for language tooling, including token cursors, diagnostics, and AST records/traversal helpers for small compilers and DSLs
- Package install and lock verification flows
- Formatter, linter, LSP, and VS Code language tooling
- Cross-platform CI for Windows, Linux, and macOS
yaz "Merhaba Orhun"
tip Selamlayici:
işlev selam(ad olsun "dünya"):
döndür "Merhaba, " + ad
s olsun yeni Selamlayici()
yazdır s.selam()
yazdır s.selam("Orhun")
Expected output:
Merhaba Orhun
Merhaba, dünya
Merhaba, Orhun
One-line installers (download v1.1.0 binaries from GitHub Releases):
# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/orhunlang/orhun/v1.1.0/install.sh | bash# Windows (PowerShell)
irm https://raw.githubusercontent.com/orhunlang/orhun/v1.1.0/install.ps1 | iexThe installed toolchain version is controlled by ORHUN_VERSION (default 1.1.0).
GitHub Actions:
- uses: orhunlang/orhun/[email protected]
with:
version: "1.1.0"VS Code extension: tools/vscode-orhun (npm run package → .vsix).
Requirements:
- C++17 compiler (
g++orclang++) - PowerShell on Windows for the default test script
- Python 3 for smoke, benchmark, and tooling tests
Windows:
g++ -std=c++17 -O2 -DNDEBUG -Wall -Wextra main.cpp Lexer.cpp Parser.cpp Interpreter.cpp Chunk.cpp Compiler.cpp VM.cpp -o orhun.exeLinux/macOS:
g++ -std=c++17 -O2 -DNDEBUG -Wall -Wextra main.cpp Lexer.cpp Parser.cpp Interpreter.cpp Chunk.cpp Compiler.cpp VM.cpp -o orhunThese commands produce the optimized runtime configuration used by release assets. The test runners keep an unoptimized development build by default so compiler warnings and diagnostics remain straightforward.
For a step-by-step Turkish beginner guide, see
docs/BEGINNER_GUIDE.md.
Run a source file:
orhun examples/merhaba.ohRead one line of input:
ad olsun oku("Adın? ")
yaz "Merhaba, " + ad
Create a simple range:
yaz aralik(5)
yaz aralık(5, 1, -2)
yaz ilk([3, 4])
yaz son([3, 4])
Loop over a list:
meyveler olsun ["elma", "armut", "kiraz"]
her meyve içinde meyveler:
yaz meyve
Strict VM mode:
orhun vm-kati dosya.ohInterpreter-only mode for runtime diagnostics:
orhun yorumla dosya.ohProject health summary:
orhun doctor
orhun doctor --jsonUseful commands:
orhun fmt dosya.oh
orhun lint dosya.oh
orhun lex dosya.oh --json
orhun parse dosya.oh --json
orhun orhun-lex dosya.oh
orhun orhun-parse dosya.oh
orhun baytkod dosya.oh --json
orhun baytkod-yurut derlenmis.bytecode.json
orhun obc-dogrula derlenmis.obc
orhun paketli-dogrula derlenmis.exe
orhun orhun-vm dosya.oh
orhun orhun-vm dosya.oh --obc-only
orhun orhun-derle dosya.oh cikti
orhun orhun-derle dosya.oh cikti --obc-only
orhun bootstrap-hazirla build/bootstrap
orhun bootstrap-dogrula build/bootstrap
orhun bootstrap-yeniden-uret build/bootstrap build/yeniden-uretilen
orhun bootstrap-yeniden-dogrula build/yeniden-uretilen
orhun bootstrap-derleyici-paketle build/bootstrap build/derleyici-paketi
orhun bootstrap-derleyici-dogrula build/derleyici-paketi
orhun bootstrap-derle build/bootstrap dosya.oh cikti
orhun bootstrap-calistir build/bootstrap dosya.oh
orhun hiz dosya.oh --json
orhun lsp --stdio
orhun paket dogrula
orhun paket kaldir paket_adiPortable compiler bundles can emit JSON or complete artifacts:
build/derleyici-paketi/orhun-derleyici.exe dosya.oh
build/derleyici-paketi/orhun-derleyici.exe --derle dosya.oh ciktiFor complete artifacts, the Orhun-written compiler CLI owns the output plan,
including .obc, packaged executable, metadata paths, and metadata source
name. Every compiler invocation uses the versioned orhun-compiler-cli-v1
result envelope and a pure-Orhun validation record; artifact mode embeds the
orhun-artifact-plan-v1 plan. The C++ bootstrap host strictly validates both
contracts, stages every artifact beside its destination, and publishes the
complete set only after all writes succeed.
Version tags must exactly match VERSION, for example v0.8.0. Pushing a
matching tag runs the full release gate on Windows, Linux, and macOS, rebuilds
and tests an -O2 -DNDEBUG runtime, rebuilds the source-free compiler toolchain,
and publishes deterministic compiler and runtime archives with SHA-256
verification files. Runtime archives include the orhun executable and sibling
source StdLib, so they can run standard-library programs outside the source
repository.
Release assets are published on GitHub Releases. Every asset gets a signed GitHub/Sigstore build-provenance attestation and SHA-256 verification data. Archives are not platform code-signed yet.
Verify a downloaded asset with GitHub CLI:
gh attestation verify orhun-compiler-0.8.0-linux-x64.tar.gz --repo orhunlang/orhunInstall a downloaded portable compiler archive after downloading its matching
.sha256 sidecar and install_release.py release asset:
python install_release.py orhun-compiler-0.8.0-linux-x64.tar.gz
orhun-derleyici program.ohThe same verified installer installs runtime archives and creates the orhun
command:
python install_release.py orhun-runtime-0.8.0-linux-x64.tar.gz
orhun program.ohThe installer requires a valid SHA-256 sidecar, rejects unsafe archive entries,
and refuses cross-platform archives unless explicitly allowed. Use
--install-root, --bin-dir, --no-shim, or --force to control the
installation. The repository's tools/install_compiler.py remains as a
compiler-only compatibility entry point.
Program arguments are available as sistem.argumanlar:
orhun dosya.oh ilk "iki kelime"Windows:
powershell -ExecutionPolicy Bypass -File tests\run_tests.ps1 -Compiler g++ -Output build/orhun_test.exeLinux/macOS:
bash tests/run_tests.sh g++ build/orhun_testTo build and run the same optimized configuration used for releases:
.\tests\run_tests.ps1 -Output build/orhun_release.exe -BuildMode releasebash tests/run_tests.sh g++ build/orhun_release releaseThe test runner applies per-case timeouts so one broken fixture cannot hang the whole suite.
To measure the C++ interpreter against every guarded runtime output:
py -3 tests\interpreter_parity_sweep.py .\build\orhun_test.exeThe sweep requires every guarded output to match the VM/runtime contract within its fast budget. A larger timeout remains available for diagnosis on unusually slow development machines:
py -3 tests\interpreter_parity_sweep.py .\build\orhun_test.exe --timeout 30Near-term priorities:
- Keep the VM path reliable and strict-mode compatible.
- Stabilize language semantics before adding large new syntax.
- Improve documentation and first-run developer experience.
- Move safe parts of the standard library into Orhun source.
- Grow Orhun-source language tooling so Orhun can be used to prototype other languages and DSLs.
- Build toward an Orhun-written lexer, parser, and compiler.
See docs/SELF_HOSTING_ROADMAP.md for the self-hosting plan.
- Core runtime and CLI:
main.cpp,VM.cpp,Interpreter.cpp - Lexer/parser/AST:
Lexer.cpp,Parser.cpp,AST.h - Bytecode compiler:
Compiler.cpp - Standard library helpers:
Yerlesik.h,StdLib/,StdLib/orhun/(temel.oh,sonuc.oh,koleksiyon.oh,sozluk.oh,metin.oh,paket.oh,dil.oh,lexer.oh,parser.oh,derleyici.oh) - Examples:
examples/ - Small language example:
examples/mini_dil.oh(tokenizer, parser, AST, recovery, and execution written in Orhun) - Tests and fixtures:
tests/ - Lexer parity fixtures:
tests/lexer_parity/ - Parser AST JSON fixtures:
tests/ast_json/ - Bytecode JSON contract smoke:
tests/bytecode_json_smoke.py - Compiler prototype parity smoke:
tests/compiler_prototype_smoke.py - Compiler bootstrap execution smoke:
tests/compiler_bootstrap_smoke.py - Roadmap smoke aggregate:
tests/roadmap_smoke.py - Parser prototype parity smoke:
tests/parser_prototype_smoke.py - Closure capture analysis smoke:
tests/closure_capture_analysis_smoke.py - Lambda capture analysis smoke:
tests/lambda_capture_analysis_smoke.py - Interpreter closure smoke:
tests/interpreter_closure_smoke.py - Full interpreter/runtime parity sweep:
tests/interpreter_parity_sweep.py - VM closure extra smoke:
tests/vm_closure_extra_smoke.py - LSP smoke:
tests/lsp_smoke.py - Cross-platform workspace/file-URI LSP smoke:
tests/lsp_workspace_smoke.py - VS Code tooling smoke:
tests/vscode_syntax_smoke.py - VS Code tooling:
tools/vscode-orhun - Deterministic release packager:
tools/release_package.py - Migration notes:
docs/MIGRATION_GUIDE.md - Beginner guide:
docs/BEGINNER_GUIDE.md - Language specification:
docs/SPEC.md - Closure/capture plan:
docs/CLOSURE_CAPTURE_PLAN.md - Versioning policy:
docs/VERSIONING.md - Release channels:
docs/RELEASE_CHANNELS.md - Security policy:
SECURITY.md
Contributions are welcome, especially around tests, documentation, examples, language semantics, VM parity, and tooling. Because Orhun is pre-1.0, please keep changes small, tested, and aligned with the Turkish-first identity of the language. See CONTRIBUTING.md and docs/OPEN_SOURCE_POLICY.md for what belongs in the public repository.
Before opening a pull request:
bash tests/run_tests.sh g++ build/orhun_testOn Windows:
powershell -ExecutionPolicy Bypass -File tests\run_tests.ps1 -Compiler g++ -Output build/orhun_test.exePlease report security issues privately first:
See SECURITY.md for details.
Orhun is released under the MIT License. See LICENSE.