百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lunatic

> 编程语言
开源

Lunatic 是一个基于 Erlang 的 WebAssembly 运行时。

4.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Lunatic 是一个基于 Erlang 的 WebAssembly 运行时。

Lunatic is a universal runtime for fast, robust and scalable server-side applications. It's inspired by Erlang and can be used from any language that compiles to WebAssembly. You can read more about the motivation behind Lunatic here.

We currently provide libraries to take full advantage of Lunatic's features for:

  • Rust
  • AssemblyScript

If you would like to see other languages supported or just follow the discussions around Lunatic, join our discord server.

Supported features

  • Creating, cancelling & waiting on processes
  • Fine-grained process permissions
  • Process supervision
  • Channel based message passing
  • TCP networking
  • Filesystem access
  • Distributed nodes
  • Hot reloading

Installation

If you have rust (cargo) installed, you can build and install the lunatic runtime with:

cargo install lunatic-runtime

On macOS you can use Homebrew too:

brew tap lunatic-solutions/lunatic
brew install lunatic

We also provide pre-built binaries for Windows, Linux and macOS on the releases page, that you can include in your PATH.


And as always, you can also clone this repository and build it locally. The only dependency is a rust compiler:

# Clone the repository
git clone https://github.com/lunatic-solutions/lunatic.git
# Jump into the cloned folder
cd lunatic
# Build and install lunatic
cargo install --path .

Usage

After installation, you can use the lunatic binary to run WASM modules.

To learn how to build modules, check out language-specific bindings:

  • Rust
  • AssemblyScript

Architecture

Lunatic's design is all about spawning super lightweight processes, also known as green threads or go-routines in other runtimes. Lunatic's processes are fast to create, have a small memory footprint and a low scheduling overhead. They are designed for massive concurrency. It's not uncommon to have hundreds of thousands of such processes concurrently running in your app.

Some common use cases for processes are:

  • HTTP request handling
  • Long running requests, like WebSocket connections
  • Long running background tasks, like email sending
  • Calling untrusted libraries in an sandboxed environment

Isolation

What makes the last use case possible are the sandboxing capabilities of WebAssembly. WebAssembly was originally developed to run in the browser and provides extremely strong sandboxing on multiple levels. Lunatic's processes inherit these properties.

Each process has its own stack, heap, and even syscalls. If one process fails, it will not affect the rest of the system. This allows you to create very powerful and fault-tolerant abstraction.

This is also true for some other runtimes, but Lunatic goes one step further and makes it possible to use C bindings directly in your app without any fear. If the C code contains any security vulnerabilities or crashes, those issues will only affect the process currently executing the code. The only requirement is that the C code can be compiled to WebAssembly.

It's possible to give per process fine-grained access to resources (filesystem, memory, network connections, ...). This is enforced on the syscall level.

Scheduling

All processes running on Lunatic are preemptively scheduled and executed by a work stealing async executor. This gives you the freedom to write simple blocking code, but the runtime is going to make sure it actually never blocks a thread if waiting on I/O.

Even if you have an infinite loop somewhere in your code, the scheduling will always be fair and not permanently block the execution thread. The best part is that you don't need to do anything special to achieve this, the runtime will take care of it no matter which programming language you use.

Compatibility

We intend to eventually make Lunatic completely compatible with WASI. Ideally, you could take existing code, compile it to WebAssembly and run on top of Lunatic; creating the best developer experience possible. We're not quite there yet.

License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •[Rust][3]
  • •[AssemblyScript][11]
  • •[x] Creating, cancelling & waiting on processes
  • •[x] Fine-grained process permissions
  • •[x] Process supervision
  • •[x] Channel based message passing
  • •[x] TCP networking
  • •[x] Filesystem access
  • •[x] Distributed nodes
  • •[ ] Hot reloading

> 标签

Rustactorsassemblyscripterlanglunatic

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言