💡 Looking for inspiration for your next open source project? Or perhaps you've got a brilliant idea you can't wait to share with others? Open Source Ideas is a community built specifically for this! 👋
duktape - a ES5 JS engine which is intended to be embedded and was designed to be small. There is also no JIT-compilation or modern JS features.
IE9 (very old and obsolete JS engine found in Windows OSes from XP to 8.1)
.
Some of them have own shared libraries. Nearly all of them have terrible API incompatible with each other.
When you wanna embed a JS engine you may want to have the latest JS but not to update them. The solution may be an abstraction layer library doing the following:
creating a unified API for apps which wanna embed a JS engine, hiding differences between engines and ugliness of their APIs
discovering engines installed in the system, choosing the best one which meets the user's requirements and loading it in runtime.
So a dev just uses the library. And it works on any machine having any modern web browser. When a browser is updated the js engine is also updated, because the library uses the JS engine used by browser.
Relevant Technology
node.js has some abstraction layer allowing to replace v8 with chackra and spidermonkey
This is the point of N-API, though many native Node addons interact directly with V8. Also Ryan Dahl's Deno has interesting architecture which, theoretically, makes engine replacement easier.
Project description
There are plenty of modern JS engines:
Some of them have own shared libraries. Nearly all of them have terrible API incompatible with each other.
When you wanna embed a JS engine you may want to have the latest JS but not to update them. The solution may be an abstraction layer library doing the following:
So a dev just uses the library. And it works on any machine having any modern web browser. When a browser is updated the js engine is also updated, because the library uses the JS engine used by browser.
Relevant Technology
node.js has some abstraction layer allowing to replace v8 with chackra and spidermonkey