7 releases

0.0.6 Mar 13, 2024
0.0.5 Mar 6, 2024
0.0.4 Feb 18, 2024
0.0.3 Dec 15, 2023

#584 in WebAssembly

Download history 2/week @ 2024-02-11 285/week @ 2024-02-18 12/week @ 2024-02-25 134/week @ 2024-03-03 183/week @ 2024-03-10 9/week @ 2024-03-17 51/week @ 2024-03-31

250 downloads per month
Used in valkyrie-types

MPL-2.0 license

105KB
2.5K SLoC

NyarVM WebAssembly Backend

function add(a, b) -> ret {
    a + b
}

function add(a, b, ret) {
    ret(a + b)
}

let data = "hello world"
/// - file_descriptor: 文件描述符, 比如 `stdout` 的文件描述符为 1
/// - memory: 数据在哪个内存, 这一项总是传 0.
/// - length: 字符串的长度
/// - nwritten: 写入的字节数
#ffi("wasi_snapshot_preview1", "fd_write")
function fd_write(file_descriptor: i32, memory: i32, length: i32, nwritten: i32): i32 {

}


class UTF8Text {
    private buffer: array<u8>
}

structure UTF8View {
    offset: u32,
    length: u32,
}

let data = "hello world";

#main
function run() {
    fd_write(1, 0, 1, 20)
    @asm("drop")
}

Dependencies

~6–15MB
~177K SLoC