News for hackers. Stuff that matters.
Re:ChowJS: An AOT JavaScript engine for game consoles by gavinray on Thursday September 16, 2021 @01:41PM (#28554720)
I'm also curious about C API access from JS.

One thing I was hopeful about when I first read of Deno was ability to interop with native code by making FFI/bindings available in Rust, and then package to a native binary.

That didn't pan out, and I don't blame them, but I'm still hoping to be able to write native executables/shared libs in TypeScript and use C FFI.

Re:ChowJS: An AOT JavaScript engine for game consoles by reilly3000 on Thursday September 16, 2021 @05:25PM (#28557872)
This is way outside the realm of my expertise, but I’m curious how a FFI would be better than just calling child_process.exec for accessing a C binary. I suppose that may not be efficient inside of a game loop, but I don’t understand why, so long as it was done within a promise.
Re:ChowJS: An AOT JavaScript engine for game consoles by MaxBarraclough on Friday September 17, 2021 @04:30PM (#28570557)
Inter-process communication is much, much slower than a native function-call. (Native function calls are almost free, especially on modern CPUs which are very good at dealing with them.) Spinning up a whole new process is vastly slower still, taking (iirc) hundreds of thousands of instructions.

> so long as it was done within a promise.

I don't see how it would help things to wrap it up with concurrency abstractions. That won't make the cost go away.