Jon Sterling ([@jonmsterling](https://twitter.com/jonmsterling)) - June 5, 2022 4:48 PM
This is a great thread. I think the concept of “homoiconicity” could not have been invented by someone who understood that overloading notation is equivalent to…not overloading notation. [twitter.com/lexi_lambda/st…](https://twitter.com/lexi_lambda/status/1533446192662814720)
> Alexis King ([@lexi_lambda](https://twitter.com/lexi_lambda)) - June 5, 2022 9:50 AM
>
>
> [@NlightNFotis](https://twitter.com/NlightNFotis) [@ShriramKMurthi](https://twitter.com/ShriramKMurthi) [@proteusguy](https://twitter.com/proteusguy) [@ImperiousGrdsmn](https://twitter.com/ImperiousGrdsmn) imo, the solution here is to just forget about “homoiconicity” (which doesn’t mean anything) and instead just focus on the individual components, namely the concrete syntax, `quote`, and `eval`, all of which have plenty of unique and interesting properties in their own right.
>
>
> [Tweet link](https://twitter.com/lexi_lambda/status/1533446192662814720)
[Tweet link](https://twitter.com/jonmsterling/status/1533551433190080520)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 5, 2022 11:12 PM
[@jonmsterling](https://twitter.com/jonmsterling) Semantically equivalent--absolutely!
But isn't that the point? Homoiconicity is about syntax, not semantics. For example, Lisp is homoiconic because it uses an S-expression syntax for code.
[Tweet link](https://twitter.com/JAldrichPL/status/1533648042317987840)
---
Jon Sterling ([@jonmsterling](https://twitter.com/jonmsterling)) - June 6, 2022 1:31 AM
[@JAldrichPL](https://twitter.com/JAldrichPL) This explanation doesn’t really cover what people say when you ask them what the point of homoiconicity is. they say “code is manipulable as data” and things like that, but this statement is one that doesn’t depend on notation. It just so happens to be a degenerate property, as
[Tweet link](https://twitter.com/jonmsterling/status/1533682895591723008)
---
Jon Sterling ([@jonmsterling](https://twitter.com/jonmsterling)) - June 6, 2022 1:32 AM
[@JAldrichPL](https://twitter.com/JAldrichPL) code is always manipulable as data in any language. I think it is a non-concept — not just something that is missed if you take an overly invariant perspective.
[Tweet link](https://twitter.com/jonmsterling/status/1533683126903484417)
---
pentagram axiom ([@pentagramaxiom](https://twitter.com/pentagramaxiom)) - June 6, 2022 4:04 AM
[@jonmsterling](https://twitter.com/jonmsterling) [@JAldrichPL](https://twitter.com/JAldrichPL) the idea is that when you do a roundtrip of programmatically manipulating code and pretty printing it, you preserve character-for-character the code and comments that are unchanged
in theory this is always possible (eg metadata in AST) but in practice it is only possible in lisp
[Tweet link](https://twitter.com/pentagramaxiom/status/1533721437160153088)
---
pentagram axiom ([@pentagramaxiom](https://twitter.com/pentagramaxiom)) - June 6, 2022 4:07 AM
[@jonmsterling](https://twitter.com/jonmsterling) [@JAldrichPL](https://twitter.com/JAldrichPL) this isn't "code is data from the perspective of the compiler author" this is "code in my repository is data when I need to programmatically change it"
lisp programmers look upon IDE refactoring tools and say "Look what they need to mimic a fraction of our power"
[Tweet link](https://twitter.com/pentagramaxiom/status/1533722333243797504)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 6, 2022 8:20 AM
[@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Right! Code is manipulable as data in any language, but when the *syntax* of code is the *syntax* of data, that becomes easier.
[Tweet link](https://twitter.com/JAldrichPL/status/1533785809282793473)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 6, 2022 8:21 AM
[@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Homoiconicity is *obviously* a real thing and it's *obviously* important to Lisp-ers. But to define it you need to consider both syntax and the impact of that syntax on what "code as data" means. Again, I think this blog does a thoughtful job:
[twitter.com/JAldrichPL/sta…](https://twitter.com/JAldrichPL/status/1533652626344136704)
> Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 5, 2022 11:30 PM
>
>
> [@NlightNFotis](https://twitter.com/NlightNFotis) [@ShriramKMurthi](https://twitter.com/ShriramKMurthi) [@lexi_lambda](https://twitter.com/lexi_lambda) [@proteusguy](https://twitter.com/proteusguy) [@ImperiousGrdsmn](https://twitter.com/ImperiousGrdsmn) At first glance, this seems like a thoughtful definition:
>
> [expressionsofchange.org/homoiconicity-…](https://www.expressionsofchange.org/homoiconicity-revisited/)
>
> I wonder, what do people who know more about Lisp-family languages than me think about it?
>
>
> [Tweet link](https://twitter.com/JAldrichPL/status/1533652626344136704)
[Tweet link](https://twitter.com/JAldrichPL/status/1533786239324782593)
---
Jacques Carette ([@jjcarett2](https://twitter.com/jjcarett2)) - June 7, 2022 9:14 AM
[@JAldrichPL](https://twitter.com/JAldrichPL) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Having the same syntax for code and data is a sort of local optimum in the design space of meta-programming. It does ease human-level comprehension of certain things -- in much the same way that quasi-quotes do. But it's a local optimum because it's massively unsafe.
[Tweet link](https://twitter.com/jjcarett2/status/1534161881572712450)
---
Sam Tobin-Hochstadt ([@samth](https://twitter.com/samth)) - June 7, 2022 9:19 AM
[@jjcarett2](https://twitter.com/jjcarett2) [@JAldrichPL](https://twitter.com/JAldrichPL) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Having the same syntax for code and data just is what quasiquote does. So I don't understand what you're saying.
[Tweet link](https://twitter.com/samth/status/1534163244960600065)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 7, 2022 9:25 AM
[@samth](https://twitter.com/samth) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Ah, but if you added quasiquote to Java, it wouldn't be the same. The point of homoiconicity is that the native format for code and for data is basically identical, even without the quasiquote shortcut.
[Tweet link](https://twitter.com/JAldrichPL/status/1534164739290550272)
---
Sam Tobin-Hochstadt ([@samth](https://twitter.com/samth)) - June 7, 2022 9:27 AM
[@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) But, as I said in a different thread, that statement is trivial if it's not about quote.
[Tweet link](https://twitter.com/samth/status/1534165062654611456)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 7, 2022 11:00 AM
[[@samth](https://twitter.com/samth)](https://twitter.com/samth) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Where? A quick twitter search for "@samth quote trivial" didn't bring it up.
I'm confused about why you would think this is trivial. Do you mean it's just syntax? Syntax is not trivial.
[Tweet link](https://twitter.com/JAldrichPL/status/1534188615940579328)
---
Sam Tobin-Hochstadt ([@samth](https://twitter.com/samth)) - June 7, 2022 11:11 AM
[@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) I mean that it's trivial because all languages can represent their code as data.
[Tweet link](https://twitter.com/samth/status/1534191334684340225)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 7, 2022 11:31 AM
[@samth](https://twitter.com/samth) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Ah, but what I said is "the native format for code and for data is basically identical, even without the quasiquote shortcut." Any language can represent code as data, but in most languages it *looks* very different!
[Tweet link](https://twitter.com/JAldrichPL/status/1534196285619810304)
---
Jonathan Aldrich ([@JAldrichPL](https://twitter.com/JAldrichPL)) - June 7, 2022 11:32 AM
[@samth](https://twitter.com/samth) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) I would argue that this is not at all a trivial difference. It's the essence of why homoiconicity is useful.
This is also the point of the blog post I linked to above.
[Tweet link](https://twitter.com/JAldrichPL/status/1534196559029600257)
---
Sam Tobin-Hochstadt ([@samth](https://twitter.com/samth)) - June 7, 2022 11:34 AM
[@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@jonmsterling](https://twitter.com/jonmsterling) Right, and as I explained, that blog post still doesn't present a coherent definition. But "looks different" doesn't work either. Haskell has quote, so does MetaOCaml. And strings look just like the code you write!
[Tweet link](https://twitter.com/samth/status/1534197177009876994)
---
pentagram axiom ([@pentagramaxiom](https://twitter.com/pentagramaxiom)) - June 7, 2022 1:20 PM
[@samth](https://twitter.com/samth) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) does this boil down to "What's the difference between `'(...)` and `parse "..."` ?"
[Tweet link](https://twitter.com/pentagramaxiom/status/1534223769861906433)
---
mnl ([@mnmlmnl](https://twitter.com/mnmlmnl)) - June 7, 2022 3:42 PM
[@pentagramaxiom](https://twitter.com/pentagramaxiom) [@samth](https://twitter.com/samth) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) What I like about metaprogramming in lisp is that I generate code by writing "`(dolist (,x ,whatever) ,@.somemorecode))" which looks very close to "(dolist (x whatever) somemorecode))", which is what I want to generate. That I need to gensym my x is not that big a deal.
[Tweet link](https://twitter.com/mnmlmnl/status/1534259436130279425)
---
Sam Tobin-Hochstadt ([@samth](https://twitter.com/samth)) - June 7, 2022 3:46 PM
[@mnmlmnl](https://twitter.com/mnmlmnl) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) But you can metaprogram in JavaScript just like that too: `for (let ${x} in ${whatever}) { ${somemorecode} }`
[Tweet link](https://twitter.com/samth/status/1534260511067488264)
---
mnl ([@mnmlmnl](https://twitter.com/mnmlmnl)) - June 7, 2022 3:50 PM
[@samth](https://twitter.com/samth) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) I was just thinking about that, and why that doesn't spark the joy it does in lisp. I think it starts to get messy when you get into `const foo = { ${join_dict_entries_because_commas(generate_some_entries(),
// do we care about significant ws?
maybe_some_keys_maybe_not())} };`.
[Tweet link](https://twitter.com/mnmlmnl/status/1534261542266384384)
---
mnl ([@mnmlmnl](https://twitter.com/mnmlmnl)) - June 7, 2022 3:51 PM
[@samth](https://twitter.com/samth) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) I have written a lot of jinja templates recently (SQL, js, python, c++, golang as target languages) which is similar. There always was some messy edge case. Python with its whitespace in particular is maddening. So yes and no. With lisp i don't have too worry too much (some...)
[Tweet link](https://twitter.com/mnmlmnl/status/1534261769463545856)
---
mnl ([@mnmlmnl](https://twitter.com/mnmlmnl)) - June 7, 2022 3:52 PM
[@samth](https://twitter.com/samth) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) strings just don't compose as easily as sexps. i could see myself doing ```
const program = for_in(x, whatever, somemorecode())
```
if i was doing it all in js
[Tweet link](https://twitter.com/mnmlmnl/status/1534262143964561408)
---
mnl ([@mnmlmnl](https://twitter.com/mnmlmnl)) - June 8, 2022 7:55 AM
[@samth](https://twitter.com/samth) [@pentagramaxiom](https://twitter.com/pentagramaxiom) [@JAldrichPL](https://twitter.com/JAldrichPL) [@jjcarett2](https://twitter.com/jjcarett2) [@jonmsterling](https://twitter.com/jonmsterling) A couple more thoughts. Being able to write macros in "lisp" means I reuse the actual symbols of normal code. This gets me autocomplete, autodoc, find usages, ide refactoring while metaprogramming, which is much harder with strings, even with scaffolding libraries.
[Tweet link](https://twitter.com/mnmlmnl/status/1534504285802741760)