3 ms·
Code is data does not come from lisp or macros, those are simply affordances. It comes from computer hardware architecture. The von Neumann Architecture is na
by platz 9y ago
Code is data does not come from lisp or macros, those are simply affordances.
It comes from computer hardware architecture.
The von Neumann Architecture is named after the mathematician and early computer scientist John von Neumann. von Neumann machines have shared signals and memory for code and data. Thus, the program can be easily modified by itself since it is stored in read-write memory.
Any self-modifying program, even if it is written in Borland Delphi, expresses this code is data capability.
- AnimalMuppet 9y agoIt's even deeper than that. It's not just how code is handled in a von Neumann architecture, it's how code is created. Data is just a sequence of bytes. Source code is also just a sequence of bytes - it's just a data file with a particular structure and intent. And then an executable is just a sequence of bytes - it's another data file, though on Unix it's one with the executable permission set. A compiler reads in a data file and writes a data file - they just happen to be source code and executable programs, respectively. (Now, when Lisp people say "code is data", they mean much more than compile time. For other languages, that is less true, other than self-modifying code...)
- platz 9y agoThe hardware is more fundamental. (Unless you want to invoke mathematics e.g. term rewriting) The compiler/seq of bytes example requires von neumann, because in that case it is the behavior of the whole system that is self-modifying. You could not have the beautiful executable and interchangable files of bytes without von neumann.
- AnimalMuppet 9y agoI don't think that's right. There have been systems that were Harvard architecture (Motorola 88000, I think, and definitely others). But the code to run on them still started out as a sequence of bytes in a text file, that is, as data, and a compiler still took that data file and wrote another data file that was the executable image.
- platz 9y agoSure, I guess