3 ms·
Page seems to be missing a "why?" section. Seriously, why? What does it do that eval() doesn't?
by AshleysBrain 15y ago
Page seems to be missing a "why?" section. Seriously, why? What does it do that eval() doesn't?
- stan_rogers 15y agoIt's similar to the metacircular Scheme interpreter in Scheme in SICP. It's not that interpreting JavaScript in JavaScript (especially if that JavaScript is running on a full-blown and more efficient interpreter itself) is a practical end, but that it demonstrates a concept: language as data and data as language. As an implementation, it is merely interesting -- but imagine writing code in a language closer to the problem domain you're working with that just happens to run on JavaScript.