{"id":13575358,"url":"https://github.com/nickmqb/muon","last_synced_at":"2026-01-16T19:04:32.626Z","repository":{"id":46305395,"uuid":"179891787","full_name":"nickmqb/muon","owner":"nickmqb","description":"Modern low-level programming language","archived":false,"fork":false,"pushed_at":"2024-04-28T20:32:07.000Z","size":674,"stargazers_count":778,"open_issues_count":9,"forks_count":26,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-18T21:25:40.472Z","etag":null,"topics":["programming-language"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickmqb.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":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-06T22:06:45.000Z","updated_at":"2025-04-14T09:00:04.000Z","dependencies_parsed_at":"2024-11-05T11:38:42.735Z","dependency_job_id":"75b866a9-87a3-42a6-99a2-72701bc305ee","html_url":"https://github.com/nickmqb/muon","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nickmqb/muon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmqb%2Fmuon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmqb%2Fmuon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmqb%2Fmuon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmqb%2Fmuon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickmqb","download_url":"https://codeload.github.com/nickmqb/muon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickmqb%2Fmuon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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":["programming-language"],"created_at":"2024-08-01T15:01:00.301Z","updated_at":"2026-01-16T19:04:32.598Z","avatar_url":"https://github.com/nickmqb.png","language":"C","funding_links":[],"categories":["C","Uncategorized","Other"],"sub_categories":["Uncategorized"],"readme":"# Muon\n\nMuon is a modern low-level programming language, inspired by C, C#, Go, Rust and Python.\n\nTo stay up-to-date on Muon, consider [following me on Twitter](https://twitter.com/nickmqb).\n\n## Design principles\n\n1. **Strongly, statically typed.**\n\n2. **Data oriented.** Just functions, structs and enums. NO: classes, inheritance, properties, etc.\n\n3. **No runtime.** Lack of a runtime makes the language simpler, reduces application startup latency and makes it easy to use Muon code from other languages.\n\n4. **Extremely minimal core.** A language should not dictate dependencies. There is a standard library, but it is completely optional.\n\n5. **High performance.** Strive for parity with C.\n\n6. **Flexible memory management.** Programmers can switch between allocators dynamically and can define their own allocators.\n\n7. **Avoid common memory safety pitfalls.** Memory is initialized to zero. Array bounds are checked (can be turned off where needed).\n\n8. **No undefined behavior.** Undefined behavior can lead to [various](https://blog.regehr.org/archives/213), [hard-to-spot](https://blog.regehr.org/archives/226), [bugs](https://blog.regehr.org/archives/232). In Muon, all behavior, including platform-specific behavior, is defined.\n\n9. **Ergonomics matter.** Programmers spend a lot of time working with a language, so ergonomics are important. Muon has:\n\t- Type inference for function return values and locals\n\t- [Generics](docs/muon_by_example.md#generic-structs)\n\t- Order independent declarations\n\t- Newline as statement separator\n\t- [Uniform function call syntax](docs/muon_by_example.md#ufcs)\n\t- [Reference type notation](docs/muon_by_example.md#reference-type-notation)\n\t- Namespaces\n\n10. **Fail fast.** Usually, error reporting/handling happens via return values. For unrecoverable errors and errors that a caller is not prepared to handle, Muon provides [abandonment](docs/muon_by_example.md#error-handling-abandonment).\n\n11. **Small(-ish) language.** Strive for a small, simple language. Having fewer ways to do something encourages a more consistent, focused ecosystem.\n\n12. **Fast \u0026 snappy tools.** Provide tools centered around fast feedback and improving program understanding. E.g.: [language server](https://github.com/nickmqb/muon/tree/master/language_server), REPL, hot reloading, debuggers, profilers.\n\n## Example\n\nA glimpse of Muon:\n\n\tArray {\n\t\tcountOccurrences(items Array\u003cT\u003e) {\n\t\t\tmap := Map.create\u003cT, int\u003e()\n\t\t\tfor items {\n\t\t\t\tcount := map.getOrDefault(it)\n\t\t\t\tmap.addOrUpdate(it, count + 1)\n\t\t\t}\n\t\t\treturn map\n\t\t}\n\t}\n\t\n\tmain() {\n\t\t::currentAllocator = Memory.newArenaAllocator(4096)\n\t\ts := \"How much wood could a wood chuck chuck if a wood chuck could chuck wood?\"\n\t\tfreq := s.split(' ').countOccurrences() // Equivalent to: Array.countOccurrences(ref string.split(s, ' '))\n\t\tfor e in freq {\n\t\t\tStdout.writeLine(format(\"word: {}, count: {}\", e.key, e.value))\n\t\t}\n\t}\n\n## Getting started\n\nTo get started with Muon, see [getting started](docs/getting_started.md). To learn more about the language, see [Muon by example](docs/muon_by_example.md).\n\nAlso, check out the [roadmap](docs/roadmap.md) to see which features are coming up.\n\n## Tools\n\n* [Compiler](docs/getting_started.md): implements error recovery and has column accurate error reporting, which should make for a pleasant command line experience.\n* [Language server](https://github.com/nickmqb/muon/tree/master/language_server/README.md): provides interactive language features, such as symbol search, go to definition and as-you-type diagnostics.\n* [VSCode extension](https://github.com/nickmqb/vscode-muon): provides syntax highlighting and language features via the language server.\n* [ffigen](https://github.com/nickmqb/muon/tree/master/ffigen/README.md): takes a .c/.h file and generates a corresponding .mu file with foreign interface declarations (a.k.a. bindings).\n* [More tools are planned](docs/roadmap.md).\n\n## Current state\n\n**Compiler backend**. The compiler currently outputs C code. This means that we inherit C's undefined behavior model, which goes against the goals listed above! An LLVM backend is in the works which will avoid any undefined behavior.\n\n**Performance**. The compiler is pretty fast. A basic benchmark -- compiling the Muon compiler (which is itself written in Muon), which is ~12K lines of code, on a 4Ghz core i7 -- shows a compilation speed of ~0.5 million lines/second. The compiler is single threaded right now and there's lots of room for further improvement. One major caveat: after the Muon compiler has finished, a C compiler still needs to run to generate the final binary, which usually takes up the most time. The LLVM backend will (hopefully) reduce this.\n\n**Supported platforms**. Muon aims to target all popular platforms, including Windows, macOS, Linux, iOS and Android. 64-bit architectures are the main focus ([more details](https://nickmqb.github.io/2020/01/17/shifting-muons-focus-to-64-bit.html)).\n\n## Twitter\n\nTo stay up-to-date on Muon, consider [following me on Twitter](https://twitter.com/nickmqb).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmqb%2Fmuon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickmqb%2Fmuon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickmqb%2Fmuon/lists"}