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

chibiwasm

> 编程语言
开源

一个小型 WASM 运行时

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

工具介绍

一个小型 WASM 运行时

chibiwasm

This repository was created for the purpose of learning how Wasm works. Please do not use it in production.

If you want to learn how Wasm runtime works, I recommend this book :)

https://skanehira.github.io/writing-a-wasm-runtime-in-rust/

Usage

bash
$ cat
(module
  (func $add (export "add") (param i32 i32) (result i32)
    (local.get 0)
    (local.get 1)
    (i32.add)
  )
)
$ wat2wasm add.wat
$ cargo run -- add.wasm add 1 2
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/chibiwasm add.wasm add 1 2`
3

Use as a crate

rust
use chibiwasm::{Runtime, Value};

fn main() -> anyhow::Result {
    let mut runtime = Runtime::from_file("examples/fib.wasm", None)?;
    if let Some(output) = runtime.call("fib".into(), vec![Value::I32(10)])? {
        println!("output: {}", output);
    }
    Ok(())
}
bash
$ cargo run -q --example fib
output: 89

Test

bash
$ cargo make test

Spec

Base on core 1.

https://www.w3.org/TR/wasm-core-1/

tests

The list is base on https://github.com/WebAssembly/spec/tree/wg-1.0/test/core

NOTE: Checking only the test cases that have passed both assert_return and assert_trap.

  • address.wast
  • align.wast
  • binary_leb128.wast
  • binary.wast
  • block.wast
  • br.wast
  • br_if.wast
  • br_table.wast
  • break_drop.wast
  • call.wast
  • call_indirect.wast
  • comments.wast
  • const.wast
  • conversions.wast
  • custom.wast
  • data.wast
  • elem.wast
  • endianness.wast
  • exports.wast
  • f32.wast
  • f32_bitwise.wast
  • f32_cmp.wast
  • f64.wast
  • f64_bitwise.wast
  • f64_cmp.wast
  • fac.wast
  • float_exprs.wast
  • float_literals.wast
  • float_memory.wast
  • float_misc.wast
  • forward.wast
  • func.wast
  • func_ptrs.wast
  • globals.wast
  • i32.wast
  • i64.wast
  • if.wast
  • imports.wast
  • inline_module.wast
  • int_exprs.wast
  • int_literals.wast
  • labels.wast
  • left_to_right.wast
  • linking.wast
  • load.wast
  • local_get.wast
  • local_set.wast
  • local_tee.wast
  • loop.wast
  • memory.wast
  • memory_grow.wast
  • memory_redundancy.wast
  • memory_size.wast
  • memory_trap.wast
  • names.wast
  • nop.wast
  • return.wast
  • select.wast
  • skip_stack_guard_page.wast
  • stack.wast
  • start.wast
  • store.wast
  • switch.wast
  • token.wast
  • traps.wast
  • type.wast
  • unreachable.wast
  • unreached_invalid.wast
  • unwind.wast
  • utf8_custom_section_id.wast
  • utf8_import_field.wast
  • utf8_import_module.wast
  • utf8_invalid_encoding.wast

LICENSE

This software includes the work that is distributed in the Apache License 2.0.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

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

> 标签

Rustrustwasm

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

> 工具信息

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

> 相关工具

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