5 ms·
Interesting project. Wonder if this would be useful for web based programs that could allow third party add-ons, etc... I was thinking WASM with some bindings w
by Keverw 6y ago
Interesting project. Wonder if this would be useful for web based programs that could allow third party add-ons, etc... I was thinking WASM with some bindings would be prefect, but being in JS itself sounds cool as this acts as a sort of sandbox I'd imagined (Well I assume someone could try to make an infinite loops and lock it up?). Be neat if could some how try to limit/monitor memory and CPU usage.
- tomstuart 6y agoThe purpose of this project is to parse JavaScript (turn a flat string of code into a structured tree), not evaluate it.
- lioeters 6y ago> web based programs that could allow third party add-ons The library in the current post, Seafox - cute name! - is "just" the parser, turning JavaScript code into an abstract syntax tree. One would need a sandboxed interpreter/evaluator/virtual machine to run it. You might be aware of Figma's efforts, where they compiled Fabrice Bellard's QuickJS engine (in C) to WASM, to use for their plugin system. https://www.figma.com/blog/how-we-built-the-figma-plugin-system/ https://www.figma.com/blog/how-we-built-the-figma-plugin-sys... https://www.figma.com/blog/an-update-on-plugin-security/ https://www.figma.com/blog/an-update-on-plugin-security/ https://bellard.org/quickjs/ https://bellard.org/quickjs/ The first article describes an earlier system using Realms, a shim/polyfill for an ECMAScript proposal. https://github.com/agoric/realms-shim/ https://github.com/agoric/realms-shim/ https://github.com/tc39/proposal-realms https://github.com/tc39/proposal-realms