Ivan FB e22b887d7c
fix(library): block first-time callers until NimMain completes
initializeLibrary ran NimMain only on the thread that won
`initialized.exchange(true)`; concurrent first-time callers fell straight
through and used a half-initialized Nim runtime — a heap-corrupting race
when multiple foreign (e.g. Go) threads create the first context at once.
Add an `initDone` flag the winner sets after NimMain; the others spin
until it is set before proceeding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 20:11:39 +02:00
2026-05-11 19:21:40 -03:00
2026-06-18 11:47:22 +02:00

nim-ffi

Allows exposing Nim projects to other languages

Example

examples/nim_timer is now a self-contained Nimble project that imports nim-ffi directly. Use cd examples/nim_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%