vlib: add a wasm module, implementing a pure V webassembly seralisation library (#17909)

This commit is contained in:
l-m 2023-04-09 14:55:02 +10:00 committed by GitHub
parent 9658d20f03
commit d2f69472b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1966 additions and 0 deletions

View file

@ -0,0 +1,13 @@
import wasm
fn main() {
mut m := wasm.Module{}
mut func := m.new_function('add', [.i32_t, .i32_t], [.i32_t])
{
func.local_get(0)
func.local_get(1)
func.add(.i32_t)
}
m.commit(func, true) // `export: true`
print(m.compile().bytestr())
}