News for hackers. Stuff that matters.
Re:Homoiconicity Revisited by p_l on Friday June 05, 2020 @10:57AM (#23429272)
Nope. The homoiconity of Common Lisp and its related ancestor Lisps is based on the fact that the source code you compile is not textual. Yes, there is CL:READ. Notice however that CL:COMPILE and CL:EVAL does not take text. It takes data structure that is also the datastructure manipulated with macros and which you can easily operate upon. Which can be easily serialized in the form of S-Expression.
Re:Homoiconicity Revisited by sanderjd on Friday June 05, 2020 @12:29PM (#23430347)
Wouldn't a parser library that returns a data structure that is the one passed to the equivalent of EVAL and also the one acted on by macros fit this definition? And then also the ability to easily serialize it back into textual syntax? If so, this doesn't seem to require S-Expressions or lisp, but rather, like the parent comment said, just a good macro and parser library design. (It is true that languages haven't generally seemed to prioritize this feature, I'm just saying that I don't see any reason it must be fundamentally unique to lisps.)
Re:Homoiconicity Revisited by p_l on Saturday June 06, 2020 @03:56AM (#23437522)
Think of it more in terms of how the language is specified. Common Lisp is specified in terms of data structure, not text, and you can depend on that particular data structure and manipulate it etc.

a 3rd party library that, to be portable, needs to ultimately serialize to text, does not support homoiconicity.

Re:Homoiconicity Revisited by sanderjd on Saturday June 06, 2020 @10:15AM (#23439330)
Is it really specified in terms of data structure? Are there not rules in the language specification regarding how s-expressions are parsed? Could I create a, for instance, C-like syntax that parses to and can be serialized from this data structure specification, and call that a valid Common Lisp? If so, neat! I do think more languages should be less defined by their concrete syntax.
Re:Homoiconicity Revisited by p_l on Saturday June 06, 2020 @11:14AM (#23439726)
Yes - the standard does cover "Common Lisp Reader", but it's essentially a self-contained chapter - every special form, standard macro etc. is defined in term of the data structures. So what you'd have is, at most, an extension - to be compatible with Common Lisp, CL:READ would still need to read S-Expressions with standard readable, and CL:WRITE write S-Expressions, but nothing stops you from adding extra reader that uses a different syntax.
Re:Homoiconicity Revisited by lispm on Friday June 05, 2020 @01:26PM (#23431142)
Lisp is written in the data structure.

But that's not a requirement for macros. One can write macros from a parsed AST. But that's not what Lisp does.