marianoguerra/wax/wasm/types does not have a README file

    FieldType

    type FieldType[Idx] = MutType[StorageType[Idx]]

    A struct field or array element type.

    GlobalType

    type GlobalType[Idx] = MutType[ValType[Idx]]

    A global's type.

    AddressType

    pub(all) enum AddressType {
    I32
    I64
    } derive(Eq,
    Debug
    )

    Whether a memory or table is indexed by i32 or i64 (memory64).

    CmpOp

    pub(all) enum CmpOp {
    Eq
    Ne
    Lt
    Gt
    Le
    Ge
    } derive(Eq,
    Debug
    )

    Comparison operators available inside a conditional-compilation condition.

    Cond

    A conditional-compilation condition, from #[if(...)].

    Evaluated against the -D variables, not against program values: it decides which source survives, so it belongs to the type layer rather than the instruction layer.

    HeapType

    pub(all) enum HeapType[Idx] {
    Func
    NoFunc
    Exn
    NoExn
    Cont
    NoCont
    Extern
    NoExtern
    Any
    Eq
    I31
    Struct
    Array
    None_
    Type(Idx)
    Exact(Idx)
    } derive(Eq, Hash,
    Debug
    )

    A heap type: what a reference can point at.

    The No* cases are the bottom types of each hierarchy (nofunc is a subtype of every function type and has no values), and None_ is the bottom of the internal hierarchy. Type names a concrete defined type; Exact names one and forbids subtypes, which is the custom-descriptors proposal's &!t.

    HeapType::keyword

    fn[Idx] HeapType::keyword(self : HeapType[Idx]) -> String?

    The keyword naming a heap type, or None for the two that carry an index.

    The index-carrying cases have no keyword because each printer spells the index its own way -- by name in Wax, by number in the binary form.

    Limits

    pub(all) struct Limits {
    mi : UInt64
    ma : UInt64?
    address_type : AddressType
    page_size_log2 : Int?
    shared : Bool
    } derive(Eq,
    Debug
    )

    The size bounds of a memory or table.

    page_size_log2 is the base-2 logarithm of a custom page size (the custom-page-sizes proposal); None means the default 65536. It is stored as the logarithm rather than the size because that is what the binary format encodes, so round-tripping cannot lose a non-power-of-two spelling.

    mi/ma are u64 to cover 64-bit memories. MoonBit's UInt64 is used directly where the reference has its own Uint64 module.

    MutType

    pub(all) struct MutType[T] {
    mut_ : Bool
    typ : T
    } derive(Eq, Hash,
    Debug
    )

    A type paired with its mutability. Used for both globals and struct fields, which is why it is generic in the thing being made mutable.

    PackedType

    pub(all) enum PackedType {
    I8
    I16
    } derive(Eq, Hash,
    Debug
    )

    A packed storage type. These exist only in struct fields and arrays: there is no i8 or i16 on the operand stack, so they are not value types.

    RefType

    pub(all) struct RefType[Idx] {
    nullable : Bool
    typ : HeapType[Idx]
    } derive(Eq, Hash,
    Debug
    )

    A reference type: a heap type plus whether null is allowed.

    Signage

    pub(all) enum Signage {
    Signed
    Unsigned
    } derive(Eq,
    Debug
    )

    Signedness, where WebAssembly needs an operation to state it.

    StorageType

    pub(all) enum StorageType[Idx] {
    Value(ValType[Idx])
    Packed(PackedType)
    } derive(Eq, Hash,
    Debug
    )

    What a struct field or array element stores.

    V128

    pub(all) struct V128 {
    shape : V128Shape
    components : Array[String]
    } derive(Eq,
    Debug
    )

    A 128-bit vector literal, kept as its shape plus the raw component strings.

    The components stay unparsed for the same reason numeric literals do: the printer has to reproduce what was written, and a v128 can be spelled in six different shapes.

    V128Shape

    pub(all) enum V128Shape {
    I8x16
    I16x8
    I32x4
    I64x2
    F32x4
    F64x2
    } derive(Eq,
    Debug
    )

    V128Shape::to_str

    fn V128Shape::to_str(self : V128Shape) -> String

    ValType

    pub(all) enum ValType[Idx] {
    I32
    I64
    F32
    F64
    V128
    Ref(RefType[Idx])
    } derive(Eq, Hash,
    Debug
    )

    A value type -- what a local, parameter or stack slot holds.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io