In computer science, the expression code as data refers to the idea that source code written in a programming language can be manipulated as data, such as a sequence of characters or an abstract syntax tree (AST), and it has an execution semantics only in the context of a given compiler or interpreter.
[6] Another use case is storing a program in a string, which is then processed by a compiler to produce an executable.
[7] In computational theory, Kleene's second recursion theorem provides a form of code-is-data, by proving that a program can have access to its own source code.
[8] Code-as-data is also a principle of the Von Neumann architecture, since stored programs and data are both represented as bits in the same memory device.
For example, a list of integers or a string is data, but in languages such as Lisp and Perl, they can be directly entered and evaluated as code.