ODL – Object Definition Language

A declarative language for strongly‑typed, multi‑dimensional objects that map directly to the 32 Channel Data Types. Part of the Web4 Channel Paradigm.

1. Type System

All types are based on stdint.h names. char is a 16‑bit unsigned integer (uint16_t), representing a Unicode code unit (like Java's char). For 8‑bit ASCII bytes use byte8_t (alias for int8_t).

ODL Type NameChannel Data TypeBytesSignedDescription
int8_t / byte8_tDATA_BYTE (0)1yes8‑bit signed integer / ASCII byte
uint8_tDATA_BYTE (0) + SIGN bit1no8‑bit unsigned integer
int16_tDATA_SHORT (1)2yes16‑bit signed integer
uint16_tDATA_SHORT (1) + SIGN bit2no16‑bit unsigned integer
charDATA_CHAR (2)2noUTF‑16 code unit (uint16_t, like Java char)
int32_tDATA_INT (3)4yes32‑bit signed integer
uint32_tDATA_INT (3) + SIGN bit4no32‑bit unsigned integer
int64_tDATA_LONG (4)8yes64‑bit signed integer
uint64_tDATA_LONG (4) + SIGN bit8no64‑bit unsigned integer
floatDATA_FLOAT (5)432‑bit IEEE‑754 float
doubleDATA_DOUBLE (6)864‑bit IEEE‑754 double
ObjectDATA_OBJECT (7)ptrReference to another ODL Object

2. Memory Types

Every object or individual field can be tagged with a memory type prefix. If omitted, HEAP is assumed. The prefix may appear before the OBJECT keyword (applying to all fields) or before a specific field declaration (overriding the object default).

PrefixMemory TypeDescription
HEAP (or none)HEAP_MEMORY (0)Standard calloc‑allocated memory
STACKSTACK_MEMORY (1)Stack‑allocated, size limited
IPCIPC_MEMORY (2)Inter‑process shared memory
GPUGPU_MEMORY (3)Graphics device memory (global/texture/local)
CLOUDCLOUD_MEMORY (4)Remote cloud storage
REGISTRYREGISTRY_MEMORY (5)Persistent key‑value store
PAGEPAGE_MEMORY (6)Paged memory

3. Field Declaration Syntax

// Full field syntax
[storage] type [dims...] name [= initializer] [, name [= initializer]...] ;

// Examples
GPU float matrix[3][3] = 1,0,0, 0,1,0, 0,0,1;
STACK char name[8] = 72,101,108,108,111;          // "Hello"
int64_t x[]=10, y[]=20, z[]=30;                   // three sparse 1D arrays
Object engine = Engine;                           // shared reference
Object drive = {Drive, int32_t rpm, float torque}; // inline definition

3.1 Initializer Forms

Flat comma‑separated list (row‑major for multi‑dim arrays):

uint32_t numbers[5] = 1,2,3,4,5;
float   mat[2][2] = 1.0,0.0,0.0,1.0;    // row‑major 2×2 identity

Aggregate brace initializers (optional, for clarity):

float   v[3]     = {1.0, 2.0, 3.0};
int16_t mat[2][3] = { {1,2,3}, {4,5,6} };

Object initializers (reference or inline):

Object engine = Engine;
Object drive  = {Drive, int32_t rpm=5000};

4. Complete Type Permutation Reference

All 32 Channel Data types with scalar, 1D, 2D, and 3D examples.

4.1 DATA_BYTE – int8_t, byte8_t, uint8_t

// Scalar
int8_t  signed_byte;
uint8_t unsigned_byte = 200;
byte8_t ascii_byte   = 65;          // 'A'

// 1D array
byte8_t ascii_str[]   = 72,101,108,108,111;  // "Hello"
uint8_t mac[6]       = {0x00,0x11,0x22,0x33,0x44,0x55};
int8_t  temps[]      = {-10, -5, 0, 5};          // sparse → 4

// 2D array
int8_t  image[2][3]   = { {0,1,2}, {3,4,5} };
uint8_t chess[8][8]   = { {0} };          // first row 0, rest zero

// 3D array
uint8_t voxel[2][2][2] = { {{0,1},{2,3}}, {{4,5},{6,7}} };

4.2 DATA_SHORT – int16_t, uint16_t

int16_t  signed_16;
uint16_t port = 8080;
uint16_t rgb[3]      = {255, 128, 0};
int16_t  coords[2][2] = { {0,1}, {2,3} };
uint16_t cube[2][2][2] = { {{0,1},{2,3}}, {{4,5},{6,7}} };

4.3 DATA_CHAR – char (uint16_t Unicode)

// char is a 16‑bit unsigned value (uint16_t), representing a Unicode code unit.
// Use byte8_t for 8‑bit ASCII.
char letter = 65;            // 'A' (U+0041)
char name[5] = 72,101,108,108,111;  // "Hello" (each value is a code point)
char glyphs[2][3] = { {65,66,67}, {68,69,70} };  // ABC / DEF
char tensor[2][2][2] = { {{65,66},{67,68}}, {{69,70},{71,72}} };

4.4 DATA_INT – int32_t, uint32_t

int32_t  cpu_id = 0xCAFEBABE;
uint32_t mask   = 0xFFFFFFFF;
int32_t  lanes[4] = {1,2,3,4};
uint32_t screen[1920][1080];
int32_t  histogram[256][256][3] = { {{0}} };

4.5 DATA_LONG – int64_t, uint64_t

int64_t  stars = 200000000000;
uint64_t max_addr = 0xFFFFFFFFFFFFFFFF;
int64_t  big_array[1000];
uint64_t matrix[3][3] = { {1,0,0}, {0,1,0}, {0,0,1} };
int64_t  space[2][2][2] = { {{0,1},{2,3}}, {{4,5},{6,7}} };

4.6 DATA_FLOAT – float

float temperature = -273.15;
float vec3[3]     = {1.0, 0.0, 0.0};
float rot[3][3]   = { {1,0,0}, {0,1,0}, {0,0,1} };
float volume[2][2][2] = { {{0.1,0.2},{0.3,0.4}}, {{0.5,0.6},{0.7,0.8}} };

4.7 DATA_DOUBLE – double

double pi = 3.141592653589793;
double vec[3] = {1e10, 2e10, 3e10};
double mat[2][2] = { {0.0,1.0}, {2.0,3.0} };
double cube[2][2][2] = { {{0.0,1.1},{2.2,3.3}}, {{4.4,5.5},{6.6,7.7}} };

4.8 DATA_OBJECT – Object

Object engine;
Object engine = Engine;
Object engine = {Engine, int32_t hp};
Object parts[3] = {Engine, Wheel, Door};
Object grid[2][2] = { { {Cell, int32_t x}, {Cell, int32_t y} },
                      { {Cell, int32_t z}, {Cell, int32_t w} } };

5. Example Objects

A collection of practical, tech‑flavoured object definitions using various types, dimensions, nested objects, and storage prefixes.

quantum QuantumProcessor

Superconducting quantum processor with calibration matrix and nested qubit grid.

OBJECT QuantumProcessor;
    int32_t qubits = 127;
    float   gate_fidelity[2][2] = 0.999, 0.001, 0.001, 0.999;
    double  coherence_time_us = 150.0;
    Object calibration = {Calibration, float offset[127]};

space SatelliteTelemetry

LEO satellite telemetry with GPS‑derived position and velocity.

OBJECT SatelliteTelemetry;
    int64_t timestamp_unix = 1715900000;
    float   position_eci[3] = {6771.0, -1240.0, 0.012};
    float   velocity_eci[3] = {2.1, 5.7, 0.03};
    double  battery_voltage = 3.7;

ai NeuralNetworkLayer

Fully‑connected layer with weight matrix and bias vector on GPU.

GPU OBJECT NeuralNetworkLayer;
    int32_t input_size  = 784;
    int32_t output_size = 128;
    float   weights[784][128];
    float   biases[128];

embedded FirmwareImage

OTA firmware image with checksum and bootloader reference.

OBJECT FirmwareImage;
    uint32_t magic   = 0xDEADBEEF;
    uint32_t version = 20240601;
    uint8_t  data[262144] = 0,1,2,3,4,5,6,7,8,9;
    uint32_t crc32;
    Object   bootloader = {Bootloader, uint32_t entry=0x08000000};

telecom GPRSPacket

GPRS data packet with header, payload, and signal strength.

OBJECT GPRSPacket;
    uint8_t  header[12] = 0,1,2,3,4,5,6,7,8,9,10,11;
    uint16_t payload[8] = {0x1234, 0x5678, 0x9ABC, 0xDEF0, 0x1111, 0x2222, 0x3333, 0x4444};
    float    signal_strength = -45.5;
    int32_t  timestamp = 1640995200;

aerospace RocketEngine

A staged rocket engine with thrust, ISP, and a nested turbopump.

OBJECT RocketEngine;
    float   thrust_n = 45000.0;
    float   isp_s = 320.0;
    Object turbopump = {Turbopump, float flow_rate=25.5, uint16_t max_rpm=12000};

robotics LidarScan

A 360° LiDAR scan with angle‑intensity pairs and point cloud data.

OBJECT LidarScan;
    uint16_t num_points = 2048;
    float    angles[2048];
    float    distances[2048];
    uint8_t  intensities[2048];

autonomy DroneFlightPlan

A multi‑waypoint flight plan with safety parameters and nested camera settings.

OBJECT DroneFlightPlan;
    int32_t  mission_id = 42069;
    double   waypoints[10][3] = { {48.8566,2.3522,100}, {48.8570,2.3530,110} };
    float    max_altitude = 120.0;
    Object  camera = {Camera, uint16_t res[2]=1920,1080, float focal=3.5};

crypto BlockchainBlock

A simplified blockchain block with previous hash, Merkle root, and nested transactions.

OBJECT BlockchainBlock;
    int64_t  index = 1000;
    uint8_t  prev_hash[32] = 0xAB,0xCD,0xEF,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D;
    uint8_t  merkle_root[32];
    Object   transactions[100];

iot WeatherStation

An IoT weather station with sensor readings and GPS location.

OBJECT WeatherStation;
    float   temperature = 22.5;
    float   humidity = 65.0;
    float   pressure_hpa = 1013.25;
    double  lat = 51.5074;
    double  lon = -0.1278;

graphics RenderPipeline

A Vulkan‑style render pipeline configuration with shader stages and GPU memory buffers.

OBJECT RenderPipeline;
    uint32_t vertex_shader_id = 0xAABBCCDD;
    uint32_t fragment_shader_id = 0x11223344;
    GPU float   uniform_buffer[64];
    GPU Object  textures[4] = {Albedo, Normal, Roughness, Emissive};

xr HoloLensSpatialMap

A spatial mapping mesh for mixed reality, with vertex buffer and nested surface object.

OBJECT HoloLensSpatialMap;
    int32_t  vertex_count = 500000;
    int32_t  triangle_count = 1000000;
    GPU float   vertices[500000][3];
    GPU uint32_t indices[1000000][3];
    Object  surface = {SurfaceMaterial, float roughness=0.8, float metallic=0.0};

6. Memory Type Prefix in Action

The same SensorData object declared with each memory type prefix. The prefix applies to the entire object; individual fields can override it.

Heap (default)

OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

Stack

STACK OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

IPC

IPC OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

GPU

GPU OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

Cloud

CLOUD OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

Registry

REGISTRY OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

Page

PAGE OBJECT SensorData;
    float   temperature = 22.5;
    float   humidity    = 65.0;
    int32_t timestamp   = 1715900000;

Mixed per‑field overrides

GPU OBJECT SensorData;
    float   temperature = 22.5;                   // GPU (inherited)
    CLOUD float   humidity = 65.0;              // override to cloud
    int32_t timestamp   = 1715900000;            // GPU (inherited)

7. File Structure & Output Formats

Objects are stored in the global object directory (default ./objects) using unbuffered file descriptors. Each object becomes a subdirectory containing its binary .chd file and all exported formats.

./objects/
  Ship/
    Ship.chd          (binary object file)
    Ship.odl          (ODL source export)
    Ship.java, .js, .json, .ts, .py, .h, .go, .swift
    Ship.rs, .kt, .cs, .toml, .wat, .msgpack
  Engine/
    ...

Supported output formats with their interactive key and CLI switch:

FormatKeySwitch
Javaj-j
JavaScriptk-k
JSONz-z
TypeScriptv-v
Pythony-y
C Headerc-c
Gog-g
Swiftw-w
ODLo-o
RustR-R
KotlinK-K
C#S-S
TOMLT-T
WebAssemblyW-W
MessagePackM-M

Ready to test? Launch ObjectWhack, press n for a single‑line compact object, or P to process all .odl files in the object directory. Use a to export all formats at once.

Command‑line example: ./ow -a file.odl exports all formats; cat file.odl | ./ow -R -T exports Rust and TOML from stdin.