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)
source

blocktype'clj/s

(blocktype' view blocktype)
source

br'clj/s

(br' view _flatidx opvec)
source

br_if'clj/s

(br_if' view _flatidx opvec)
source

br_table'clj/s

(br_table' view _flatidx opvec)
source

byte'clj/s

(byte' view b8)
source

call'clj/s

(call' view flatidx opvec)
source

call_indirect'clj/s

(call_indirect' view flatidx opvec)
source

code'clj/s

(code' view flatidx n-byte code)
source

codesec'clj/s

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

data-drop'clj/s

(data-drop' view flatidx opvec)
source

datacountsec'clj/s

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

dataidx'clj/s

source

datasec'clj/s

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

elem-drop'clj/s

(elem-drop' view flatidx opvec)
source

elemidx'clj/s

source

elemkind'clj/s

(elemkind' view elemkind)
source

elemsec'clj/s

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

elemtype'clj/s

source

else'clj/s

(else' view flatidx instr+)
source

end'clj/s

(end' view)
source

export'clj/s

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

exportsec'clj/s

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

expr'clj/s

(expr' view flatidx opvec+)

For a vector of instr'.

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

f32'clj/s

(f32' view f32)
source

f64'clj/s

(f64' view f64)
source

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

func'clj/s

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

funcidx'clj/s

source

funcsec'clj/s

(funcsec' view ctx)
source

functype'clj/s

(functype' view [param+ result+])
source

global'clj/s

(global' view flatidx global)
source

globalidx'clj/s

source

globalsec'clj/s

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

globaltype'clj/s

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

i32'clj/s

(i32' view i32)
source

i64'clj/s

(i64' view i64)
source

idxclj/s

(idx view idx)
source

if'clj/s

(if' view flatidx opvec)
source

import'+clj/s

(import'+ view space import-type f)
source

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})
source

instr'clj/s

(instr' view flatidx opvec)
source

instr'+clj/s

(instr'+ view flatidx opvec+)

Behaves same as expr'.

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

labelidx'clj/s

source

limits'clj/s

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

localidx'clj/s

source

locals'clj/s

(locals' view locals)
source

loop'clj/s

(loop' view flatidx opvec)
source

magic'clj/s

(magic' view)
source

memarg'clj/s

(memarg' view [align offset])
source

memidx'clj/s

source

memory-copy'clj/s

(memory-copy' view _flatidx opvec)
source

memory-fill'clj/s

(memory-fill' view _flatidx opvec)
source

memory-init'clj/s

(memory-init' view flatidx opvec)
source

memsec'clj/s

(memsec' view ctx)
source

memtype'clj/s

(memtype' view hmap)
source

module'clj/s

(module' view ctx)
source

mut'clj/s

(mut' view mutable?)
source

name'clj/s

(name' view buffer)
source

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.
sourceraw 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
sourceraw 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']].
sourceraw 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.
sourceraw docstring

op-misc->fclj/s

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

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

op-tableclj/s

(op-table view flatidx opvec)

Table instruction involving a table index immediate.

Table instruction involving a table index immediate.
sourceraw 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).
sourceraw docstring

op-var-globalclj/s

(op-var-global view flatidx opvec)

Used for global variable instructions.

Used for global variable instructions.
sourceraw docstring

op-var-localclj/s

(op-var-local view _flatidx opvec)

Used for local variable instructions.

Used for local variable instructions.
sourceraw docstring

opcode'clj/s

source

ref-func'clj/s

(ref-func' view flatidx opvec)
source

ref-null'clj/s

(ref-null' view _flatidx opvec)
source

reftype'clj/s

(reftype' view reftype)
source

resulttype'clj/s

(resulttype' view valtype+)
source

s33'clj/s

(s33' view s33)
source

section'+clj/s

(section'+ view ctx)

Writes all existing sections.

Used by module'.

Writes all existing sections.

Used by [[module']].
sourceraw 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...)
sourceraw docstring

section-id'clj/s

(section-id' view section-id)
source

select-t'clj/s

(select-t' view _flatidx opvec)
source

startsec'clj/s

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

table-copy'clj/s

(table-copy' view flatidx opvec)
source

table-init'clj/s

(table-init' view flatidx opvec)
source

tableidx'clj/s

source

tablesec'clj/s

(tablesec' view ctx)
source

tabletype'clj/s

(tabletype' view hmap)
source

typeidx'clj/s

source

typesec'clj/s

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

u32'clj/s

(u32' view u32)
source

valtype'clj/s

(valtype' view valtype)
source

vec'clj/s

(vec' view f-item coll)
source

version'clj/s

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

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

× close