4 ms·
Rebol, Io, Smalltalk & Perl6 are also examples of non s-expression homoiconic languages.
by draegtun 13y ago
Rebol, Io, Smalltalk & Perl6 are also examples of non s-expression homoiconic languages.
- joe_the_user 13y agoc++ too ... just kidding But more seriously, it seems like once one starts expanding the definition, homoiconicity gets to be in the eye of the beholder. "In a homoiconic language the primary representation of programs is also a data structure in a primitive type of the language itself." So you can take a monster language (at least any one with an eval command - Perl5 say), expand it's syntactical definition and get a "homoiconic language". http://en.wikipedia.org/wiki/Homoiconicity http://en.wikipedia.org/wiki/Homoiconicity
- StefanKarpinski 13y agoFully agree – homoiconicity ends up being almost more of a standard library feature rather than an essential part of the core language. For example, how does the existence of Python's ast module [1] not make Python homoiconic? The main difference, it seems, is how much the language lets you leverage having a representation of code as data to generate code, e.g. with macros. There are projects like macropy [2], but the core Python language doesn't provide macros – although I can't really fathom why at this point since most of the features are there. [1] http://docs.python.org/3/library/ast.html http://docs.python.org/3/library/ast.html [2] https://github.com/lihaoyi/macropy https://github.com/lihaoyi/macropy
- draegtun 13y agoI know what you mean. In my examples I think only Perl6 is stretching the definition of homoiconicity, NB. are Perl6 Grammars == data structure/primitive ?? However Rebol (blocks & words) & Io/Smalltalk (objects and messages) do fully meet the definition you give above for being an homoiconic language.