Homoiconicity: A language property where code is written in the language's own basic data structure — making code trivially inspectable and generable as data. Homoiconicity means a language's code is written in the same data structures the language uses for data. In Lisp and Clojure, code is made of lists, so a program can read, inspect, build and transform other code as easily as any other list.
This makes macros very powerful. A macro is a function that receives code as data and returns new code, which lets developers add new syntax and constructs to the language itself.
What should you keep in mind with Homoiconicity?
Most mainstream languages are not homoiconic, but the idea shows up in other forms. Tools work with abstract syntax trees to analyse and rewrite code, as PHPStan, Rector and ESLint do. Configuration as data, such as JSON or YAML that a program interprets, borrows the same insight in a simpler way.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.