{"id":13503072,"url":"https://github.com/mun-lang/mun","last_synced_at":"2025-05-14T06:13:18.706Z","repository":{"id":38310779,"uuid":"198009336","full_name":"mun-lang/mun","owner":"mun-lang","description":"Source code for the Mun language and runtime.","archived":false,"fork":false,"pushed_at":"2025-05-06T13:45:01.000Z","size":5224,"stargazers_count":1979,"open_issues_count":47,"forks_count":77,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-05-06T14:59:29.040Z","etag":null,"topics":["embeddable","gamedev","hot-reloading","language","rust","scripting"],"latest_commit_sha":null,"homepage":"https://mun-lang.org","language":"Rust","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/mun-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"mun-lang","patreon":null,"open_collective":"mun","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-07-21T03:52:07.000Z","updated_at":"2025-05-06T13:45:11.000Z","dependencies_parsed_at":"2023-12-28T16:48:29.644Z","dependency_job_id":"eb75e91a-3432-45db-9e9d-e60d82a432b9","html_url":"https://github.com/mun-lang/mun","commit_stats":{"total_commits":700,"total_committers":32,"mean_commits":21.875,"dds":0.61,"last_synced_commit":"7c7a3c74f8290de5f93786db29fe1f107eb1b777"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mun-lang%2Fmun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mun-lang%2Fmun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mun-lang%2Fmun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mun-lang%2Fmun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mun-lang","download_url":"https://codeload.github.com/mun-lang/mun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253535944,"owners_count":21923748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["embeddable","gamedev","hot-reloading","language","rust","scripting"],"created_at":"2024-07-31T22:02:35.774Z","updated_at":"2025-05-14T06:13:18.678Z","avatar_url":"https://github.com/mun-lang.png","language":"Rust","readme":"# ![Mun][logo-light-mode] ![Mun][logo-dark-mode]\n\n[logo-light-mode]: assets/readme/logotype.svg#gh-light-mode-only\n[logo-dark-mode]: assets/readme/logotype-white.svg#gh-dark-mode-only\n\n[![Build Status][build-badge]][build]\n[![Crates.io][crates-badge]][crates]\n[![docs main][docs-main-badge]][docs-main]\n[![docs v0.4][docs-v0.4-badge]][docs-v0.4]\n[![MIT/Apache][licence-badge]][license]\n[![Join us on Discord][discord-badge]][discord]\n[![codecov][coverage-badge]][coverage]\n![Lines of Code][lines-of-code-badge]\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/mun-lang/mun/ci.yml?branch=main\n[build]: https://github.com/mun-lang/mun/actions\n[crates-badge]: https://img.shields.io/crates/v/mun.svg\n[crates]: https://crates.io/crates/mun/\n[coverage-badge]: https://img.shields.io/codecov/c/github/mun-lang/mun.svg\n[coverage]: https://codecov.io/gh/mun-lang/mun\n[docs-main-badge]: https://img.shields.io/badge/docs-main-blue.svg\n[docs-main]: https://docs.mun-lang.org/\n[docs-v0.4-badge]: https://img.shields.io/badge/docs-v0.4-blue.svg\n[docs-v0.4]: https://docs.mun-lang.org/v0.4/\n[licence-badge]: https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue\n[license]: COPYRIGHT\n[discord-badge]: https://img.shields.io/discord/602227728480993281.svg?logo=discord\n[discord]: https://discord.gg/SfvvcCU\n[lines-of-code-badge]: https://tokei.rs/b1/github/mun-lang/mun?category=code\n\n_Mun_ is a programming language empowering creation through iteration.\n\n## Features\n\n- **Ahead of time compilation** - Mun is compiled ahead of time (AOT), as\n  opposed to being interpreted or compiled just in time (JIT). By detecting\n  errors in the code during AOT compilation, an entire class of runtime errors\n  is eliminated. This allows developers to stay within the comfort of their IDE\n  instead of having to switch between the IDE and target application to debug\n  runtime errors.\n\n- **Statically typed** - Mun resolves types at compilation time instead of at\n  runtime, resulting in immediate feedback when writing code and opening the\n  door for powerful refactoring tools.\n\n- **First class hot-reloading** - Every aspect of Mun is designed with hot\n  reloading in mind. Hot reloading is the process of changing code and resources\n  of a live application, removing the need to start, stop and recompile an\n  application whenever a function or value is changed.\n\n- **Performance** - AOT compilation combined with static typing ensure that Mun\n  is compiled to machine code that can be natively executed on any target\n  platform. LLVM is used for compilation and optimization, guaranteeing the best\n  possible performance. Hot reloading does introduce a slight runtime overhead,\n  but it can be disabled for production builds to ensure the best possible\n  runtime performance.\n\n- **Cross compilation** - The Mun compiler is able to compile to all supported\n  target platforms from any supported compiler platform.\n\n- **Powerful IDE integration** - The Mun language and compiler framework are\n  designed to support source code queries, allowing for powerful IDE\n  integrations such as code completion and refactoring tools.\n\n## Example\n\n\u003c!-- inline HTML is intentionally used to add the id. This allows retrieval of the HTML --\u003e\n\u003cpre language=\"mun\"\u003e\n\u003ccode id=\"code-sample\"\u003efn fibonacci(n: i32) -\u003e i32 {\n    if n \u003c= 1 {\n        n\n    } else {\n        fibonacci(n - 1) + fibonacci(n - 2)\n    }\n}\n\n// Comments: functions marked as `pub` can be called outside the module\npub fn main() {\n    // Native support for bool, f32, f64, i8, u8, u128, i128, usize, isize, etc\n    let is_true = true;\n    let var = 0.5;\n\n    // Type annotations are not required when a variable's type can be deduced\n    let n = 3;\n\n    let result = fibonacci(n);\n\n    // Adding a suffix to a literal restricts its type\n    let lit = 15u128;\n\n    let foo = record();\n    let bar = tuple();\n    let baz = on_heap();\n}\n\n// Both record structs and tuple structs are supported\nstruct Record {\n    n: i32,\n}\n\n// Struct definitions include whether they are allocated by a garbage collector\n// (`gc`) and passed by reference, or passed by `value`. By default, a struct\n// is garbage collected.\nstruct(value) Tuple(f32, f32);\n\nstruct(gc) GC(i32);\n\n// The order of function definitions doesn't matter\nfn record() -\u003e Record {\n    // Mun allows implicit returns\n    Record { n: 7 }\n}\n\nfn tuple() -\u003e Tuple {\n    // Mun allows explicit returns\n    return Tuple(3.14, -6.28);\n}\n\nfn on_heap() -\u003e GC {\n    GC(0)\n}\u003c/code\u003e\n\u003c/pre\u003e\n\n## Documentation\n\n[The Mun Programming Language Book](https://docs.mun-lang.org/) is hosted on\n[netlify](https://www.netlify.com/).\n\n## Pre-Built Binaries\n\n**[NOTE] We do not provide support for milestone releases**\n\n**[NOTE] None of the binaries are currently signed**\n\nDownload pre-built binaries of [milestone\nreleases](https://github.com/mun-lang/mun/releases) for macOS, Linux, and\nWindows (64-bit only).\n\n## Building from Source\n\nMake sure you have the following dependencies installed on you machine:\n\n* [Rust](https://www.rust-lang.org/tools/install)\n* [LLVM 14](https://docs.mun-lang.org/dev/02-building-llvm.html)\n\nClone the source code, including all submodules:\n\n```bash\ngit clone https://github.com/mun-lang/mun.git\ngit submodule update --init --recursive\n```\n\nUse `cargo` to build a release version\n\n```bash\ncargo build --release\n```\n\n## Language server\n\nMun contains support for the lsp protocol, start the executable using:\n\n```bash\nmun language-server\n```\n\nAlternatively, you can install editor-specific extensions.\n\n### VS code\n\nTo run in [Visual Studio Code](https://code.visualstudio.com/). Use the following extension:\n[VS code extension](https://github.com/mun-lang/vscode-extension).\n\n### Vim/Neovim\n\nUse a language server plugin (or built-in lsp support of neovim), for example using [coc.nvim](https://github.com/neoclide/coc.nvim).\n\nPaste the following config into your `:CocConfig`, replace the `command`, with the correct path to the mun executable.\n\n```json\n  \"languageserver\": {\n      \"mun\": {\n          \"command\": \"\u003cpath_to_mun\u003e\",\n          \"rootPatterns\": [\"mun.toml\"],\n          \"trace.server\": \"verbose\",\n          \"args\": [\"language-server\"],\n          \"filetypes\": [\"mun\"]\n      }\n  }\n```\n\nNote that, `\"trace.server\": \"verbose\"` is optional and helps with language server debugging.\n\n## Building Documentation\n\nBuilding the book requires\n[mdBook](https://github.com/rust-lang-nursery/mdBook), ideally version 0.3.x. To\ninstall it, run:\n\n```\n$ cargo install mdbook --vers [version-num]\n```\n\nThe Mun book uses a [custom version of\nHighlight.js](https://github.com/mun-lang/highlight.js) to enable highlighting\nof Mun code. The build version of Highlight.js is required by mdbook in the\n`theme/` folder but it is not distributed with the source. Instead, it can be\nbuild by invoking the build script:\n\n```bash\ncd book\n./ci/build-highlight-js\n```\n\nEvery time you change something in the custom version of highlight.js you have\nto call the above script to ensure you locally use the latest version.\n\nAfter generating the custom minified Highlight.js, to build the book, type:\n\n```\n$ mdbook build\n```\n\nThe output will be in the book subdirectory. To view the book, open it in your\nweb browser.\n\nFor local development use `mdbook serve` instead of `mdbook build`. This will\nstart a local webserver on port `3000` that serves the book and rebuilds the\ncontent when changes are detected.\n\nAll of the above is also combined in a single shell script that can be invoked\nby simply running:\n\n```bash\n./ci/build\n```\n\nTo test the `rust` source code in the book, run:\n\n```bash\nmdbook test -L path/to/target/debug/deps\n```\n\nFor this to work, there can only be one `libmun_runtime-{HASH}.rlib` file in the\nprovided library path.\n\n## License\n\nThe Mun Runtime is licensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or\n  http://opensource.org/licenses/MIT)\n\nat your option.\n","funding_links":["https://github.com/sponsors/mun-lang","https://opencollective.com/mun"],"categories":["Rust","Libraries","库 Libraries","Uncategorized","Other"],"sub_categories":["Scripting","脚本 Scripting","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmun-lang%2Fmun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmun-lang%2Fmun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmun-lang%2Fmun/lists"}