It’s been known since the time of Turing that what’s computable in one reasonably powerful programming language is computable in every other one. As a result, we can say that large classes of programming languages are ‘equivalent’ in the sense that they can emulate each other. However, not all programming languages have natural equivalents of all the others’ features.
This is the idea behind Greenspun’s Tenth Rule:
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
The usual corollary is “including Common Lisp”. We could say the same for C: most C compilers are implemented in C and compile themselves. Similarly, the Glasgow Haskell Compiler is written (mostly) in Haskell. Actually, given that C is the implementation language for so many interpreters, it’s easy to see that one could, in principle, write a program in language X by directly creating the abstract syntax tree and passing it to an “evaluate” function, all in C.
(more…)