3 ms·
Wait what? Wouldn't a js2js interpreter just be eval()??? How is this more than a joke project?
by Igglyboo 12y ago
Wait what? Wouldn't a js2js interpreter just be eval()??? How is this more than a joke project?
- roywiggins 12y agoeval() calls the interpreter that's running the current code with some arbitrary string. The code that's interpreting it is not Javascript; you can't poke around and change it without recompiling whatever binary it is. Implementing Javascript in Javascript lets you quickly play with new features: you can add features to the toy interpreter more easily than nodejs. There's a long tradition of self-hosting compilers: C is compiled with programs that were written in C. PyPy is a Python interpreter written in Python (actually RPython but it's a subset of Python). http://en.wikipedia.org/wiki/History_of_compiler_construction#Self-hosting_compilers http://en.wikipedia.org/wiki/History_of_compiler_constructio...