Records

A record is an abstract data type containing a series of named fields. It has no associated behaviour and acts as a way to group data together. In C++, this would be referred to as a plain old data type.

Depending on the language, records may be expressed in in different ways.

LanguageEquivalent Construct
RustStruct
CStruct
PythonData Class
TypeScriptType alias

Syntax

A record contains a list of fields, where each field must be given a type.

record person {
    name: string,
    age: u32,
    has-lego-action-figure: bool,
}

For a more details, consult the Item: record section in the *.wai format.