Liking cljdoc? Tell your friends :D

helins.wasm.write

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.
raw docstring

block'clj/s

(block' view flatidx opvec)

blocktype'clj/s

(blocktype' view blocktype)

br'clj/s

(br' view _flatidx opvec)

br_if'clj/s

(br_if' view _flatidx opvec)

br_table'clj/s

(br_table' view _flatidx opvec)

byte'clj/s

(byte' view b8)

call'clj/s

(call' view flatidx opvec)

call_indirect'clj/s

(call_indirect' view flatidx opvec)

code'clj/s

(code' view flatidx n-byte code)

codesec'clj/s

(codesec' view {:as ctx :wasm/keys [codesec]})

data-drop'clj/s

(data-drop' view flatidx opvec)

datacountsec'clj/s

(datacountsec' view {:as ctx :wasm/keys [datacountsec]})

dataidx'clj/s


datasec'clj/s

(datasec' view {:as ctx :wasm/keys [datasec]})

elem-drop'clj/s

(elem-drop' view flatidx opvec)

elemidx'clj/s


elemkind'clj/s

(elemkind' view elemkind)

elemsec'clj/s

(elemsec' view {:as ctx :wasm/keys [elemsec]})

elemtype'clj/s


else'clj/s

(else' view flatidx instr+)

end'clj/s

(end' view)

export'clj/s

(export' view space flatidx bin-export-type compile-idx)

exportsec'clj/s

(exportsec'
  view
  {:wasm/keys [exportsec]
   {:as ctx-write n-byte- :wasm.count/exportsec n-export :wasm.export/n}
     :wasm/write})

expr'clj/s

(expr' view flatidx opvec+)

For a vector of instr'.

For a vector of [[instr']].
raw docstring

f32'clj/s

(f32' view f32)

f64'clj/s

(f64' view f64)

funcclj/s

(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.
raw docstring

func'clj/s

(func' view flatidx {:wasm/keys [expr locals]})

funcidx'clj/s


funcsec'clj/s

(funcsec' view ctx)

functype'clj/s

(functype' view [param+ result+])

global'clj/s

(global' view flatidx global)

globalidx'clj/s


globalsec'clj/s

(globalsec' view {:as ctx ctx-write :wasm/write})

globaltype'clj/s

(globaltype' view {:wasm/keys [mutable? valtype]})

i32'clj/s

(i32' view i32)

i64'clj/s

(i64' view i64)

idxclj/s

(idx view idx)

if'clj/s

(if' view flatidx opvec)

import'+clj/s

(import'+ view space import-type f)

importsec'clj/s

(importsec' view
            {:wasm/keys [importsec]
             {flatidx-type :wasm.flatidx/type
              n-byte- :wasm.count/importsec
              n-import :wasm.import/n}
               :wasm/write})

instr'clj/s

(instr' view flatidx opvec)

instr'+clj/s

(instr'+ view flatidx opvec+)

Behaves same as expr'.

Behaves same as [[expr']].
raw docstring

labelidx'clj/s


limits'clj/s

(limits' view {min- :wasm.limit/min max- :wasm.limit/max})

localidx'clj/s


locals'clj/s

(locals' view locals)

loop'clj/s

(loop' view flatidx opvec)

magic'clj/s

(magic' view)

memarg'clj/s

(memarg' view [align offset])

memidx'clj/s


memory-copy'clj/s

(memory-copy' view _flatidx opvec)

memory-fill'clj/s

(memory-fill' view _flatidx opvec)

memory-init'clj/s

(memory-init' view flatidx opvec)

memsec'clj/s

(memsec' view ctx)

memtype'clj/s

(memtype' view hmap)

module'clj/s

(module' view ctx)

mut'clj/s

(mut' view mutable?)

name'clj/s

(name' view buffer)

op-constvalclj/s

(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.
raw docstring

op-main->fclj/s

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
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
raw docstring

op-memargclj/s

(op-memarg view _flatidx opvec)

Used for memory instructions that have a memarg'.

Used for memory instructions that have a [[memarg']].
raw docstring

op-memoryclj/s

(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.
raw docstring

op-misc->fclj/s

Map of immediate to "misc" opcode (0xFC) -> reading function.

Map of **immediate to "misc" opcode (0xFC)** -> **reading function**.
raw docstring

op-tableclj/s

(op-table view flatidx opvec)

Table instruction involving a table index immediate.

Table instruction involving a table index immediate.
raw docstring

op-table-miscclj/s

(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).
raw docstring

op-var-globalclj/s

(op-var-global view flatidx opvec)

Used for global variable instructions.

Used for global variable instructions.
raw docstring

op-var-localclj/s

(op-var-local view _flatidx opvec)

Used for local variable instructions.

Used for local variable instructions.
raw docstring

opcode'clj/s


ref-func'clj/s

(ref-func' view flatidx opvec)

ref-null'clj/s

(ref-null' view _flatidx opvec)

reftype'clj/s

(reftype' view reftype)

resulttype'clj/s

(resulttype' view valtype+)

s33'clj/s

(s33' view s33)

section'+clj/s

(section'+ view ctx)

Writes all existing sections.

Used by module'.

Writes all existing sections.

Used by [[module']].
raw docstring

section-externvalclj/s

(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...)
raw docstring

section-id'clj/s

(section-id' view section-id)

select-t'clj/s

(select-t' view _flatidx opvec)

startsec'clj/s

(startsec' view {:as ctx :wasm/keys [startsec]})

table-copy'clj/s

(table-copy' view flatidx opvec)

table-init'clj/s

(table-init' view flatidx opvec)

tableidx'clj/s


tablesec'clj/s

(tablesec' view ctx)

tabletype'clj/s

(tabletype' view hmap)

typeidx'clj/s


typesec'clj/s

(typesec' view {:as ctx :wasm/keys [typesec]})

u32'clj/s

(u32' view u32)

valtype'clj/s

(valtype' view valtype)

vec'clj/s

(vec' view f-item coll)

version'clj/s

(version' view {:wasm/keys [version]})

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close