ilusm.dev

wasm

WebAssembly compilation, WASI, browser interop.

Load with: use wasm

Quick example

use wasm

result = wasty(10, 10, "value")
prn(result)

Functions

WASM module

wasne()

Creates a new instance.

Type section

wasty(func, params, results)

Performs the operation. Takes func, params, results.

Import section

wasim(module, name, kind, type_idx)

Performs the operation. Takes module, name, kind, type_idx.

Function section

wasfn(type_idx, locals, body)

Finalises. Takes type_idx, locals, body.

Export section

wasex(name, kind, idx)

Executes. Takes name, kind, idx.

Instructions

wasmo(name, operands)

Performs the operation. Takes name, operands.

wasmu()

Performs the operation.

wasmn()

Performs the operation.

wasmb(result_type, body)

Performs the operation. Takes result_type, body.

wasml(result_type, body)

Performs the operation. Takes result_type, body.

wasmi(result_type, then_body, else_body)

Performs the operation. Takes result_type, then_body, else_body.

wasmb1(label_idx)

Performs the operation. Takes label_idx.

wasmb2(label_idx)

Performs the operation. Takes label_idx.

wasmb3(labels, default)

Performs the operation. Takes labels, default.

wasmr()

Performs the operation.

wasmc(func_idx)

Performs the operation. Takes func_idx.

wasmc1(type_idx, table_idx)

Performs the operation. Takes type_idx, table_idx.

wasms()

Performs the operation.

wasmd()

Performs the operation.

wasml1(idx)

Performs the operation. Takes idx.

wasml2(idx)

Performs the operation. Takes idx.

wasml3(idx)

Performs the operation. Takes idx.

wasmg(idx)

Performs the operation. Takes idx.

wasmg1(idx)

Performs the operation. Takes idx.

wasmi1(align, offset)

Performs the operation. Takes align, offset.

wasmi2(align, offset)

Performs the operation. Takes align, offset.

wasmi3(align, offset)

Performs the operation. Takes align, offset.

wasmm()

Performs the operation.

wasmm1()

Performs the operation.

wasmi4(val)

Performs the operation. Takes val.

wasmi5(val)

Performs the operation. Takes val.

wasmi6()

Performs the operation.

wasmi7()

Performs the operation.

wasmi8()

Performs the operation.

wasmi9()

Performs the operation.

wasmi10()

Performs the operation.

wasmi11()

Performs the operation.

wasmi12()

Performs the operation.

Compilation

wasbl(module)

Performs the operation. Takes module.

wasdi(binary)

Disconnects. Takes binary.

wasin(binary)

Initialises. Takes binary.

Ilusm -> WASM compiler

wasco(src)

Connects. Takes src.

wasfl(path)

Performs the operation. Takes path.

WASI (WebAssembly System Interface)

wasiw()

Performs the operation.

wasia(wasi)

Performs the operation. Takes wasi.

wasis(wasi)

Returns true/false based on a condition. Takes wasi.

wasfw(wasi, fd, iovs)

Performs the operation. Takes wasi, fd, iovs.

wasfr(wasi, fd, iovs)

Creates from another format. Takes wasi, fd, iovs.

wasie(wasi, code)

Performs the operation. Takes wasi, code.

Browser interop

wasmj(module, import_object)

Performs the operation. Takes module, import_object.

wasmg2(module)

Performs the operation. Takes module.

wasmj1(instance, export_name, args)

Performs the operation. Takes instance, export_name, args.

Memory management

wasme(init, max)

Performs the operation. Takes init, max.

wasmg3(mem, delta)

Performs the operation. Takes mem, delta.

wasmb4(mem)

Performs the operation. Takes mem.

Data segments

wasmd1(offset, data)

Performs the operation. Takes offset, data.

wasst(mem, off, s)

Sets a value or starts a process. Takes mem, off, s.

wasrs(mem, off, len)

Resets. Takes mem, off, len.

Table and indirect calls

wasta(init, max, ty)

Performs the operation. Takes init, max, ty.

wasts(tab, idx, fn)

Performs the operation. Takes tab, idx, fn.

wastg(tab, idx)

Performs the operation. Takes tab, idx.

Global variables

wasmg4(val_type, mutable, initial)

Performs the operation. Takes val_type, mutable, initial.

Validation

wasmi13(binary)

Performs the operation. Takes binary.

wasmi14(module)

Performs the operation. Takes module.

Optimization

wasmo1(module)

Performs the operation. Takes module.

Serialization

wasms1(module)

Performs the operation. Takes module.

wasmd2(binary)

Performs the operation. Takes binary.

Notes

  • WebAssembly - compile ilusm to WASM, call WASM functions.