mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-06-20 16:29:31 +00:00
Adds the ergonomic native event surface for Go: `node.On<Event>(func(<Payload>))` registers a native listener for that event and the library delivers the typed `<Payload>` POD, which an exported Go callback reads into a Go struct (reusing the generated `fromC`) and hands to the user's handler — no CBOR parsing. Sits beside the existing CBOR `SetEventHandler` (wildcard / inter-process). The example registers `OnEchoFired` and receives a typed `EchoEvent` when Echo fires it. Verified end-to-end with `go run -race`. C/C++/Rust get the same per-event typed handler + router next. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Languages
Nim
87.9%
Smarty
5.9%
C++
4.8%
CMake
1.4%