Skip to content

CEP-0035: Public Dyn ABI

Draft

Draft proposal for public ABI guarantees around dynamic contract pointers, vtables, and owned dynamic boxes. V1 dyn layout is private.

Summary

Catalyst should eventually decide whether *dyn C, *const dyn C, and Box(dyn C) have a stable public representation or external ABI.

V1 specifies semantic behavior and performance targets but does not promise public field layout or C ABI compatibility for dynamic values.

Example

Illustrative representation, not accepted ABI:

typedef struct CatalystDynDisplay {
  void *data;
  const CatalystDisplayVTable *vtable;
} CatalystDynDisplay;

This proposal asks whether any representation like this becomes public, versioned, and usable across ABI boundaries.

Motivation

Stable dyn ABI could support interop, plugins, separate compilation, and low-level libraries. It also freezes representation choices around intersections, dispose metadata, allocator state, vtables, and future downcasting.

Proposed Direction

The proposal should cover:

  • public representation of borrowed dyn pointers;
  • public representation of owned dyn boxes, if any;
  • vtable layout and versioning;
  • intersection contract object layout;
  • dispose metadata and allocator/freeing state;
  • C ABI and separate-compilation behavior.

V1 Compatibility

V1 dynamic metadata and boxed dyn layout remain private implementation details. Ordinary ptr() and dispose() paths must not require runtime reflection objects or descriptor heap allocation.