Writing a WASM module represented as Clojure data structures to a BinF view. In other words, compilation.
Unless one wants to design a custom module compilation environment, ultimately, one should use the compile
function
from the helins.wasm
namespace which does all the job for compiling a whole WASM module.
For writing sections, things must be prepared with the helins.wasm.count
namespace.
See README for namespace organization and naming scheme.
Writing a WASM module represented as Clojure data structures to a BinF view. In other words, compilation. Unless one wants to design a custom module compilation environment, ultimately, one should use the `compile` function from the `helins.wasm` namespace which does all the job for compiling a whole WASM module. For writing sections, things must be prepared with the [[helins.wasm.count]] namespace. See README for namespace organization and naming scheme.
(block' view flatidx opvec)
(blocktype' view blocktype)
(br' view _flatidx opvec)
(br_if' view _flatidx opvec)
(br_table' view _flatidx opvec)
(byte' view b8)
(call' view flatidx opvec)
(call_indirect' view flatidx opvec)
(code' view flatidx n-byte code)
(codesec' view {:as ctx :wasm/keys [codesec]})
(data-drop' view flatidx opvec)
(datacountsec' view {:as ctx :wasm/keys [datacountsec]})
(datasec' view {:as ctx :wasm/keys [datasec]})
(elem-drop' view flatidx opvec)
(elemkind' view elemkind)
(elemsec' view {:as ctx :wasm/keys [elemsec]})
(else' view flatidx instr+)
(end' view)
(export' view space flatidx bin-export-type compile-idx)
(exportsec'
view
{:wasm/keys [exportsec]
{:as ctx-write n-byte- :wasm.count/exportsec n-export :wasm.export/n}
:wasm/write})
(expr' view flatidx opvec+)
For a vector of instr'
.
For a vector of [[instr']].
(f32' view f32)
(f64' view f64)
(func view flatidx-type {:wasm/keys [typeidx]})
For functions found in the funcsec and in imports.
WASM specification does not have a special name for it since binary-wise it is simply a type index.
For functions found in the funcsec and in imports. WASM specification does not have a special name for it since binary-wise it is simply a type index.
(func' view flatidx {:wasm/keys [expr locals]})
(funcsec' view ctx)
(functype' view [param+ result+])
(global' view flatidx global)
(globalsec' view {:as ctx ctx-write :wasm/write})
(globaltype' view {:wasm/keys [mutable? valtype]})
(i32' view i32)
(i64' view i64)
(idx view idx)
(if' view flatidx opvec)
(import'+ view space import-type f)
(importsec' view
{:wasm/keys [importsec]
{flatidx-type :wasm.flatidx/type
n-byte- :wasm.count/importsec
n-import :wasm.import/n}
:wasm/write})
(instr' view flatidx opvec)
(instr'+ view flatidx opvec+)
Behaves same as expr'
.
Behaves same as [[expr']].
(limits' view {min- :wasm.limit/min max- :wasm.limit/max})
(locals' view locals)
(loop' view flatidx opvec)
(magic' view)
(memarg' view [align offset])
(memory-copy' view _flatidx opvec)
(memory-fill' view _flatidx opvec)
(memory-init' view flatidx opvec)
(memsec' view ctx)
(memtype' view hmap)
(module' view ctx)
(mut' view mutable?)
(name' view buffer)
(op-constval f-value)
(op-constval f-value view _flatidx opvec)
Used for numerical operations declaring a constant value.
Used for numerical operations declaring a constant value.
Map of opcode -> reading function for opcodes which:
Map of **opcode** -> **reading function** for opcodes which: - Have any kind of immediate(s) - Is not 0xFC (the "misc" opcode that leads to a second-level opcode
(op-memarg view _flatidx opvec)
Used for memory instructions that have a memarg'
.
Used for memory instructions that have a [[memarg']].
(op-memory view flatidx opvec)
Used for memory instructions that have a memidx'
as only immediate.
Used for memory instructions that have a [[memidx']] as only immediate.
Map of immediate to "misc" opcode (0xFC) -> reading function.
Map of **immediate to "misc" opcode (0xFC)** -> **reading function**.
(op-table view flatidx opvec)
Table instruction involving a table index immediate.
Table instruction involving a table index immediate.
(op-table-misc view flatidx opvec)
Table instruction involving a table index immediate (prefixed with the 0xFC "misc" opcode).
Table instruction involving a table index immediate (prefixed with the 0xFC "misc" opcode).
(op-var-global view flatidx opvec)
Used for global variable instructions.
Used for global variable instructions.
(op-var-local view _flatidx opvec)
Used for local variable instructions.
Used for local variable instructions.
(ref-func' view flatidx opvec)
(ref-null' view _flatidx opvec)
(reftype' view reftype)
(resulttype' view valtype+)
(s33' view s33)
(section'+ view ctx)
Writes all existing sections.
Used by module'
.
Writes all existing sections. Used by [[module']].
(section-externval view ctx k-section bin-section-id k-count compile-item)
Helper for writing sections about WASM externval (eg. funcsec, memsec, tablesec...)
Helper for writing sections about WASM **externval** (eg. funcsec, memsec, tablesec...)
(section-id' view section-id)
(select-t' view _flatidx opvec)
(startsec' view {:as ctx :wasm/keys [startsec]})
(table-copy' view flatidx opvec)
(table-init' view flatidx opvec)
(tablesec' view ctx)
(tabletype' view hmap)
(typesec' view {:as ctx :wasm/keys [typesec]})
(u32' view u32)
(valtype' view valtype)
(vec' view f-item coll)
(version' view {:wasm/keys [version]})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close