Ivan FB 88c7c8b8b7
feat(codegen): native typed events for the Rust generator
Adds native (zero-CBOR) event support to the Rust generator, mirroring the
cpp_native / Go event path: a per-event `add_<wire>_listener` registrar takes a
closure, boxes it, and registers it through the bare `<lib>_add_event_listener`
(native) entry point. The extern "C" trampoline reads the payload as the raw
C-POD struct and hands the consumer a borrowed idiomatic value via from_c — no
serialization on the hot path.

The node owns the boxed closures in a Mutex<HashMap<id, Box<dyn Any>>> keyed by
listener id so they outlive the call, and `remove_event_listener` drops them and
calls the bare remove entry point. Event externs are only emitted when the
library declares events, so event-free crates stay minimal.

Verified end-to-end: the demo registers a listener, echo fires on_echo_fired
inline, the typed EchoEvent reaches the closure, and removal returns true.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 19:05:38 +02:00
2026-05-19 12:43:34 +02:00
2026-05-21 16:33:38 +02:00
2026-05-20 14:14:42 -03:00
2026-05-27 22:26:39 +02:00
2026-05-20 14:14:42 -03:00
2026-05-16 01:08:42 +02:00
2026-05-20 14:14:42 -03:00
2026-05-20 14:14:42 -03:00

nim-ffi

Allows exposing Nim projects to other languages

Example

examples/timer is now a self-contained Nimble project that imports nim-ffi directly. Use cd examples/timer && nimble install -y ../.. && nimble build to compile the example.

Description
Allows exposing Nim projects to other languages
Readme
Languages
Nim 87.9%
Smarty 5.9%
C++ 4.8%
CMake 1.4%