Node.js ↔ Rust

One framed event contract.

Normal Node.js and Rust messages share the same UTF-8 JSON event envelope and configured delimiter. The focused suite exercises each runtime as both client and server.

2 directions5 messages each17-byte payload

Wire shape

{"type":"app.request","data":{"sequence":0,"payload":"xxxxxxxxxxxxxxxxx"}}\f

The default delimiter is form feed. Both peers validate the envelope, event type, payload, sequence, role and language metadata, every response, and final frame counts. TCP is the maintained mixed-runtime interoperability lane for 14.0.0.

Run the visible ping / pong example

Rust server, Node client

cargo run --manifest-path rust/node-ipc/Cargo.toml \
  --example nodeRustInterop -- server

node rust/node-ipc/examples/nodeRustInterop/node-peer.js client

Node server, Rust client

node rust/node-ipc/examples/nodeRustInterop/node-peer.js server

cargo run --manifest-path rust/node-ipc/Cargo.toml \
  --example nodeRustInterop -- client

Each peer prints the exact sent and received frame. The visible \f represents the delimiter; this example reports no timing claim.

Run the focused gate

node rust/node-ipc/interop/vanilla-test.js

The suite builds the dependency-free Rust TCP peer once, then runs Node client → Rust server and Rust client → Node server. It owns bounded startup, process deadlines, response validation, termination, and reap checks.

Portable value boundaries

Value or stateShared contract
Normal objects, arrays, strings, booleans, nullPortable when both peers use the same event and delimiter configuration
NumbersUse strings or JavaScript-safe integers when exact precision must survive both runtimes
Duplicate object membersAvoid them; Rust retains them while Node collapses to the last value
Lone UTF-16 surrogatesAvoid them; Rust strings require Unicode scalar values
Malformed or incomplete framesRust deliberately fails closed in cases where Node may normalize or discard trailing state
Custom delimiterConfigure identical valid UTF-8 bytes and keep that sequence out of serialized envelopes
Wire compatibility is not transport authentication.

A valid frame does not identify its sender. Use verified mTLS or a separately authenticated local boundary, then authorize application events and validate payload schemas.

Performance harness is separate

The repository also contains a release-mode TCP round-trip harness for Node/Node, Rust/Rust, and both mixed role directions. It records payload, warm-up, count, pipeline depth, runtime versions, memory, package footprint, environment, and cleanup. Correctness tests use debug builds and make no performance claim.

npm run benchmark:rust:test
npm run benchmark:rust:quick

Native scope

There is no browser JavaScript adapter, Rust WASM ABI, WASM build, or browser interoperability suite in 14.0.0. Browser and WASM behavior is not claimed.