Ivan FB 1fd1ad07bb
feat(codegen): native C++ typed event handlers
Adds the ergonomic native event surface to the C++ generator:
`node.On<Event>(std::function<void(const <Payload>&)>)` registers a native
listener; a per-event extern "C" trampoline reads the typed POD
(`fromC(*reinterpret_cast<const ::<Payload>*>(msg))`) and invokes the handler —
no CBOR. The handler is owned by the node (a `std::map` of `ListenerBase`) so
its address stays valid until `removeEventListener`.

The example registers `OnEchoFired` and receives a typed `EchoEvent` when Echo
fires it. Verified end-to-end and ASAN-clean.

With this the native C++ generator covers the full surface: requests
(scalar/string/bool/seq/Option/nested), typed struct returns, and typed events.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 18:39:20 +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%