logoalt Hacker News

holysantamariayesterday at 6:06 PM1 replyview on HN

Spawning a process and piping the input? This does require having a node available at runtime though.

Isn’t the main point of using zig to avoid having a runtime and garbage collection to begin with?


Replies

afavouryesterday at 6:34 PM

That’s about the most basic imaginable implementation. Typically you use JavaScript runtimes like this to provide a plugin-like system for your static build that allows sandboxed customisation at runtime.

Take a look at the JavaScriptCore documentation to get a sense of what’s possible, it goes far beyond “piping the input”:

https://developer.apple.com/documentation/javascriptcore

show 1 reply