nyar-wasm

Crates.ionyar-wasm
lib.rsnyar-wasm
version0.0.7
sourcesrc
created_at2023-12-06 06:59:58.518069
updated_at2024-05-21 14:53:28.336786
descriptionHigh level wasm builder
homepage
repositoryhttps://github.com/oovm/dialect
max_upload_size
id1059738
size109,333
SasakiSaki (oovm)

documentation

https://docs.rs/nyar-wasm

README

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")
}
Commit count: 0

cargo fmt