wasm v0.1.0 Wasm View Source
Functions and types for WebAssembly. See the spec’s Binary and Structure sections.
To create a complete module see encode/1
and the associated term wasm_module/0
.
Link to this section Summary
Types
Term of a code section item. Spec reference.
Term of a custom section item. Spec reference.
Term of a data section item. Spec reference.
Term of a WebAssembly element. Spec reference.
Term of an element type. Spec reference.
Term of a WebAssembly export. Spec reference.
Terms of floats. Spec reference.
Term of a WebAssembly function. Spec reference.
Term of a funcion type. Spec reference.
Term of a WebAssembly global. Spec reference.
Term of a global type. Spec reference.
Term of a WebAssembly import. Spec reference.
Term of a WebAssembly index. Spec reference.
Term of an instruction. Spec reference.
Terms of integers. Spec reference.
Term of memory limits. Spec reference.
Term of WebAssembly locals. Spec reference.
Term of a memory section item. Spec reference.
Term of a memory type. Spec reference.
Term of a WebAssembly module. Spec reference.
Term of a name. Spec reference.
Term of a result type. Spec reference.
Term of a module section. Spec reference.
Term of a start section item. Spec reference.
Term of a WebAssembly table. Spec reference.
Term of a table type. Spec reference.
Terms of a value type. Spec reference.
Functions
Encode a WebAssembly module. Spec reference.
Encode code section contents. Spec reference.
Encode custom section contents. Spec reference.
Encode data section contents. Spec reference.
Encode element section contents. Spec reference.
Encode a table element type. Spec reference.
Encode export section contents. Spec reference.
Encode 32-bit and 64-bit IEEE 754 LE floats. Spec reference.
Encode a func type. Spec reference.
Encode global section contents. Spec reference.
Encode a global type. Spec reference.
Encode import section contents. Spec reference.
Encode an index. Spec reference.
Encode instructions. Spec reference.
Encode 32-bit or 64-bit integers that are signed or unsigned. Spec reference.
Encode a limit. Spec reference.
Encode memory section contents. Spec reference.
Encode a memory type. Spec reference.
Encode a name. Spec reference.
Encode a result type. Spec reference.
Encode a module section. Spec reference.
Encode start section contents. Spec reference.
Encode table section contents. Spec reference.
Encode a table type. Spec reference.
Encode a value type. Spec reference.
Link to this section Types
Term of a code section item. Spec reference.
Term of a custom section item. Spec reference.
Term of a data section item. Spec reference.
wasm_elem() :: {:elem, wasm_index, wasm_instr, [wasm_index]}
Term of a WebAssembly element. Spec reference.
Term of an element type. Spec reference.
Term of a WebAssembly export. Spec reference.
Terms of floats. Spec reference.
Term of a WebAssembly function. Spec reference.
wasm_func_type() :: {:func_type, [wasm_value_type], [wasm_value_type]}
Term of a funcion type. Spec reference.
wasm_global() :: {:global, wasm_global_type, wasm_instr}
Term of a WebAssembly global. Spec reference.
wasm_global_type() :: {:global_type, :const | :var, wasm_value_type}
Term of a global type. Spec reference.
Term of a WebAssembly import. Spec reference.
wasm_index :: {:type_index, non_neg_integer} | {:func_index, non_neg_integer} | {:table_index, non_neg_integer} | {:mem_index, non_neg_integer} | {:global_index, non_neg_integer} | {:local_index, non_neg_integer} | {:label_index, non_neg_integer}
Term of a WebAssembly index. Spec reference.
wasm_instr :: atom | {atom, wasm_result_type, [wasm_instr]} | {atom, wasm_index} | {atom, [wasm_index], wasm_index} | {atom, wasm_integer, wasm_integer} | {atom, integer} | {atom, [wasm_instr]}
Term of an instruction. Spec reference.
wasm_integer :: {:u32, non_neg_integer} | {:u64, non_neg_integer} | {:s32, integer} | {:s64, integer}
Terms of integers. Spec reference.
wasm_limits :: {:limits, non_neg_integer} | {:limits, non_neg_integer, non_neg_integer}
Term of memory limits. Spec reference.
wasm_locals() :: {:locals, wasm_integer, wasm_value_type}
Term of WebAssembly locals. Spec reference.
Term of a memory section item. Spec reference.
Term of a memory type. Spec reference.
Term of a WebAssembly module. Spec reference.
Term of a name. Spec reference.
Term of a result type. Spec reference.
wasm_section :: {:custom_sec, wasm_custom} | {:type_sec, [wasm_func_type]} | {:import_sec, [wasm_import]} | {:func_sec, [wasm_index]} | {:table_sec, [wasm_table]} | {:memory_sec, [wasm_mem]} | {:global_sec, [wasm_global]} | {:export_sec, [wasm_export]} | {:start_sec, wasm_start} | {:elem_sec, [wasm_elem]} | {:code_sec, [wasm_code]} | {:data_sec, [wasm_data]}
Term of a module section. Spec reference.
Term of a start section item. Spec reference.
Term of a WebAssembly table. Spec reference.
wasm_table_type() :: {:table_type, wasm_elem_type, wasm_limits}
Term of a table type. Spec reference.
Terms of a value type. Spec reference.
Link to this section Functions
Encode a WebAssembly module. Spec reference.
Encode code section contents. Spec reference.
Encode custom section contents. Spec reference.
Encode data section contents. Spec reference.
Encode element section contents. Spec reference.
Encode a table element type. Spec reference.
Encode export section contents. Spec reference.
Encode 32-bit and 64-bit IEEE 754 LE floats. Spec reference.
Encode a func type. Spec reference.
Encode global section contents. Spec reference.
encode_global_type(wasm_global_type) :: binary
Encode a global type. Spec reference.
Encode import section contents. Spec reference.
Encode an index. Spec reference.
Encode instructions. Spec reference.
Encode 32-bit or 64-bit integers that are signed or unsigned. Spec reference.
The LEB128 encoder inspired from funbox/eleb128 and “LEB128” on Wikipedia.
Encode a limit. Spec reference.
Encode memory section contents. Spec reference.
Encode a memory type. Spec reference.
Encode a name. Spec reference.
encode_result_type(wasm_result_type) :: binary
Encode a result type. Spec reference.
Encode a module section. Spec reference.
Encode start section contents. Spec reference.
Encode table section contents. Spec reference.
encode_table_type(wasm_table_type) :: binary
Encode a table type. Spec reference.
encode_value_type(wasm_value_type) :: binary
Encode a value type. Spec reference.