Ivan FB c0013b3a8f
feat(host): registry + in-flight table for {.ffiHost.}
First increment of typed host callbacks (roadmap #1): the data-structure
layer, independent of the FFI thread and the macro so it can be unit-tested
in isolation.

- FFIHostRegistry: wire-name -> (host fn ptr, userData). A missing entry is a
  normal outcome (the imported proc errors), never a crash — never-crash
  policy. nil fn unregisters.
- FFIPendingTable: monotonic token -> the chronos Future an awaiting
  {.ffiHost.} proc is blocked on. completePending drops unknown/double
  completions; failAllPending errors every outstanding future on teardown so
  no awaiting handler is abandoned.

Both lock-guarded so a host thread and the FFI thread can touch them
concurrently; futures are only ever completed on the FFI thread. 6 unit tests
pass under orc and refc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:51:11 +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-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%