Skip to content

Data Representation

Andrew Johnson edited this page Oct 2, 2024 · 7 revisions

All types, including datatypes, only exist within the type system. Whenever a piece of code tries to construct, access, or otherwise manipulate a piece of data it needs to be projected out to create a code fragment. This process is called "representation selection". Representation Selection is mostly handled by the standard library, however there is room for customization or replacement with alternative schemes if you feel so inclined.

Storage Schemes

Default storage schemes are Constant, Reg8, Reg16, Reg32, Reg64, StackVariable, LocalVariable, and GlobalVariable. Constants are known at compile time and don't require runtime storage until they need to be constructed. Registers are either 8 bit, 16 bit, 32 bit, or 64 bit registers. Stack Variables are memory locations referenced relative to the stack pointer. Local Variables are memory locations referenced relative to the base pointer. Global Variables are .data section program locations.

Clone this wiki locally