Move (yuni ffi *) functionalities to separate libraries because some of these are not FFI-specific.
Unified structure APIs (yuni core)
No short names: new yuni-set!yuni-ref procedures
No Scheme core object support
Common API for 3 types of object, symbol addressed: dynamic tables(JSON etc), buffers, bytevectors, hashtables (require eq-hashtable->yuni etc)
We don't see any performance benefit over defining core ref/set! as syntax; future Yuni will use inline-hints.
Buffer APIs (yuni buffers)
3 types of buffer: Transient / Pinnable bytevector / Foreign
Unified raw integer/IEEE-float access, aligned/unaligned
Transient buffer is alloca equivalent. MIT/GNU Scheme 10 or later has real FFI thus we no longer need special handling for them.
Structure pack/unpack (yuni pack)
Structure definition
Core value interpolation: byte-length, count, zero, padding
Bitfield pack/unpack
Symbol-as-enum features
Structure/Parameter templates
C calling primitives (yuni ffi nccc)
NCCC(Normalized C Calling Convention): Yuni will only support following function signature(s) C stub generator will generate wrapper using API description and wrapper will be shared with Yuni implementations, including non-Scheme ones
Callback trampoline management - Callback to Scheme might be an optional feature though
Pointer patching - replace bytevector/buffer references into pointers for API parameters
ABI backfilling - Fetch actual structure layout from precompiled static bindings for (yuni pack)
(NCCCv0)
void some_api(uint64_t* in, int in_len, uint64_t* out, int out_len);
Move
(yuni ffi *)
functionalities to separate libraries because some of these are not FFI-specific.Unified structure APIs
(yuni core)
yuni-set!
yuni-ref
procedureseq-hashtable->yuni
etc)We don't see any performance benefit over defining core ref/set! as syntax; future Yuni will use inline-hints.
Buffer APIs
(yuni buffers)
Transient buffer is
alloca
equivalent. MIT/GNU Scheme 10 or later has real FFI thus we no longer need special handling for them.Structure pack/unpack
(yuni pack)
C calling primitives
(yuni ffi nccc)
(yuni pack)
(NCCCv0)
(NCCCv1 - TBD)