2 ms·
This is a very good comment and in my point much more valuable then the actual blog post. I ask myself based on this world view if there are useful other repre
by ktpsns 9y ago
This is a very good comment and in my point much more valuable then the actual blog post.
I ask myself based on this world view if there are useful other representations beyond the popular choices of lists and strings. Apparently, lists (like in lisp) are already so universal that they can represent any kind of structural data.
- lisper 9y agoThanks for the kind words. Yes, lists are universal, but so are many other kinds of data structures (including strings, obviously, since there is a 1-to-1 mapping from lists to strings). So mere universality is not the killer feature. In fact, there is no one "killer feature". It's a confluence of lots of little details. Two of the details that turn out to matter most is having symbols, and not having comas as separators in the surface syntax. Those two things are the difference between S-expressions: (defun foo (x y) (baz (bar x) (bing y))) and JSON, which can represent the exact same thing: ['defun', 'foo', ['x', 'y'], ['bar', 'x'], ['bing', 'y']]] but obviously you wouldn't want to write your code like that. You might be able to improve on linked lists as a code representation. You could, for example, use vectors instead of linked lists (i.e. cons cells) or maybe associative maps (i.e. dictionaries) as a core data structure. It's not hard to try out things like this in Lisp, so if you really want to know what happens, just grab yourself a Lisp interpreter (or even better, write one yourself) and try it.