Homoiconicity - Uses, Advantages, and Disadvantages

Uses, Advantages, and Disadvantages

One advantage of homoiconicity is that extending the language with new concepts typically becomes simpler, as data representing code can be passed between the meta and base layer of the program. The abstract syntax tree of a function may be composed and manipulated as a data structure in the meta layer, and then evaluated. It can be much easier to understand how to manipulate the code since it can be more easily understood as simple data (since the format of the language itself is as a data format).

The simplicity that allows this also presents a disadvantage: it usually does away with many of the visual cues that help humans visually parse the the constructs of the language. This can lead to a steep learning curve for the language.

A typical demonstration of homoiconicity is the meta-circular evaluator.

Read more about this topic:  Homoiconicity