package owi

  1. Overview
  2. Docs
OCaml toolchain to work with WebAssembly, including and interpreter

Install

Dune Dependency

Authors

Maintainers

Sources

0.1.tar.gz
sha256=eb0ee5a97a5310f30002b573f37ae69617688aa95d5e346ef4938ec91972102a
sha512=6aa67b3a8f999965788429a4fdb3f729570958815ab3b55d113d2c52a3fa22485e9e2872fddde5428eb0f726a0ccd5748ba216b4dc337d2b5f01f0bf27fe7701

doc/owi/Owi/Types/index.html

Module Owi.TypesSource

Types of text modules, as produced by the parser. Many parts of it are reused later in the interpreter.

Sourceexception Trap of string

Structure

Types

Sourcetype nonrec num_type =
  1. | I32
  2. | I64
  3. | F32
  4. | F64
Sourcetype nonrec ref_type =
  1. | Func_ref
  2. | Extern_ref
Sourcetype nonrec val_type =
  1. | Num_type of num_type
  2. | Ref_type of ref_type
Sourcetype nonrec param = string option * val_type
Sourcetype nonrec param_type = param list
Sourcetype nonrec result_ = val_type
Sourcetype nonrec result_type = result_ list
Sourcetype nonrec func_type = param_type * result_type
Sourcetype nonrec limits = {
  1. min : int;
  2. max : int option;
}
Sourcetype nonrec mem_type = limits
Sourcetype nonrec table_type = limits * ref_type
Sourcetype nonrec mut =
  1. | Const
  2. | Var
Sourcetype nonrec global_type = mut * val_type
Sourcetype nonrec extern_type =
  1. | Func of string option * func_type
  2. | Table of string option * table_type
  3. | Mem of string option * mem_type
  4. | Global of string option * global_type

Instructions

Sourcetype nonrec nn =
  1. | S32
  2. | S64
Sourcetype nonrec sx =
  1. | U
  2. | S
Sourcetype nonrec iunop =
  1. | Clz
  2. | Ctz
  3. | Popcnt
Sourcetype nonrec funop =
  1. | Abs
  2. | Neg
  3. | Sqrt
  4. | Ceil
  5. | Floor
  6. | Trunc
  7. | Nearest
Sourcetype nonrec ibinop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div of sx
  5. | Rem of sx
  6. | And
  7. | Or
  8. | Xor
  9. | Shl
  10. | Shr of sx
  11. | Rotl
  12. | Rotr
Sourcetype nonrec fbinop =
  1. | Add
  2. | Sub
  3. | Mul
  4. | Div
  5. | Min
  6. | Max
  7. | Copysign
Sourcetype nonrec itestop =
  1. | Eqz
Sourcetype nonrec irelop =
  1. | Eq
  2. | Ne
  3. | Lt of sx
  4. | Gt of sx
  5. | Le of sx
  6. | Ge of sx
Sourcetype nonrec frelop =
  1. | Eq
  2. | Ne
  3. | Lt
  4. | Gt
  5. | Le
  6. | Ge
Sourcetype indice =
  1. | Raw of int
  2. | Symbolic of string
Sourcetype memarg = {
  1. offset : int;
  2. align : int;
}
Sourcetype 'indice block_type =
  1. | Bt_ind of 'indice
  2. | Bt_raw of 'indice option * func_type
Sourcetype ('indice, 'bt) instr' =
  1. | I32_const of Int32.t
  2. | I64_const of Int64.t
  3. | F32_const of Owi.Float32.t
  4. | F64_const of Owi.Float64.t
  5. | I_unop of nn * iunop
  6. | F_unop of nn * funop
  7. | I_binop of nn * ibinop
  8. | F_binop of nn * fbinop
  9. | I_testop of nn * itestop
  10. | I_relop of nn * irelop
  11. | F_relop of nn * frelop
  12. | I_extend8_s of nn
  13. | I_extend16_s of nn
  14. | I64_extend32_s
  15. | I32_wrap_i64
  16. | I64_extend_i32 of sx
  17. | I_trunc_f of nn * nn * sx
  18. | I_trunc_sat_f of nn * nn * sx
  19. | F32_demote_f64
  20. | F64_promote_f32
  21. | F_convert_i of nn * nn * sx
  22. | I_reinterpret_f of nn * nn
  23. | F_reinterpret_i of nn * nn
  24. | Ref_null of ref_type
  25. | Ref_is_null
  26. | Ref_func of 'indice
  27. | Drop
  28. | Select of val_type list option
  29. | Local_get of 'indice
  30. | Local_set of 'indice
  31. | Local_tee of 'indice
  32. | Global_get of 'indice
  33. | Global_set of 'indice
  34. | Table_get of 'indice
  35. | Table_set of 'indice
  36. | Table_size of 'indice
  37. | Table_grow of 'indice
  38. | Table_fill of 'indice
  39. | Table_copy of 'indice * 'indice
  40. | Table_init of 'indice * 'indice
  41. | Elem_drop of 'indice
  42. | I_load of nn * memarg
  43. | F_load of nn * memarg
  44. | I_store of nn * memarg
  45. | F_store of nn * memarg
  46. | I_load8 of nn * sx * memarg
  47. | I_load16 of nn * sx * memarg
  48. | I64_load32 of sx * memarg
  49. | I_store8 of nn * memarg
  50. | I_store16 of nn * memarg
  51. | I64_store32 of memarg
  52. | Memory_size
  53. | Memory_grow
  54. | Memory_fill
  55. | Memory_copy
  56. | Memory_init of 'indice
  57. | Data_drop of 'indice
  58. | Nop
  59. | Unreachable
  60. | Block of string option * 'bt option * ('indice, 'bt) expr'
  61. | Loop of string option * 'bt option * ('indice, 'bt) expr'
  62. | If_else of string option * 'bt option * ('indice, 'bt) expr' * ('indice, 'bt) expr'
  63. | Br of 'indice
  64. | Br_if of 'indice
  65. | Br_table of 'indice array * 'indice
  66. | Return
  67. | Call of 'indice
  68. | Call_indirect of 'indice * 'bt
