{"id":47115440,"url":"https://github.com/pulseengine/rules_moonbit","last_synced_at":"2026-03-12T18:58:25.044Z","repository":{"id":332043060,"uuid":"1132030142","full_name":"pulseengine/rules_moonbit","owner":"pulseengine","description":"Bazel rules for MoonBit with hermetic toolchain support","archived":false,"fork":false,"pushed_at":"2026-03-02T08:05:28.000Z","size":274,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-02T12:20:11.940Z","etag":null,"topics":["bazel","moonbit","pulseengine","toolchain"],"latest_commit_sha":null,"homepage":null,"language":"Starlark","has_issues":true,"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/pulseengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":null,"dco":null,"cla":null}},"created_at":"2026-01-11T07:07:04.000Z","updated_at":"2026-03-02T08:05:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pulseengine/rules_moonbit","commit_stats":null,"previous_names":["pulseengine/rules_moonbit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pulseengine/rules_moonbit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_moonbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_moonbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_moonbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_moonbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pulseengine","download_url":"https://codeload.github.com/pulseengine/rules_moonbit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pulseengine%2Frules_moonbit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30439122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"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":["bazel","moonbit","pulseengine","toolchain"],"created_at":"2026-03-12T18:58:24.206Z","updated_at":"2026-03-12T18:58:25.036Z","avatar_url":"https://github.com/pulseengine.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# rules_moonbit\n\n\u003csup\u003eBazel rules for MoonBit projects\u003c/sup\u003e\n\n\u0026nbsp;\n\n![Bazel](https://img.shields.io/badge/Bazel-43A047?style=flat-square\u0026logo=bazel\u0026logoColor=white\u0026labelColor=1a1b27)\n![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue?style=flat-square\u0026labelColor=1a1b27)\n\n\u003c/div\u003e\n\n\u0026nbsp;\n\nBazel rules for building MoonBit projects with hermetic toolchain support, multi-target compilation, and WebAssembly Component Model integration.\n\n\u003e [!NOTE]\n\u003e Part of the PulseEngine toolchain. Provides build infrastructure for MoonBit-based components. See [moonbit_checksum_updater](https://github.com/pulseengine/moonbit_checksum_updater) for checksum management tooling.\n\n## Status\n\nEarly development phase. The goal is to create Bazel rules that integrate with MoonBit's build system while maintaining Bazel's core principles.\n\n## Getting Started\n\n### Prerequisites\n\n- Bazel 8.5+ (required for modern toolchain support)\n\n### Quick Start\n\n**Using Bzlmod (Modern Bazel):**\n\n```python\n# MODULE.bazel\nbazel_dep(name = \"rules_moonbit\", version = \"0.1.0\")\n```\n\n**Using WORKSPACE:**\n\n```python\nlocal_repository(\n    name = \"rules_moonbit\",\n    path = \"/path/to/rules_moonbit\",\n)\n\nregister_toolchains(\"@moonbit_toolchain//:moonbit_toolchain\")\n```\n\n**When Hermetic Downloads Become Available:**\n\n```python\nload(\"@rules_moonbit//moonbit/tools:hermetic_toolchain.bzl\", \"moonbit_toolchain_repository\")\n\nmoonbit_toolchain_repository(\n    name = \"moonbit_toolchain\",\n    version = \"0.6.33\",\n)\n\nregister_toolchains(\"@moonbit_toolchain//:moonbit_toolchain\")\n```\n\n### BUILD file\n\n```python\nload(\"@rules_moonbit//moonbit:defs.bzl\", \"moonbit_library\", \"moonbit_binary\")\n\nmoonbit_library(\n    name = \"mylib\",\n    srcs = [\"mylib.mbt\"],\n    deps = [\"//:otherlib\"],\n)\n\nmoonbit_binary(\n    name = \"myapp\",\n    srcs = [\"main.mbt\"],\n    deps = [\":mylib\"],\n)\n```\n\n## Features\n\n### Core\n- MoonBit compilation with multi-target support (WASM, JavaScript, C, native)\n- Cross-compilation for different platforms\n- WebAssembly Component Model with WIT interface support\n- Package management with MoonBit registry integration\n- Hermetic toolchain with automatic download and management\n\n### Advanced\n- Incremental compilation for faster rebuilds\n- Multiple optimization levels (debug, release, aggressive)\n- Content-addressable caching for build acceleration\n- Integration with rules_wasm_component\n- Checksum verification for hermetic builds\n\n## Advanced Usage\n\n### Cross-Compilation\n\n```python\nmoonbit_binary(\n    name = \"linux_app\",\n    srcs = [\"main.mbt\"],\n    target_platform = \"linux_x86_64\",\n    optimization = \"aggressive\",\n)\n```\n\n### WebAssembly Component Model\n\n```python\nmoonbit_component(\n    name = \"math_component\",\n    srcs = [\"math.mbt\"],\n    wit_deps = [\":math_wit\"],\n    target_platform = \"wasm\",\n)\n```\n\n## Development\n\n```bash\nbazel build //...     # Build\nbazel test //...      # Test\nbazel test //test/... # Run test suite\n```\n\n## Contributing\n\nSee CONTRIBUTING.md for contribution guidelines.\n\n## License\n\nApache-2.0\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n\u003csub\u003ePart of \u003ca href=\"https://github.com/pulseengine\"\u003ePulseEngine\u003c/a\u003e \u0026mdash; formally verified WebAssembly toolchain for safety-critical systems\u003c/sub\u003e\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Frules_moonbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpulseengine%2Frules_moonbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpulseengine%2Frules_moonbit/lists"}