{"id":44683159,"url":"https://github.com/reussir-lang/reussir","last_synced_at":"2026-04-05T00:02:58.023Z","repository":{"id":307587078,"uuid":"1021654046","full_name":"reussir-lang/reussir","owner":"reussir-lang","description":"A programming language with region-based memory management","archived":false,"fork":false,"pushed_at":"2026-03-05T16:35:02.000Z","size":6164,"stargazers_count":16,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T18:54:55.343Z","etag":null,"topics":["functional-programming","llvm","memory-management","mlir"],"latest_commit_sha":null,"homepage":"https://reussir-lang.github.io/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reussir-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-17T18:19:46.000Z","updated_at":"2026-03-05T16:35:06.000Z","dependencies_parsed_at":"2025-08-01T03:26:53.584Z","dependency_job_id":"7feff4d8-32d0-443b-aba0-2ba5feadade6","html_url":"https://github.com/reussir-lang/reussir","commit_stats":null,"previous_names":["schrodingerzhu/reussir","reussir-lang/reussir"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/reussir-lang/reussir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reussir-lang%2Freussir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reussir-lang%2Freussir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reussir-lang%2Freussir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reussir-lang%2Freussir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reussir-lang","download_url":"https://codeload.github.com/reussir-lang/reussir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reussir-lang%2Freussir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30301492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: 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":["functional-programming","llvm","memory-management","mlir"],"created_at":"2026-02-15T05:07:27.412Z","updated_at":"2026-04-05T00:02:57.967Z","avatar_url":"https://github.com/reussir-lang.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"misc/logos/reussir_banner_1600x800.svg\" alt=\"Reussir Logo\" width=\"600\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eReussir\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eAn MLIR-based compiler framework for token-based memory reuse in RC-managed functional programs\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eFrontend in Haskell, backend in MLIR/C++, runtime in Rust\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e •\n  \u003ca href=\"#design-center\"\u003eDesign Center\u003c/a\u003e •\n  \u003ca href=\"#repository-layout\"\u003eRepository Layout\u003c/a\u003e •\n  \u003ca href=\"#compilation-guide\"\u003eCompilation Guide\u003c/a\u003e •\n  \u003ca href=\"#testing\"\u003eTesting\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Overview\n\nReussir is a research compiler project built around one claim: memory reuse in\nreference-counted functional programs should be represented and optimized\ndirectly at the IR level.\n\nThe core idea is to make reusable storage explicit as SSA values called\n**tokens**, carry those tokens through MLIR structured control flow, and perform\nreuse analysis as an ordinary compiler problem rather than as a language-local\ntrick. In the current design, Reussir includes:\n\n- an ownership-aware functional frontend,\n- an MLIR dialect and pass pipeline for RC-managed objects,\n- token-based reuse analysis over branches, regions, and loops,\n- LLVM lowering and backend-oriented cleanups,\n- a Rust runtime for RC objects and related support code,\n- extensions for region-local mutable objects and polymorphic FFI.\n\nThe frontend language exists to drive and validate this compilation model, but\nthe main project identity is the compiler framework and object model, not a\nsurface syntax.\n\n## Design Center\n\nThe current implementation is centered on two connected ideas:\n\n- RC-based memory reuse should be explicit in the IR rather than hidden inside a\n  language-specific compiler trick.\n- region-based local mutation should fit into the same overall object model\n  instead of being treated as an unrelated subsystem.\n\n### Core object model\n\nThe backend is organized around a small set of pointer and storage concepts:\n\n- `!reussir.rc\u003cT\u003e` for owning reference-counted objects,\n- `!reussir.ref\u003cT\u003e` for non-owning inspection references,\n- `!reussir.token\u003calign: A, size: S\u003e` for reusable storage,\n- `!reussir.nullable\u003c...\u003e` for values that may be null on non-unique paths.\n\nThis makes reuse explicit: `rc.dec` may yield reusable storage, consumers can\naccept tokens, and later passes decide whether that storage should be reused,\nreallocated, or freed.\n\n### What the compiler is trying to do\n\nReussir is aimed at RC-based functional compilation with strong low-level\noptimization, especially for programs that repeatedly destruct and rebuild\nalgebraic data. The current pipeline is centered on:\n\n- ownership insertion in the frontend,\n- `rc.inc` / `rc.dec` cancellation and drop expansion,\n- one-shot token reuse across structured control flow,\n- RC creation sinking and fusion,\n- invariant-group propagation for semantically immutable loads,\n- TRMC-like rewrites and other lowering-oriented cleanups.\n\nThis is why the repository contains both language frontend code and substantial\nbackend machinery in MLIR and LLVM.\n\n### Regions are an extension, not the whole story\n\nReussir does support region-local mutable objects, but regions are not the sole\nor primary identity of the project. Regional mutable objects extend the same\nRC-oriented runtime and compiler model: values can be built inside a local\nregion, mutated there, then frozen and converted into regular RC-managed\nobjects when they escape.\n\n### Interoperability matters\n\nAnother explicit goal is to make RC-managed functional compilation compose well\nwith native code and the broader MLIR ecosystem. The current codebase therefore\nincludes:\n\n- a Rust runtime that matches the RC object model,\n- bridge code between the Haskell frontend and MLIR/C++ backend,\n- a polymorphic FFI direction instead of forcing everything through one boxed\n  representation.\n\n## Repository Layout\n\nThe repository is split by responsibility:\n\n- `frontend/`:\n  Haskell packages for parsing, diagnostics, elaboration, code generation, the\n  REPL, and the language server.\n- `include/` and `lib/`:\n  the Reussir MLIR dialect, analyses, conversions, bridge code, and backend\n  support libraries.\n- `runtime/`:\n  the Rust runtime for RC objects, nullable helpers, and related runtime\n  support.\n- `tool/`:\n  command-line MLIR tools such as `reussir-opt` and `reussir-translate`.\n- `tests/`:\n  C++ unit tests and LLVM `lit` integration tests covering both backend passes\n  and frontend end-to-end compilation.\n- `reussir-vscode/`:\n  editor support for the language.\n\n## Compilation Guide\n\n### Prerequisites\n\nYou need a working development environment with:\n\n- CMake 3.28 or newer,\n- Ninja,\n- LLVM and MLIR with CMake package files available,\n- Rust and Cargo,\n- GHC and Cabal,\n- Python 3 for `lit`.\n\nThe exact package source depends on your platform and local toolchain setup.\n\n### 1. Configure the build\n\n```bash\ncmake -S . -B build -G Ninja -DREUSSIR_ENABLE_TESTS=ON\n```\n\nUseful options:\n\n```bash\n# Disable tests\ncmake -S . -B build -G Ninja -DREUSSIR_ENABLE_TESTS=OFF\n\n# Enable stricter C++ warnings\ncmake -S . -B build -G Ninja -DREUSSIR_ENABLE_TESTS=ON -DREUSSIR_ENABLE_PEDANTIC=ON\n```\n\n### 2. Compile everything\n\n```bash\ncmake --build build\n```\n\nThis builds the backend libraries and tools, the Rust runtime, and the frontend\nexecutables exposed through CMake:\n\n- `reussir-opt`\n- `reussir-translate`\n- `reussir-elab`\n- `reussir-compiler`\n- `reussir-parser`\n- `reussir-repl`\n- `reussir-lsp`\n\n### 3. Compile specific targets\n\n```bash\ncmake --build build --target reussir-opt\ncmake --build build --target reussir-translate\ncmake --build build --target reussir-rt\ncmake --build build --target reussir-compiler\ncmake --build build --target reussir-repl\n```\n\nBuilt binaries are placed under `build/bin/`, and runtime libraries are copied\nunder `build/lib/`.\n\n### 4. Frontend-only workflow\n\nThe frontend is managed as a Cabal multi-package project:\n\n```bash\ncabal build all -j\n```\n\nCurrent frontend packages:\n\n- `reussir-bridge`\n- `reussir-codegen`\n- `reussir-core`\n- `reussir-diagnostic`\n- `reussir-lsp`\n- `reussir-parser`\n- `reussir-repl`\n\n### 5. Typical local workflows\n\nInspect elaboration output:\n\n```bash\nbuild/bin/reussir-elab path/to/program.rr\n```\n\nCompile a Reussir source file:\n\n```bash\nbuild/bin/reussir-compiler path/to/program.rr\n```\n\nRun the REPL:\n\n```bash\nbuild/bin/reussir-repl\n```\n\n## Testing\n\nReussir has both unit tests and integration tests.\n\n### C++ unit tests\n\n```bash\ncmake --build build --target reussir-ut\nctest --test-dir build --output-on-failure\n```\n\n### LLVM `lit` integration tests\n\n```bash\ncmake --build build --target check\n```\n\nThe integration suite covers backend conversions, reuse-related passes, and\nfrontend end-to-end examples under `tests/integration/`.\n\n### Haskell tests\n\n```bash\ncabal test all -j\n```\n\n## Status\n\nReussir is an active research compiler. The design space is still moving, but\nthe repository already contains an end-to-end implementation of the main\ncompiler story described above: ownership-aware elaboration, an RC/region-aware\nMLIR dialect, token-based reuse analysis, lowering passes, runtime support, and\ntest infrastructure.\n\n## License\n\nThe project is dual-licensed:\n\n- Apache License, Version 2.0\n- MIT License\n\nYou may use the project under either license. The full license text is in\n[LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freussir-lang%2Freussir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freussir-lang%2Freussir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freussir-lang%2Freussir/lists"}