Using Rust as a NodeJS addon, comparing with C addon.
git clone https://github.com/paradigmist/nodejs-ffi-rust.git
cd nodejs-ffi-rust
npm i && cargo build --release
- Compile C addon
- On MacOS:
gcc -O3 -dynamiclib -undefined suppress -flat_namespace src/lib.c -o target/release/build/libfib.dylib
- On Linux/Solaris/etc:
gcc -O3 -shared -fpic src/lib.c -o target/release/build/libfib.so
- On MacOS:
node fibs.js 35
Have fun!