A declarative language for strongly‑typed, multi‑dimensional objects that map directly to the 32 Channel Data Types. Part of the Web4 Channel Paradigm.
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 Name | Channel Data Type | Bytes | Signed | Description |
|---|---|---|---|---|
| int8_t / byte8_t | DATA_BYTE (0) | 1 | yes | 8‑bit signed integer / ASCII byte |
| uint8_t | DATA_BYTE (0) + SIGN bit | 1 | no | 8‑bit unsigned integer |
| int16_t | DATA_SHORT (1) | 2 | yes | 16‑bit signed integer |
| uint16_t | DATA_SHORT (1) + SIGN bit | 2 | no | 16‑bit unsigned integer |
| char | DATA_CHAR (2) | 2 | no | UTF‑16 code unit (uint16_t, like Java char) |
| int32_t | DATA_INT (3) | 4 | yes | 32‑bit signed integer |
| uint32_t | DATA_INT (3) + SIGN bit | 4 | no | 32‑bit unsigned integer |
| int64_t | DATA_LONG (4) | 8 | yes | 64‑bit signed integer |
| uint64_t | DATA_LONG (4) + SIGN bit | 8 | no | 64‑bit unsigned integer |
| float | DATA_FLOAT (5) | 4 | — | 32‑bit IEEE‑754 float |
| double | DATA_DOUBLE (6) | 8 | — | 64‑bit IEEE‑754 double |
| Object | DATA_OBJECT (7) | ptr | — | Reference to another ODL Object |
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).
| Prefix | Memory Type | Description |
|---|---|---|
HEAP (or none) | HEAP_MEMORY (0) | Standard calloc‑allocated memory |
STACK | STACK_MEMORY (1) | Stack‑allocated, size limited |
IPC | IPC_MEMORY (2) | Inter‑process shared memory |
GPU | GPU_MEMORY (3) | Graphics device memory (global/texture/local) |
CLOUD | CLOUD_MEMORY (4) | Remote cloud storage |
REGISTRY | REGISTRY_MEMORY (5) | Persistent key‑value store |
PAGE | PAGE_MEMORY (6) | Paged memory |
// 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
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};
All 32 Channel Data types with scalar, 1D, 2D, and 3D examples.
// 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}} };
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}} };
// 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}} };
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}} };
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}} };
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}} };
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}} };
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} } };
A collection of practical, tech‑flavoured object definitions using various types, dimensions, nested objects, and storage prefixes.
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]};
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;
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];
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};
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;
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};
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];
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};
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];
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;
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};
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};
The same SensorData object declared with each memory type prefix. The prefix applies to the entire object; individual fields can override it.
OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
STACK OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
IPC OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
GPU OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
CLOUD OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
REGISTRY OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
PAGE OBJECT SensorData;
float temperature = 22.5;
float humidity = 65.0;
int32_t timestamp = 1715900000;
GPU OBJECT SensorData;
float temperature = 22.5; // GPU (inherited)
CLOUD float humidity = 65.0; // override to cloud
int32_t timestamp = 1715900000; // GPU (inherited)
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:
| Format | Key | Switch |
|---|---|---|
| Java | j | -j |
| JavaScript | k | -k |
| JSON | z | -z |
| TypeScript | v | -v |
| Python | y | -y |
| C Header | c | -c |
| Go | g | -g |
| Swift | w | -w |
| ODL | o | -o |
| Rust | R | -R |
| Kotlin | K | -K |
| C# | S | -S |
| TOML | T | -T |
| WebAssembly | W | -W |
| MessagePack | M | -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.