4 ms·
> If you think that homoiconicity is good, then you probably like lisp. If you think that referential transparency is good, then you probably like haskell. Thos
by JadeNB 14y ago
> If you think that homoiconicity is good, then you probably like lisp. If you think that referential transparency is good, then you probably like haskell. Those are mutually exclusive, so one language can't really have both.
This mutual exclusivity is a strange claim that I have never encountered before (but I'm not a computer scientist). Could you explain it?
- jeffdavis 14y agoI gave some more technical details in another reply. It's one of those things I thought for a long time, and I didn't think was very controversial, but I suppose it is. Really, what I meant was the metaprogramming associated with homoiconicity can't be done in a useful and referentially transparent way. That's because "eval"-like things are not referentially transparent. However, there are other uses for homoiconicity aside from executing the code in an eval-like way. For instance, a text editor might use that property to inspect and transform the code being edited more easily. Also, I'm sure there are plenty of times it just makes things easier. I think metaprogramming is also at odds with static analysis (e.g. a good type system), simply because the code itself is not static enough to analyze.