shape_value/lib.rs
1//! Core value types for Shape
2//!
3//! This crate contains the foundational value types and core data structures
4//! used throughout the Shape language implementation. After the strict-typing
5//! bulldozer, the runtime representation is per-slot raw native bits whose
6//! `NativeKind` is determined at compile time and carried in the
7//! `FunctionBlob`. There is no `ValueWord`, no NaN-boxing, no dynamic
8//! dispatch on value type.
9//!
10//! Dependency hierarchy:
11//! - shape-value → shape-ast (no circular dependencies)
12//! - shape-runtime → shape-value (for types)
13//! - shape-vm → shape-value (for types)
14
15// Re-export core types
16pub mod aligned_vec;
17pub mod content;
18pub mod context;
19pub mod datatable;
20pub mod heap_header;
21#[macro_use]
22pub mod heap_variants;
23pub mod heap_value;
24pub mod ids;
25pub mod iterator_state;
26pub mod kinded_slot;
27pub mod method_id;
28pub mod native_kind;
29pub mod reference;
30pub mod scalar;
31pub mod string_intern;
32pub mod shape_graph;
33pub mod shape_graph_current;
34pub mod slot;
35// Phase 3 cluster-0+1 V3-S5 ckpt-4 (2026-05-15): `pub mod typed_buffer;`
36// deleted. The `TypedBuffer<T>` + `AlignedTypedBuffer` wrapper layer is
37// retired wholesale per W12-typed-array-data-deletion-audit §B
38// (audit §1.1 deletion targets) + ADR-006 §2.7.24 Q25.A SUPERSEDED. The
39// canonical replacement is the v2-raw `TypedArray<T>` flat struct at
40// `crate::v2::typed_array::TypedArray<T>` (per `docs/runtime-v2-spec.md`).
41// Refusal #1 binding: do not resurrect under any rename/shim/bridge.
42pub mod v2;
43pub mod value;
44pub mod vm_closure_handle;
45
46pub use aligned_vec::AlignedVec;
47pub use content::{
48 BorderStyle, ChartChannel, ChartSeries, ChartSpec, ChartType, Color, ContentNode, ContentTable,
49 NamedColor, Style, StyledSpan, StyledText,
50};
51pub use context::{ErrorLocation, LocatedVMError, VMError};
52pub use datatable::{ColumnPtrs, DataTable, DataTableBuilder};
53pub use heap_header::{FLAG_MARKED, FLAG_PINNED, FLAG_READONLY, HeapHeader};
54// V3-S5 ckpt-4 (2026-05-15): `TypedArrayData` removed from re-exports.
55// The enum was deleted at ckpt-1 (heap_value.rs); this re-export was
56// cascade-broken at the same time. Remaining re-exports stay intact.
57pub use heap_value::{HeapKind, HeapValue, TableViewData, TemporalData, TypedObjectStorage};
58pub use ids::{FunctionId, SchemaId, StackSlotIdx, StringId};
59pub use iterator_state::{IteratorSource, IteratorState, IteratorTransform};
60pub use kinded_slot::KindedSlot;
61pub use method_id::MethodId;
62pub use native_kind::NativeKind;
63pub use reference::RefTarget;
64pub use scalar::{ScalarKind, TypedScalar};
65pub use shape_graph::{
66 Shape, ShapeId, ShapeTransitionTable, drain_shape_transitions, hash_property_name,
67 shape_for_hashmap_keys, shape_property_index, shape_transition,
68};
69pub use shape_graph_current::{
70 ShapeTableHandle, SyncShapeTableScope, current_shape_table, try_current_shape_table,
71 with_async_shape_table_scope,
72};
73pub use slot::ValueSlot;
74// V3-S5 ckpt-4 (2026-05-15): `pub use typed_buffer::{AlignedTypedBuffer,
75// TypedBuffer};` deleted alongside `typed_buffer.rs` itself per
76// W12-typed-array-data-deletion-audit §B + ADR-006 §2.7.24 Q25.A SUPERSEDED.
77// The wrapper layer is retired wholesale; remaining consumers (marshal.rs
78// FromSlot/ToSlot impls for `Arc<AlignedTypedBuffer>` / `Arc<TypedBuffer<i64>>`,
79// the ~10 intrinsic typed-fn registration sites in
80// `crates/shape-runtime/src/intrinsics/*.rs`) cascade-break for ckpt-5 +
81// downstream wave pickup. Refusal #1 binding: no re-introduction under
82// any rename/shim/bridge.
83pub use value::{
84 ErasureError, ErasureType, FilterLiteral, FilterNode, FilterOp, RewriteResult, ThunkSignature,
85 TypeInfo, VTable, VTableEntry, VTableEntryFlags, WrapTarget,
86};
87pub use vm_closure_handle::VmClosureHandle;
88
89// v2 runtime re-exports
90pub use v2::heap_header::HeapHeader as V2HeapHeader;
91pub use v2::refcount::{v2_release, v2_retain};
92pub use v2::string_obj::StringObj as V2StringObj;
93pub use v2::struct_layout::{FieldInfo, FieldKind, StructLayout};
94pub use v2::typed_array::TypedArray as V2TypedArray;
95
96// v2 runtime types (zero-tag native values)
97//
98// V2.b: `v2_typed_array` (v1 tag-discriminated `TypedArrayHeader` + `ElemType`)
99// was deleted in favour of the monomorphized `v2::typed_array::TypedArray<T>`.
100// Use `shape_value::V2TypedArray` (re-exported above) or
101// `shape_value::v2::typed_array::TypedArray<T>` directly.
102pub mod v2_struct_layout;