{"id":13511322,"url":"https://github.com/lunatic-solutions/lunatic","last_synced_at":"2025-05-14T11:08:16.233Z","repository":{"id":37625764,"uuid":"290495697","full_name":"lunatic-solutions/lunatic","owner":"lunatic-solutions","description":"Lunatic is an Erlang-inspired runtime for WebAssembly","archived":false,"fork":false,"pushed_at":"2025-03-29T18:30:22.000Z","size":4091,"stargazers_count":4719,"open_issues_count":47,"forks_count":137,"subscribers_count":70,"default_branch":"main","last_synced_at":"2025-05-07T10:52:37.882Z","etag":null,"topics":["actors","assemblyscript","erlang","lunatic","runtime","rust","vm","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://lunatic.solutions","language":"Rust","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/lunatic-solutions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2020-08-26T12:53:38.000Z","updated_at":"2025-05-06T22:18:33.000Z","dependencies_parsed_at":"2023-09-23T09:44:45.020Z","dependency_job_id":"99b6b2b8-3e14-4074-9ea8-3e7acdca5142","html_url":"https://github.com/lunatic-solutions/lunatic","commit_stats":{"total_commits":501,"total_committers":34,"mean_commits":"14.735294117647058","dds":"0.36926147704590817","last_synced_commit":"502c34b50a7ffd1737f02191e0eb22f4b385e19e"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-solutions%2Flunatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-solutions%2Flunatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-solutions%2Flunatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunatic-solutions%2Flunatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunatic-solutions","download_url":"https://codeload.github.com/lunatic-solutions/lunatic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129481,"owners_count":22019628,"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":["actors","assemblyscript","erlang","lunatic","runtime","rust","vm","wasm","webassembly"],"created_at":"2024-08-01T03:00:47.305Z","updated_at":"2025-05-14T11:08:16.189Z","avatar_url":"https://github.com/lunatic-solutions.png","language":"Rust","funding_links":[],"categories":["Virtual Machines","Rust","By Industry","其他","webassembly","By Language"],"sub_categories":["Web Development","网络服务_其他","Rust"],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://lunatic.solutions/\" target=\"_blank\"\u003e\n        \u003cimg width=\"60\" \n             src=\"https://raw.githubusercontent.com/lunatic-solutions/lunatic/main/assets/logo.svg\"\n             alt=\"lunatic logo\"\n        \u003e\n    \u003c/a\u003e\n    \u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003c/div\u003e\n\nLunatic is a universal runtime for **fast**, **robust** and **scalable** server-side applications.\nIt's inspired by Erlang and can be used from any language that compiles to [WebAssembly][1].\nYou can read more about the motivation behind Lunatic [here][2].\n\nWe currently provide libraries to take full advantage of Lunatic's features for:\n\n- [Rust][3]\n- [AssemblyScript][11]\n\nIf you would like to see other languages supported or just follow the discussions around Lunatic,\n[join our discord server][4].\n\n## Supported features\n\n- [x] Creating, cancelling \u0026 waiting on processes\n- [x] Fine-grained process permissions\n- [x] Process supervision\n- [x] Channel based message passing\n- [x] TCP networking\n- [x] Filesystem access\n- [x] Distributed nodes\n- [ ] Hot reloading\n\n## Installation\n\nIf you have rust (cargo) installed, you can build and install the lunatic runtime with:\n\n```bash\ncargo install lunatic-runtime\n```\n\n---\n\nOn **macOS** you can use [Homebrew][6] too:\n\n```bash\nbrew tap lunatic-solutions/lunatic\nbrew install lunatic\n```\n\n---\n\nWe also provide pre-built binaries for **Windows**, **Linux** and **macOS** on the\n[releases page][5], that you can include in your `PATH`.\n\n---\n\nAnd as always, you can also clone this repository and build it locally. The only dependency is\n[a rust compiler][7]:\n\n```bash\n# Clone the repository\ngit clone https://github.com/lunatic-solutions/lunatic.git\n# Jump into the cloned folder\ncd lunatic\n# Build and install lunatic\ncargo install --path .\n```\n\n## Usage\n\nAfter installation, you can use the `lunatic` binary to run WASM modules.\n\nTo learn how to build modules, check out language-specific bindings:\n\n- [Rust](https://github.com/lunatic-solutions/rust-lib)\n- [AssemblyScript](https://github.com/lunatic-solutions/as-lunatic)\n\n## Architecture\n\nLunatic's design is all about spawning _super lightweight_ processes, also known as green threads or\n[go-routines][8] in other runtimes. Lunatic's processes are fast to create, have a small memory footprint\nand a low scheduling overhead. They are designed for **massive** concurrency. It's not uncommon to have\nhundreds of thousands of such processes concurrently running in your app.\n\nSome common use cases for processes are:\n\n- HTTP request handling\n- Long running requests, like WebSocket connections\n- Long running background tasks, like email sending\n- Calling untrusted libraries in an sandboxed environment\n\n### Isolation\n\nWhat makes the last use case possible are the sandboxing capabilities of [WebAssembly][1]. WebAssembly was\noriginally developed to run in the browser and provides extremely strong sandboxing on multiple levels.\nLunatic's processes inherit these properties.\n\nEach process has its own stack, heap, and even syscalls. If one process fails, it will not affect the rest\nof the system. This allows you to create very powerful and fault-tolerant abstraction.\n\nThis is also true for some other runtimes, but Lunatic goes one step further and makes it possible to use C\nbindings directly in your app without any fear. If the C code contains any security vulnerabilities or crashes,\nthose issues will only affect the process currently executing the code. The only requirement is that the C\ncode can be compiled to WebAssembly.\n\nIt's possible to give per process fine-grained access to resources (filesystem, memory, network connections, ...).\nThis is enforced on the syscall level.\n\n### Scheduling\n\nAll processes running on Lunatic are preemptively scheduled and executed by a [work stealing async executor][9]. This\ngives you the freedom to write simple _blocking_ code, but the runtime is going to make sure it actually never blocks\na thread if waiting on I/O.\n\nEven if you have an infinite loop somewhere in your code, the scheduling will always be fair and not permanently block\nthe execution thread. The best part is that you don't need to do anything special to achieve this, the runtime will take\ncare of it no matter which programming language you use.\n\n### Compatibility\n\nWe intend to eventually make Lunatic completely compatible with [WASI][10]. Ideally, you could take existing code,\ncompile it to WebAssembly and run on top of Lunatic; creating the best developer experience possible. We're not\nquite there yet.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n[1]: https://webassembly.org/\n[2]: https://kolobara.com/lunatic/index.html#motivation\n[3]: https://crates.io/crates/lunatic\n[4]: https://discord.gg/b7zDqpXpB4\n[5]: https://github.com/lunatic-solutions/lunatic/releases\n[6]: https://brew.sh/\n[7]: https://rustup.rs/\n[8]: https://golangbot.com/goroutines\n[9]: https://tokio.rs\n[10]: https://wasi.dev/\n[11]: https://github.com/lunatic-solutions/as-lunatic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunatic-solutions%2Flunatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunatic-solutions%2Flunatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunatic-solutions%2Flunatic/lists"}