|
|
|
|
|
by Androsynth
4761 days ago
|
|
javascript has json though, which doesnt make it homoiconic, but it allows you to mimic homoiconicity in a lot of cases. When I write in javascript, I tend to store my data in json and and write code that is generic, with much abstraction that has a small foot print to manipulate the json. That is scheme-like. That is psuedo-homoiconic. (If anyone in the know wants to add or refute this, I would love to know whether my non-cs intuition is correct here.) (also it is still a very mutable language, even with coffeescript/underscore) |
|
The advantage of homoiconicity is that the language itself is manipulable as a basic type in the language. In Scheme, this means that it's easy to generate, analyze, and modify Scheme code using simple procedures in Scheme. e.g. I could (although I wouldn't) generate a scheme expression to compute an arbitrary fibonacci number with[1]
Notice that I'm not just pushing strings together to write code. I'm actually manipulating data structures in the language to produce and modify code. That is homoiconicity.