package owi

  1. Overview
  2. Docs

Module to link a simplified/extern module and producing a runnable module along with a link state.

module Memory : sig ... end

runtime memory

module Table : sig ... end

runtime table

module Global : sig ... end

runtime global

module Env : sig ... end

runtime env

type module_to_run = {
  1. module_ : Simplify.simplified_module;
  2. env : Env.t;
  3. to_run : (int, Types.func_type) Types.expr' list;
}

runnable module

module StringMap : Map.S with type key = string
module StringSet : Set.S
type exports = {
  1. globals : Env.t' Global.t StringMap.t;
  2. memories : Memory.t StringMap.t;
  3. tables : Env.t' Table.t StringMap.t;
  4. functions : Env.t' Value.Func.t StringMap.t;
  5. defined_names : StringSet.t;
}

runtime exported items

type state = {
  1. by_name : exports StringMap.t;
  2. by_id : exports StringMap.t;
  3. last : exports option;
}

link state

val empty_state : state

the empty link state

link a module with a given link state, producing a runnable module and a new link state

val register_module : state -> name:string -> id:string option -> state

register a module inside a link state, producing a new link state

type extern_module = {
  1. functions : (string * Value.Func.extern_func) list;
}

extern modules

val extern_module : string -> extern_module -> state -> state

register an extern module with a given link state, producing a new link state

OCaml

Innovation. Community. Security.