What does HackerNews think of js.js?

js.js: A JavaScript JavaScript interpreter

Language: JavaScript

Those sidesteppings are outlawed by the Chrome Web Store policies.

There are JS-in-JS interpreters out there. They're just not allowed. https://github.com/jterrace/js.js/ https://github.com/marten-de-vries/evaljs

Definitely not the first JS VM compiled to the browser. Aside from JSC as another comment mentioned, there was also js.js which is SpiderMonkey compiled to JS (around 2012!),

https://github.com/jterrace/js.js/

This shouldn't be surprising - many VMs have been compiled to the Web, like Lua, Python (both CPython and PyPy!), etc., and JS is just another VM.

It's not as impossible as it sounds.

There are many JS engines which are extremely small compared to the big guys used in browsers. Most of them tend to grab a subset of the language and implement that.

For example, the creators of nginx created their own specialized engine called nginScript that runs JS for their stuff https://www.nginx.com/resources/wiki/nginScript/

There is even a javascript interpreter written in javascript which can be a good starting point to learn a bit how it works https://github.com/jterrace/js.js/

No, because V8 has no interpreter (although they are working on one: https://code.google.com/p/v8/issues/detail?id=4280), only JIT, and JIT doesn't run inside asm.js.

asm.js-compiled JavaScript engine has been done already: https://github.com/jterrace/js.js.

The footer says that if you want a real "Javascript to Javascript interpreter", to see js.js[0], which is a JS interpreter written JS; where the satirical js2js is a JS-to-JS compiler, something different. If you want a real JS to JS compiler, see Google's "Closure Compiler"[1].

[0]: https://github.com/jterrace/js.js/

[1]: https://developers.google.com/closure/compiler/ / https://github.com/google/closure-compiler

This one is actually legitimate. Saw it on HN a while ago, really funny:

https://github.com/jterrace/js.js/

Security. When you want to run untrusted modding code.

It's hard to sandbox python or lua and block I/O and all system calls. 1 mistake and player computers are compromised.

Even with JS in browser you can't just eval(), you need sandboxing like https://code.google.com/p/google-caja/ or https://github.com/jterrace/js.js/ (200 times slower than js).

There are already several PC emulators in JS, and there are at least two Javascript interpreters in JS:

This one is Spidermonkey compiled with Emscripten: https://github.com/jterrace/js.js/

And this one is a test-bed for new JS language features (or at least meant to be - don't know how far along it is): https://github.com/mozilla/narcissus