Sourceand ('indice, 'bt) expr' = ('indice, 'bt) instr' list
Sourcetype simplified_instr = (int, int block_type) instr'
Sourcetype simplified_expr = (int, int block_type) expr'
Sourcetype result_expr = (int, func_type) expr'
Sourcetype ('indice, 'bt) func' = {
  1. type_f : 'bt;
  2. locals : param list;
  3. body : ('indice, 'bt) expr';
  4. id : string option;
}
Sourcetype 'indice func = ('indice, 'indice block_type) func'
Sourcetype table = string option * table_type
Sourcetype mem = string option * mem_type
Sourcetype 'expr global' = {
  1. type_ : global_type;
  2. init : 'expr;
  3. id : string option;
}
Sourcetype ('indice, 'expr) elem_mode =
  1. | Elem_passive
  2. | Elem_active of 'indice * 'expr
  3. | Elem_declarative
Sourcetype ('indice, 'expr) elem' = {
  1. id : string option;
  2. type_ : ref_type;
  3. init : 'expr list;
  4. mode : ('indice, 'expr) elem_mode;
}
Sourcetype elem = (indice option, (indice, indice block_type) expr') elem'
Sourcetype ('indice, 'expr) data_mode =
  1. | Data_passive
  2. | Data_active of 'indice * 'expr
Sourcetype ('indice, 'expr) data' = {
  1. id : string option;
  2. init : string;
  3. mode : ('indice, 'expr) data_mode;
}
Sourcetype data = (indice option, (indice, indice block_type) expr') data'
Sourcetype import_desc =
  1. | Import_func of string option * indice block_type
  2. | Import_table of string option * table_type
  3. | Import_mem of string option * mem_type
  4. | Import_global of string option * global_type
Sourcetype import = {
  1. module_ : string;
  2. name : string;
  3. desc : import_desc;
}
Sourcetype 'indice export_desc' =
  1. | Export_func of 'indice option
  2. | Export_table of 'indice option
  3. | Export_mem of 'indice option
  4. | Export_global of 'indice option
Sourcetype export_desc = indice export_desc'
Sourcetype 'indice export' = {
  1. name : string;
  2. desc : 'indice export_desc';
}
Sourcetype export = indice export'
Sourcetype type_ = string option * func_type
Sourcetype module_field =
  1. | MType of type_
  2. | MGlobal of global
  3. | MTable of table
  4. | MMem of mem
  5. | MFunc of indice func
  6. | MElem of elem
  7. | MData of data
  8. | MStart of indice
  9. | MImport of import
  10. | MExport of export
Sourcetype module_ = {
  1. id : string option;
  2. fields : module_field list;
}
Sourcetype const =
  1. | Const_I32 of Int32.t
  2. | Const_I64 of Int64.t
  3. | Const_F32 of Owi.Float32.t
  4. | Const_F64 of Owi.Float64.t
  5. | Const_null of ref_type
  6. | Const_host of int
Sourcetype action =
  1. | Invoke of string option * string * const list
  2. | Get of string option * string
Sourcetype result_const =
  1. | Literal of const
  2. | Nan_canon of nn
  3. | Nan_arith of nn
Sourcetype result =
  1. | Result_const of result_const
  2. | Result_extern_ref
  3. | Result_func_ref
Sourcetype assert_ =
  1. | Assert_return of action * result list
  2. | Assert_trap of action * string
  3. | Assert_trap_module of module_ * string
  4. | Assert_malformed of module_ * string
  5. | Assert_malformed_quote of string list * string
  6. | Assert_malformed_binary of string list * string
  7. | Assert_invalid of module_ * string
  8. | Assert_invalid_quote of string list * string
  9. | Assert_invalid_binary of string list * string
  10. | Assert_exhaustion of action * string
  11. | Assert_unlinkable of module_ * string
Sourcetype cmd =
  1. | Module of module_
  2. | Assert of assert_
  3. | Register of string * string option
  4. | Action of action
Sourcetype script = cmd list
Sourcemodule Const : sig ... end
OCaml

Innovation. Community. Security.