3 ms·
For anyone who needs a performant "JavaScript for embedded" runtime that also fully supports ECMAScript 2018, Moddable's XS is a great choice.[1] Moddable is t
by CharlesW 7y ago
For anyone who needs a performant "JavaScript for embedded" runtime that also fully supports ECMAScript 2018, Moddable's XS is a great choice.[1]
Moddable is the only embedded engine provider in the Ecma TC39 JavaScript language committee, so they tend to be really aggressive in supporting new JavaScript features.
[1] https://www.moddable.com/faq.php#comparison https://www.moddable.com/faq.php#comparison
- amelius 7y agoHow difficult would it be to port Firefox's javascript engine to embedded platforms?
- andoma 7y agoIn my experience (having embedded both spidermonkey and duktape) is that if embedding is not a primary use case for the engine it can get messy and complicated to update (lots of api breakage etc). This was the reason I switched from spidermonkey to duktape for my app. That said, it was probably five or six years ago. Perhaps things have changed since. I guess the takeaway is just that. If the engine isn’t maintained for embedding. Don’t use it as such.
- amelius 7y agoYeah, I guess JIT compilation to native code can also be a difficult issue.
- hajile 7y agoI've never tried, but Mozilla's example doesn't look that hard. https://github.com/mozilla-spidermonkey/spidermonkey-embedding-examples https://github.com/mozilla-spidermonkey/spidermonkey-embeddi... The big issue (like with v8) is binary size. Double-digit megabytes before you even start running code is unacceptable in a lot of environments.
- X-Istence 7y agoIt's a giant pain in the behind, if you can even get it to compile correctly.
- jupp0r 7y agoI have not tried SpiderMonkey, but embedding V8 is pretty easy.
- jupp0r 7y agoModdable is GPL though, which might be problematic for some use cases.
- paulddraper 7y ago? It's MIT https://github.com/svaarala/duktape/blob/master/LICENSE.txt https://github.com/svaarala/duktape/blob/master/LICENSE.txt
- CharlesW 7y agoYes, it's well worth understanding the licensing before trying it. Their commercial license is 25¢/unit (no minimum), and their FOSS license is LGPL for the runtime, GPL for the development tools, and Creative Commons for their example code. For anyone interested in XS specifically or embedded software licensing in general, they do a good job of explaining their rationale here: https://www.moddable.com/license https://www.moddable.com/license