Re:John Carmack working on Scheme as a VR scripting language
by cwp on Wednesday July 01, 2015 @03:20PM
(#9814461)
Yes. See Smalltalk for a language with object-oriented homoiconicity.
[ Parent
| on HN ]
Re:John Carmack working on Scheme as a VR scripting language
by stray on Wednesday July 01, 2015 @08:06PM
(#9816115)
That's not really homoiconicity though, is it?
Smalltalk source code does not appear to be expressed in terms of a Smalltalk data structure. Whereas Lisp source code is expressed as lists of lists.
Re:John Carmack working on Scheme as a VR scripting language
by cwp on Wednesday July 01, 2015 @10:24PM
(#9816533)
Sure it is. All parts of a Smalltalk program are present as objects that can be manipulated by sending them messages. Classes, methods, variable bindings, closures, stack frames, even individual messages are objects.
As a practical matter, methods also have a textual representation, but that's not strictly necessary. Ten or fifteen years ago, the Squeak method browser had a mode where you could write Smalltalk code using tiles, kind of like in Etoys, no parsing necessary. That was a hassle to use, though, so people stuck with writing methods using text.
By the way, Lisp has the same sort of "impurity". S-expressions are very simple, but they are syntax. It's surely possible to create a tool that would let one construct cons cells in memory directly, but that would be a hassle. Instead we use parentheses.