{"id":43279818,"url":"https://github.com/upstat-io/ori-lang","last_synced_at":"2026-04-13T06:21:04.656Z","repository":{"id":333764143,"uuid":"1138605930","full_name":"upstat-io/ori-lang","owner":"upstat-io","description":"A statically-typed, expression-based language with declarative patterns, mandatory testing, and explicit effects.","archived":false,"fork":false,"pushed_at":"2026-03-30T13:25:46.000Z","size":35553,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-30T13:29:55.764Z","etag":null,"topics":["compiler","effect-system","functional-programming","pattern-matching","programming-language","rust","static-typing","testing","type-inference"],"latest_commit_sha":null,"homepage":"https://ori-lang.com/","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upstat-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["upstat-io"]}},"created_at":"2026-01-20T22:17:30.000Z","updated_at":"2026-03-30T01:03:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/upstat-io/ori-lang","commit_stats":null,"previous_names":["upstat-io/sigil-lang","upstat-io/ori-lang"],"tags_count":57,"template":false,"template_full_name":null,"purl":"pkg:github/upstat-io/ori-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upstat-io%2Fori-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upstat-io%2Fori-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upstat-io%2Fori-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upstat-io%2Fori-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upstat-io","download_url":"https://codeload.github.com/upstat-io/ori-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upstat-io%2Fori-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31308446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","effect-system","functional-programming","pattern-matching","programming-language","rust","static-typing","testing","type-inference"],"created_at":"2026-02-01T17:03:40.084Z","updated_at":"2026-04-02T14:49:00.369Z","avatar_url":"https://github.com/upstat-io.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\n# Ori\n\n**Functional Code. Imperative Speed. Native Binaries.**\n\nOri compiles to standalone native executables on Windows, Linux, and macOS. No garbage collector. No borrow checker. No runtime or VM required. Ship a single binary — your users don't need Ori installed.\n\nA statically-typed, expression-based language with value semantics, explicit effects, and smart testing.\n\n[Website](https://ori-lang.com) | [Playground](https://ori-lang.com/playground) | [Getting Started](#quick-start) | [Specification](https://ori-lang.com/docs/spec/01-notation) | [Examples](examples/) | [Contributing](CONTRIBUTING.md)\n\n\u003c/div\u003e\n\n\u003e **Experimental:** Ori is under active development and not ready for production use. The language, APIs, and tooling may change without notice.\n\n## The Memory Model Nobody Else Has\n\nMost languages ask you to make a tradeoff:\n\n| | GC pauses | Lifetime annotations | Manual alloc/free | Reference cycles |\n|---|:-:|:-:|:-:|:-:|\n| **Go / Java / JS** | Yes | No | No | Handled by GC |\n| **Rust** | No | Yes | No | Prevented by borrow checker |\n| **C / C++** | No | No | Yes | Your problem |\n| **Swift** | No | No | No | Weak refs required |\n| **Ori** | No | No | No | Prevented by design |\n\nOri uses **Automatic Reference Counting** with **value semantics** — every variable owns its data, every assignment is a logical copy, there is no shared mutable state. This is the simplest model for programmers: no aliasing bugs, no data races, no action-at-a-distance through shared references.\n\nBut value semantics, naively implemented, is expensive. Every list push copies the entire list. Every struct update allocates a fresh struct. That is where Ori's compiler comes in.\n\n### What You Get\n\n- **No garbage collector** — no pauses, no tuning, no unpredictable latency\n- **No borrow checker** — no lifetime annotations, no fighting the compiler\n- **No manual memory management** — no malloc/free, no use-after-free\n- **No reference cycles** — prevented at compile time by language design, not by weak refs or a cycle collector\n- **Functional code, imperative performance** — the compiler transforms value-semantic code into in-place mutations automatically\n\n### How the Compiler Makes It Fast\n\nWrite functional code. The compiler generates what an imperative programmer would write by hand.\n\n```ori\n@transform (items: [int]) -\u003e [int] =\n    items.iter()\n        .filter(predicate: x -\u003e x \u003e 0)\n        .map(transform: x -\u003e x * 2)\n        .collect()\n```\n\nWhen `items` is uniquely owned, the compiler transforms this into in-place mutations — zero intermediate allocations, zero copies. The programmer writes pure transformations; the compiled output mutates buffers directly.\n\nThis works because Ori stacks **eight optimization layers** that compound on each other:\n\n1. **Half your variables need zero memory management** — scalars (ints, bools, small structs with no heap data) skip reference counting entirely. In a typical program, roughly 50% of variables are scalars.\n\n2. **Read-only parameters cost nothing** — the compiler analyzes your entire module's call graph and infers which function parameters are only read, not stored or returned. Those parameters skip all reference counting at every call site. `len(list)` never touches the refcount.\n\n3. **Values are freed at last use, not scope end** — instead of waiting until a variable goes out of scope, the compiler places cleanup at the precise point where each value is last used, creating more opportunities for the next optimization.\n\n4. **Drop + allocate = reuse in place** — when the compiler sees a value being freed followed by a new allocation of the same type, it reuses the memory directly. A list map that deconstructs each node and constructs a new one reuses every node allocation in place.\n\n5. **Struct field updates are surgical** — updating one field of a struct with `{ ...point, x: new_x }` only writes the changed field when the struct is uniquely owned. Unchanged fields are left untouched.\n\n6. **Redundant bookkeeping is eliminated** — after all other optimizations, a dataflow pass removes any remaining reference count operations that cancel each other out.\n\n7. **Collection mutations are O(1) when uniquely owned** — every list push, map insert, or set remove checks ownership at runtime. If you are the only owner, it mutates in place. If shared, it copies first (copy-on-write).\n\n8. **The compiler proves ownership at compile time** — when the compiler can prove a value is uniquely owned, it skips even the runtime ownership check. No branch, no check — just the fast path.\n\nEach layer creates opportunities for the next. The net result: code written in pure value semantics — no mutation syntax, no ownership annotations, no lifetime parameters — compiles to code that mutates in-place, reuses allocations, and eliminates branches on provably-unique values.\n\nFor the full technical details, see the [ARC System Design](https://ori-lang.com/docs/compiler-design/09-arc-system).\n\n### How Ori Compares\n\n| | Ori | Swift | Rust | Go | Lean 4 | Koka |\n|---|---|---|---|---|---|---|\n| **Memory strategy** | ARC + value semantics | ARC + ref semantics | Ownership + borrowing | Tracing GC | ARC + value semantics | Perceus RC |\n| **Developer burden** | None | Weak refs for cycles | Lifetime annotations | None | None | None |\n| **Optimization layers** | 8 stacked | Retain/release pairing | Zero-cost (static) | GC tuning | 4 (classify, borrow, RC, reuse) | 3 (Perceus, borrow, reuse) |\n| **Borrow inference** | Interprocedural (whole module) | No (manual annotations) | Static (borrow checker) | N/A | Interprocedural | Two-pass |\n| **In-place reuse** | Yes (cross-block) | COW collections only | By construction | No | Yes (intra-block) | Yes (Perceus) |\n| **Cycle prevention** | Structural (language design) | Weak refs (manual) | Ownership rules | GC handles it | Structural | Structural |\n| **Latency** | Deterministic | Deterministic | Deterministic | GC pauses | Deterministic | Deterministic |\n\n## Effects You Can See\n\nSide effects are tracked through capabilities. Every function declares what it can do, and mocking is just providing a different implementation.\n\n```ori\n@fetch_user (id: UserId) -\u003e Result\u003cUser, Error\u003e uses Http =\n    Http.get(\"/users/\" + str(id))\n\n@test_fetch_user tests @fetch_user () -\u003e void =\n    with Http = MockHttp(responses: {\"/users/1\": mock_user}) in {\n        let result = fetch_user(id: 1);\n        assert_ok(result);\n        assert_eq(result.unwrap().name, \"Alice\");\n    }\n```\n\nNo test framework. No mocking library. No DI container. Just the language.\n\n## The Design That Compounds\n\nThese are not independent features bolted together. They are one coherent design where each choice reinforces the others:\n\n```\nValue semantics\n├── No aliasing → ARC optimizes aggressively (in-place reuse, COW, borrow inference)\n├── No shared mutable state → capabilities track ALL effects\n│   └── Capabilities → trivial mocking → testing isn't painful\n│       └── Smart testing → code integrity → refactoring is safe\n└── Pure functions (no capabilities) → compiler can memoize, reorder, parallelize\n```\n\n**Value semantics** make the memory model possible — without aliasing, the compiler can prove ownership and reuse allocations. They also make capabilities complete — when mutation is explicit, every side effect is visible. Capabilities make mocking trivial, which makes testing practical. And smart testing means code integrity is enforced by infrastructure, not by discipline.\n\nThe same design choice that gives you safe memory gives you testable code gives you optimizable programs. One decision, compounding returns.\n\n## Smart Testing\n\nOri's testing infrastructure is built into the compiler — not bolted on as an afterthought.\n\n### Dependency-Aware Execution\n\nTests are nodes in the dependency graph. Change `@parse`, and tests for `@compile` (which calls `@parse`) run automatically.\n\n```ori\n@parse (input: str) -\u003e Result\u003cAst, Error\u003e = ...\n@test_parse tests @parse () -\u003e void = ...\n\n@compile (input: str) -\u003e Result\u003cBinary, Error\u003e = {\n    let ast = parse(input: input)?;\n    generate_code(ast: ast)\n}\n@test_compile tests @compile () -\u003e void = ...\n```\n\nChange `@parse` → the compiler runs `@test_parse` AND `@test_compile`.\n\n### Configurable Enforcement\n\nChoose your testing policy per project:\n\n```bash\nori check --test-enforcement=off file.ori    # Tests optional (default)\nori check --test-enforcement=warn file.ori   # Warnings for missing tests\nori check --test-enforcement=error file.ori  # Full enforcement for production\n```\n\nNo enforcement by default — you choose when testing becomes a requirement.\n\n### Test-Driven Optimization\n\nYour tests are automatic profiling data. The compiler uses test execution patterns to optimize your production binary — the functions your tests exercise most get the best optimization.\n\n## Contracts\n\nFunctions declare and enforce their invariants.\n\n```ori\n@sqrt (x: float) -\u003e float\n    pre(x \u003e= 0.0)\n    post(r -\u003e r \u003e= 0.0)\n= newton_raphson(x)\n\n@test_sqrt tests @sqrt () -\u003e void = {\n    assert_eq(sqrt(x: 4.0), 2.0);\n    assert_panics(sqrt(x: -1.0));\n}\n```\n\n## Quick Start\n\nInstall Ori (latest nightly):\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/upstat-io/ori-lang/master/install.sh | sh\n```\n\nWrite your first program (`hello.ori`):\n\n```ori\n@main () -\u003e void = print(msg: \"Hello, Ori!\");\n```\n\nRun it instantly:\n\n```bash\nori run hello.ori\n# Hello, Ori!\n```\n\nOr compile it to a native executable:\n\n```bash\nori build hello.ori -o hello\n./hello\n# Hello, Ori!\n```\n\nThat `hello` binary is a standalone native executable. It runs on any machine with the same OS — no Ori installation, no runtime, no VM required. On Windows it's a `.exe`, on Linux an ELF binary, on macOS a Mach-O binary.\n\n## Usage\n\n```bash\nori run program.ori      # Run a program (interpreter)\nori build program.ori    # Compile to native executable\nori check program.ori    # Type-check and verify\nori test                 # Run all tests (parallel)\nori fmt src/             # Format source files\n```\n\n## Installation\n\n### Quick Install (Recommended)\n\n```bash\n# Install latest nightly (default during alpha)\ncurl -fsSL https://raw.githubusercontent.com/upstat-io/ori-lang/master/install.sh | sh\n\n# Install specific version\ncurl -fsSL https://raw.githubusercontent.com/upstat-io/ori-lang/master/install.sh | sh -s -- --version v0.1.0-alpha.2\n```\n\n### Binary Distributions\n\nOfficial binaries are available at [GitHub Releases](https://github.com/upstat-io/ori-lang/releases).\n\n**Platforms:** Linux (x86_64, aarch64), macOS (x86_64, Apple Silicon), Windows (x86_64)\n\n### Install from Source\n\n```bash\ngit clone https://github.com/upstat-io/ori-lang\ncd ori-lang\ncargo build --release\ncp target/release/ori ~/.local/bin/\n```\n\nRequires Rust 1.70+.\n\n## Documentation\n\n- [Website](https://ori-lang.com) — Official website with guides and documentation\n- [Playground](https://ori-lang.com/playground) — Try Ori in your browser\n- [Language Specification](https://ori-lang.com/docs/spec/01-notation) — Formal language definition\n- [Compiler Design](https://ori-lang.com/docs/compiler-design/01-architecture) — Compiler architecture and internals\n- [ARC System Design](https://ori-lang.com/docs/compiler-design/09-arc-system) — Memory model and optimization pipeline\n- [Roadmap](https://ori-lang.com/roadmap) — Development roadmap and progress\n- [Proposals](docs/ori_lang/proposals/) — Design decisions and rationale\n\n## Design Philosophy\n\n**Functional code that runs fast.** Write clean, value-oriented code. The compiler produces optimized native binaries that run without a runtime, VM, or garbage collector.\n\nOri makes performance and verification automatic — the compiler does what discipline alone cannot.\n\n| Traditional Approach | Ori Approach |\n|---------------------|----------------|\n| GC pauses or borrow checker | ARC with value semantics |\n| Hidden effects | Explicit capabilities |\n| Mock with frameworks | Mock with capabilities |\n| Tests are external | Tests are in the dependency graph |\n| Change and hope | Change and know what broke |\n| Runtime errors | Compile-time guarantees |\n| Manual optimization hints | Optimization from semantics |\n\n## Getting Help\n\n- **Website:** [ori-lang.com](https://ori-lang.com)\n- **Bug reports \u0026 feature requests:** [GitHub Issues](https://github.com/upstat-io/ori-lang/issues)\n- **Discussions:** [GitHub Discussions](https://github.com/upstat-io/ori-lang/discussions)\n\n## Contributing\n\nOri is open source and we welcome contributions. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Running Tests\n\n```bash\ncargo test               # Compiler unit tests\nori test                 # Language test suite\n```\n\n## License\n\nOri is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.\n","funding_links":["https://github.com/sponsors/upstat-io"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupstat-io%2Fori-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupstat-io%2Fori-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupstat-io%2Fori-lang/lists"}