r/AskProgramming • u/hgcrl • May 24 '26
Algorithms How does Homoiconicity works ?
Hi to everyone,
After graduating in economics, and using a lot of R, I wanted to improve my programming skills, and to understand it more conceptually.
So I choose SICP to start the journey, but as many of you might know, the book uses Lips.
The justification of the use of the language comes from its abstraction capacity as I understand, and with a characteristic named homoiconicity.
And this is where I can't get the concept properly, code and data keep the same "form" ? What do we mean
0
Upvotes
View all comments
Show parent comment
2
u/jibbit May 24 '26
in javascript.. you have code, and you can use json to load data. json can represent a few core types.. numbers, dates, arrays, etc. it's useful if you want to pass data around.. but json doesn't have a way to represent anything js can. in js for example, a variable can contain an expression, but there's no way to put that in json and pass it around. so what if you kept extending json to support all the things? functions, classes, etc. ? now the json would be able to hold data AND code - but it would still look very different from js - so you would have two ways to express the same thing.. one that can easily be passed around (the json) and one that can't (the js). so, why keep the js? just get rid of it. the json now IS THE PROGRAMMING LANGUAGE - and the way to pass data around. both things. homoionic.