2 ms·
This is a reasonable characterization of homoiconicity. Interestingly, by this definition, v8's implementation of Javascript is homoiconic since functions can
by kmill 9y ago
This is a reasonable characterization of homoiconicity.
Interestingly, by this definition, v8's implementation of Javascript is homoiconic since functions can be converted to strings, recovering the actual source text for its definition.
I once took advantage of this to make a Smalltalk-like source editor for Javascript: http://tmp.esoteri.casa/grip/ http://tmp.esoteri.casa/grip/ (things might no longer work since I last was using it four years ago; I lightly edited it tonight to get it to start up without a file server. Only tested in Chrome!)
It's based on an class-based object system I made that can serialize all of its class definitions. This drives both the class browser and the code serializer/saver.
(Right now it has two code browsers because I was in the process of making a nicer one. Somehow, I had the idea that I was going to program a whole webapp with this thing, but I lost motivation.)