5 ms·
See this is why I never understood LISP people proudly proclaiming that “code is data and data is code”… we were doing this in BASIC for decades already!
by JSR_FDED 3mo ago
See this is why I never understood LISP people proudly proclaiming that “code is data and data is code”… we were doing this in BASIC for decades already!
- velcrovan 3mo agoAnd in assembler and machine code before that! I'm persuaded that just about every language is "homoiconic" and that _bicameral syntax_ is the actually-interesting thing about Lisps : https://parentheticallyspeaking.org/articles/bicameral-not-homoiconic/ https://parentheticallyspeaking.org/articles/bicameral-not-h...
- skydhash 3mo ago“code is data and data is code” is a fact of computing. What LISP does is to make it an official feature of the language and provide nice abstraction for it. A lot of languages want you to use some cumbersome reflection library, a dangerous eval function, or a crippled macro mechanism. With LISP, you just use the language mechanism in order to write code that process code.
- advisedwang 3mo ago> “code is data and data is code” is a fact of computing The general purpose computers we have today all follow that principal, yes. However it's not a fundamental fact of computing. Turing machines, cellular automata provide other paradigms. And if those aren't practical enough for you, ASIC programming is Turing complete but cannot access its code as data.
- skydhash 3mo agoState transition in the turing machine are not modifiable, but one of the core advantages of the TM is that it's powerful enough to emulate state transition. So you can model the states of the new machine as data, add the transition mechanism as code, feed those to the TM and you have a new machine that can interpret input that was unrecognizable by the previous one. That's how programming languages works. So yes, you can't modify the actual embodiment of the state transition if it does not offer you the capability to do so. But as long as it interprets data in a TM manner (input and output are colocated and the alphabet is the same), you can write code that will interpret data as code and manipulate code as data. Not by modifying the base substrate, but by adding a virtualization layer on top.
- Xirdus 3mo agoThat's less "code is data is a fact of computing" and more "if you ignore the part of code that's not data then all code is data".
- skydhash 3mo agoAt the base of it, the TM is an abstraction built with sets and relations. Just like most computers are merely signals flowing around a circuit that get generated from other physical phenomena and will be transformed to other physical phenomenas. You can't hack around physical laws, or ignore the axiomatical rules in mathematics. The code that is not data are those things. Everything else is data.
- Xirdus 3mo agoYou are redefining both the term "code" and the term "data" in ways that I don't think most people would agree with - and more importantly, in ways that make it impossible to talk about von Neumann architecture.
- skydhash 3mo agoBecause code and data as well as the von Neumann architecture are derived things, not fundamental stuff. The Turing Machine and Lambda Calculus are pure invention thats are logically sound. Almost everything else is downstream of that. By the time you get to programming language like C and LISP, and software like vim or firefox, everything is abstracted away and the only limits are self-imposed (or imposed by others that have done the work). They are not laws of nature. So yes there’s a definition of code and data. But for the Turing machine, there’s only the tape and its content.
- Xirdus 3mo agoThe pure logical concept of a Turing machine is a tuple of states, symbols and a transition function. These all very much do exist, and they're very much not written on the tape. So no, there isn't "only the tape and its content". I do not agree data is a derived term in computation theory. Code, maybe I can be convinced. But absolutely not data.
- eichin 3mo agoBASIC is older than most people realize, but it's still half a decade younger than Lisp.
- bitwize 3mo agoThe thing is in Lisp, data with a nice structure that you can easily work with is evaluatable as code; and all the code that runs has a nice structure and is easy to work with! You cannot easily manipulate and transform BASIC programs from within BASIC, and you cannot easily do anything in machine code. But maybe this is part of what Gerald Sussman was talking about when he called Lisp a "low level language": like machine code, Lisp has the nice property that its default data representation is used for building directly executable programs.
- pjmlp 3mo agoLisp shares with Forth a great feature, you only need to implement a few building blocks in Assembly, and then everything else can be built from them. Too many get lost in the concept that using something like C is the only way to build languages.
- anthk 3mo agoLisp predates BASIC. And ITS too.