You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C SDK (zrtl.h) is significantly more robust than the Rust macro crate. This plan addresses feature parity and integration improvements.
Gap Analysis: zrtl.h vs zrtl_macros
Features in zrtl.h (1350 lines) Missing from zrtl_macros (153 lines)
Feature
zrtl.h
zrtl_macros
Priority
Type Tags (ZrtlTypeTag)
✅ Full support
❌ None
High
Type Categories enum
✅ ZRTL_CAT_*
❌ None
High
Type Flags (nullable, boxed, etc.)
✅ ZRTL_FLAG_*
❌ None
High
DynamicBox struct
✅ 24-byte boxed value
❌ None
High
Box accessors (zrtl_box_as_i32, etc.)
✅ 10+ inline functions
❌ None
High
Box creation helpers
✅ zrtl_box_i32, etc.
❌ None
High
GenericBox for generics
✅ Array, Map<K,V>
❌ None
High
GenericTypeArgs
✅ Nested generics
❌ None
Medium
TypeDescriptor
✅ Full type info
❌ None
Medium
ZrtlString (inline format)
✅ Length-prefixed
❌ None
High
String helpers
✅ new, copy, print, equals
❌ None
High
ZrtlStringView
✅ Non-owning view
❌ None
Low
ZrtlArray (inline format)
✅ Capacity+length header
❌ None
High
Array helpers
✅ new, push, get
❌ None
High
Iterator protocol
✅ ZrtlIterator
❌ None
Medium
ArrayIterator
✅ Typed iteration
❌ None
Medium
StringIterator
✅ UTF-8 codepoint iteration
❌ None
Low
IterableVtable
✅ Custom iterables
❌ None
Low
Type registry
✅ Custom type registration
❌ None
Medium
Test harness
✅ ZRTL_TEST macros
❌ None
Low
What zrtl_macros Currently Provides
zrtl_plugin!("name") - Creates _zrtl_info and _zrtl_symbols exports
#[zrtl_export("$Type$method")] - Registers function in symbol table
What's Missing from zrtl_macros
Type system macros - No Rust equivalents for type tags, categories, flags
DynamicBox/GenericBox - No proc macros for generating box wrappers
String/Array format - No helper macros for inline memory formats
Iterator traits - No derive macros for making types iterable
Test framework - No Rust test macros equivalent to ZRTL_TEST
Gap Analysis: zyntax_embed
Current State (Updated)
Component
Status
Notes
ZyntaxValue enum
✅ Complete
All categories represented
ZyntaxString
✅ Complete
Length-prefixed format
ZyntaxArray
✅ Complete
Header format
FromZyntax/IntoZyntax traits
✅ Complete
Bidirectional conversion
ZyntaxRuntime
✅ Complete
Single-tier JIT with native calling
TieredRuntime
✅ Complete
Multi-tier with stats
ZyntaxPromise
✅ Complete
Full async ABI with combinators
Hot reload
⚠️ Partial
API exists, needs testing
DynamicValue interop
✅ Complete
Full conversion support
GenericValue support
✅ Complete
GenericTypeArgs exported
TypeMeta preservation
✅ Complete
TypeMeta, TypeRegistry exported
TypeRegistry
✅ Complete
Re-exported from zyntax_compiler
Error value support
⚠️ Partial
Result<T,E> conversion incomplete
ZrtlPlugin loading
✅ Complete
load_plugin, load_plugins_from_directory
Promise combinators
✅ Complete
PromiseAll, PromiseRace, PromiseAllSettled
Native async (ZRTL)
✅ Complete
#[zrtl_async] macro in sdk/zrtl_macros
Remaining Integration Gaps
Limited argument handling - Only supports 0-4 args via manual transmute ✅ Supports 0-8 args
No varargs support - Can't call functions with >4 parameters ✅ Supports up to 8 parameters
No struct field access from compiled code - Can build structs but not read
No cancellation - Promises can't be cancelled ✅ cancel(), is_cancelled(), PromiseState::Cancelled
Iterator traits - No ZrtlIterable/ZrtlIterator in embed crate ✅ ZrtlIterable, ZrtlIterator traits added
Proposed Roadmap
Phase 1: Type System Alignment (High Priority)
1.1 Add type system to zrtl_macros
// New derive macro for ZRTL types#[derive(ZrtlType)]#[zrtl(name = "Point", category = "struct")]pubstructPoint{pubx:f64,puby:f64,}// Generates:// - static TYPE_INFO: ZrtlTypeInfo// - impl ZrtlTyped for Point// - Drop handling with dropper
1.2 Add DynamicBox to zrtl_macros
// Proc macro for generating box wrapperszrtl_box_types!{i8,i16,i32,i64,u8,u16,u32,u64,f32,f64,bool,}// Generates all zrtl_box_as_* and zrtl_box_* functions as Rust FFI
1.3 Add GenericBox support
// Derive for generic containers#[derive(ZrtlGeneric)]pubstructZrtlArray<T>{/* ... */}// Generates GenericTypeArgs handling
// Test harness for ZRTL plugins#[zrtl_test]fntest_array_push(){letmut arr = ZyntaxArray::new();
arr.push(42);zrtl_assert_eq!(arr.len(),1);zrtl_assert_eq!(arr[0],42);}
Priority Matrix
Task
Impact
Effort
Priority
Status
Type tags in zrtl_macros
High
Medium
P0
✅ Done (in zrtl crate)
DynamicBox in zrtl_macros
High
Medium
P0
✅ Done (in zrtl crate)
TypeRegistry in embed
High
Low
P0
✅ Done (re-exported)
ZRTL plugin loading
High
Medium
P1
✅ Done
Variadic function calls
High
High
P1
✅ Done (0-8 args)
GenericBox support
Medium
Medium
P1
✅ Done (in zrtl crate)
Iterator traits
Medium
Medium
P2
✅ Done
Collection interop
Medium
Low
P2
✅ Done
Async state machine
Medium
High
P2
✅ Done
Cancellation
Low
Medium
P3
✅ Done
Promise combinators
Low
Low
P3
✅ Done
Test framework
Low
Medium
P3
✅ Done
Native async functions (ZRTL)
High
Medium
P1
✅ Done
Implementation Order
Sprint 1: Type System Foundation ✅ COMPLETE
✅ Add TypeCategory, TypeFlags, TypeTag to zrtl crate
✅ Add DynamicBox struct and accessors to zrtl crate
✅ Add #[derive(ZrtlType)] macro to zrtl_macros
✅ Re-export TypeRegistry in zyntax_embed
Sprint 2: Runtime Integration ✅ COMPLETE
✅ Add ZRTL plugin loading to ZyntaxRuntime (load_plugin, load_plugins_from_directory)
✅ Improve function calling with variadic support (0-8 arguments)
✅ Add GenericTypeArgs handling to ZyntaxValue (re-exported from zrtl)