package owi

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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

runtime env

type 'f module_to_run = {
  1. modul : Simplified.modul;
  2. env : 'f Link_env.t;
  3. to_run : Types.simplified Types.expr list;
}

runnable module

module StringMap : Map.S with type key = string
module StringSet : Set.S
type func := Func_intf.t
type exports = {
  1. globals : Concrete_global.t StringMap.t;
  2. memories : Concrete_memory.t StringMap.t;
  3. tables : Concrete_table.t StringMap.t;
  4. functions : func StringMap.t;
  5. defined_names : StringSet.t;
}

runtime exported items

type 'ext envs = 'ext Link_env.t Env_id.collection
type 'f state = {
  1. by_name : exports StringMap.t;
  2. by_id : (exports * Env_id.t) StringMap.t;
  3. last : (exports * Env_id.t) option;
  4. collection : 'f Func_id.collection;
  5. envs : 'f envs;
}

link state

val empty_state : 'f state

the empty link state

val modul : 'f state -> name:string option -> Simplified.modul -> ('f module_to_run * 'f state) Result.t

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

val register_module : 'f state -> name:string -> id:string option -> 'f state Result.t

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

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

extern modules

val extern_module' : 'f state -> name:string -> func_typ:('f -> Types.simplified Types.func_type) -> 'f extern_module -> 'f state

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