Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

C ABI profile — Interop view types (v0.3.0)

Platform spec article

C ABI profile — Interop view types (v0.3.0)

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

v0.3.0 introduces interop view types: transparent records with stable C layout used only at FFI boundaries. They align with runtime repr(C) helpers in compiler/crates/beskid_abi/src/types.rs without exposing GC-managed Beskid string or T[] directly.

Canonical definitions should live in corelib under an Interop package (exact package id is a corelib layout decision).

Layouts use pointer-sized fields in C ABI order.

UTF-8 byte range (does not imply null termination on the foreign side unless documented).

FieldTypeMeaning
ptrpointer / i64Start of bytes
leni64Byte length

Maps to BeskidStr at the runtime embedding boundary.

Read/write byte range.

FieldTypeMeaning
ptrpointer / i64Start of bytes
leni64Logical length

Fat-pointer compatible with runtime arrays.

FieldTypeMeaning
ptrpointer / i64Element storage
leni64Logical element count
capi64Capacity

Maps to BeskidArray where the profile documents element size separately.

bool (as i8 at boundary), u8, i32, i64, f64, unit, interop views above, and ref u8 (legacy narrow slice start — prefer views).

The C ABI profile lowers views to a flat list of machine parameters per System V AMD64 (pointer and integer slots). The engine signature validator must accept only types expressible in that flat list.

CLayout records with primitive fields only arrive in v0.3.1 (C layout types). Nested structs, enums, and arrays inside FFI structs remain deferred until that band is stable.