Skip to main content

Crate shape_value

Crate shape_value 

Source
Expand description

Core value types for Shape

This crate contains the foundational value types and core data structures used throughout the Shape language implementation. The canonical runtime representation is ValueWord — an 8-byte NaN-boxed value.

Dependency hierarchy:

  • shape-value → shape-ast (no circular dependencies)
  • shape-runtime → shape-value (for types)
  • shape-vm → shape-value (for types)

Re-exports§

pub use aligned_vec::AlignedVec;
pub use closure::Closure;
pub use content::BorderStyle;
pub use content::ChartChannel;
pub use content::ChartSeries;
pub use content::ChartSpec;
pub use content::ChartType;
pub use content::Color;
pub use content::ContentNode;
pub use content::ContentTable;
pub use content::NamedColor;
pub use content::Style;
pub use content::StyledSpan;
pub use content::StyledText;
pub use context::ErrorLocation;
pub use context::LocatedVMError;
pub use context::VMContext;
pub use context::VMError;
pub use datatable::ColumnPtrs;
pub use datatable::DataTable;
pub use datatable::DataTableBuilder;
pub use enums::EnumPayload;
pub use enums::EnumValue;
pub use external_value::ExternalValue;
pub use external_value::NoSchemaLookup;
pub use external_value::SchemaLookup;
pub use external_value::external_to_nb;
pub use external_value::nb_to_external;
pub use extraction::nb_to_display_string;
pub use extraction::require_arc_string;
pub use extraction::require_array;
pub use extraction::require_bool;
pub use extraction::require_closure;
pub use extraction::require_datatable;
pub use extraction::require_f64;
pub use extraction::require_int;
pub use extraction::require_number;
pub use extraction::require_string;
pub use extraction::require_typed_object;
pub use heap_header::FLAG_MARKED;
pub use heap_header::FLAG_PINNED;
pub use heap_header::FLAG_READONLY;
pub use heap_header::HeapHeader;
pub use heap_value::ChannelData;
pub use heap_value::DataReferenceData;
pub use heap_value::DequeData;
pub use heap_value::HashMapData;
pub use heap_value::HeapKind;
pub use heap_value::HeapValue;
pub use heap_value::PriorityQueueData;
pub use heap_value::SetData;
pub use heap_value::SimulationCallData;
pub use ids::FunctionId;
pub use ids::SchemaId;
pub use ids::StackSlotIdx;
pub use ids::StringId;
pub use method_id::MethodId;
pub use scalar::ScalarKind;
pub use scalar::TypedScalar;
pub use value_word::ArrayView;
pub use value_word::ArrayViewMut;
pub use value_word::NanTag;
pub use value_word::ValueWord;
pub use shape_array::ShapeArray;
pub use shape_graph::Shape;
pub use shape_graph::ShapeId;
pub use shape_graph::ShapeTransitionTable;
pub use shape_graph::drain_shape_transitions;
pub use shape_graph::hash_property_name;
pub use shape_graph::shape_for_hashmap_keys;
pub use shape_graph::shape_property_index;
pub use shape_graph::shape_transition;
pub use slot::ValueSlot;
pub use typed_buffer::AlignedTypedBuffer;
pub use typed_buffer::TypedBuffer;
pub use value::FilterLiteral;
pub use value::FilterNode;
pub use value::FilterOp;
pub use value::HostCallable;
pub use value::PrintResult;
pub use value::PrintSpan;
pub use value::Upvalue;
pub use value::VMArray;
pub use value::VTable;
pub use value::VTableEntry;
pub use value::vmarray_from_nanboxed;
pub use value::vmarray_from_value_words;

Modules§

aligned_vec
SIMD-aligned vector implementation for high-performance time series operations
closure
Closure type definition (implementations in shape-runtime)
content
Structured content nodes — the output of Content.render().
context
VM execution context and error types
datatable
Columnar DataTable backed by Arrow RecordBatch.
enums
Custom enum types for Shape
external_value
ExternalValue: a serde-serializable value for display, wire, and debug.
extraction
Centralized extraction helpers for ValueWord values.
heap_header
Fixed-layout heap object header for JIT-friendly type dispatch.
heap_value
Compact heap-allocated value types for ValueWord TAG_HEAP.
heap_variants
Single source of truth for HeapValue variants.
ids
Strongly-typed newtype wrappers for numeric identifiers.
method_id
Typed method identifiers for zero-cost dispatch.
nanboxed
Backward-compatibility alias for the renamed module.
scalar
TypedScalar: type-preserving scalar boundary contract for VM↔JIT exchange.
shape_array
Unified array backing store for VM and JIT.
shape_graph
Shape graph for HashMap hidden classes.
slot
ValueSlot: 8-byte raw value storage for TypedObject fields
tags
Shared NaN-boxing tag constants and helpers.
typed_buffer
TypedBuffer: width-specific buffer with optional null/validity bitmap.
value
Core value types for Shape
value_word
ValueWord: 8-byte NaN-boxed value representation for the VM stack.

Macros§

define_heap_types
All HeapValue variant data lives here as a single source of truth.

Type Aliases§

NanBoxed
Backward-compatibility alias: NanBoxed is now ValueWord.