by knighthack · 2y ago · 0 comments
If it is, consider looking in Nim. It compiles to C, and even compiles to Javascript. And is extremely performant while at it.
In addition, it automatically generates wrappers to transparently convert between Javascript's memory model and C's memory model to seamlessly allow Javascript to call upon the C functions imported using it.
Just your usual FFI, really, but with less call overhead than the FFI specification defined by Node (N-API). Albeit with some different tradeoffs made in order to accomplish that.