Original JavaScript

[1] The fact that the machines are described in Lisp JavaScript is inessential. If we give our evaluator a Lisp JavaScript program that behaves as an evaluator for some other language, say C, the Lisp JavaScript evaluator will emulate the C evaluator, which in turn can emulate any machine described as a C program. Similarly, writing a Lisp JavaScript evaluator in C produces a C program that can execute any Lisp JavaScript program. The deep idea here is that any evaluator can emulate any other. Thus, the notion of what can in principle be computed (ignoring practicalities of time and memory required) is independent of the language or the computer, and instead reflects an underlying notion of computability. This was first demonstrated in a clear way by Alan M. Turing (1912–1954), whose 1936 paper laid the foundations for theoretical computer science. In the paper, Turing presented a simple computational model—now known as a Turing machine—and argued that any effective process can be formulated as a program for such a machine. (This argument is known as the Church–Turing thesis.) Turing then implemented a universal machine, i.e., a Turing machine that behaves as an evaluator for Turing-machine programs. He used this framework to demonstrate that there are well-posed problems that cannot be computed by Turing machines (see exercise 4.20), and so by implication cannot be formulated as effective processes. Turing went on to make fundamental contributions to practical computer science as well. For example, he invented the idea of structuring programs using general-purpose subroutines. See Hodges 1983 for a biography of Turing.
[2] Some people find it counterintuitive that an evaluator, which is implemented by a relatively simple procedure, function, can emulate programs that are more complex than the evaluator itself. The existence of a universal evaluator machine is a deep and wonderful property of computation. Recursion theory, a branch of mathematical logic, is concerned with logical limits of computation. Douglas Hofstadter's beautiful book Gödel, Escher, Bach (1979) explores some of these ideas.
[3] Warning: This eval primitive is not identical to the eval procedure we implemented in section 4.1.1, because it uses actual Scheme environments rather than the sample environment structures we built in section 4.1.3. These actual environments cannot be manipulated by the user as ordinary lists; they must be accessed via eval or other special operations. Similarly, the apply primitive we saw earlier is not identical to the metacircular apply, because it uses actual Scheme procedures rather than the procedure objects we constructed in sections 4.1.3 and 4.1.4.
[4] The MIT implementation of Scheme includes eval, as well as a symbol user-initial-environment that is bound to the initial environment in which the user's input expressions are evaluated.
[5] Note that eval may not be available in the JavaScript environment that you are using, or its use may be restricted for security reasons.
[6] Although we stipulated that halts? halts is given a procedure function object, notice that this reasoning still applies even if halts? halts can gain access to the procedure's function's text and its environment. This is Turing's celebrated Halting Theorem, which gave the first clear example of a noncomputable problem, i.e., a well-posed task that cannot be carried out as a computational procedure. function.
4.1.5   Data as Programs