Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>So it's not that surprising that Javascript also inherited homoiconicity from Scheme.

Actually it didn't. Javascript is not homoiconic. JSON just happens to be almost like a homoiconic version of the Javascript array and dict data types, but that stops there.

For one, there are some restrictions to what can be valid JSON that are not the same for JS code. And then there are functions etc, which are not in JSON.

And the idea that JS is somehow related to Scheme isn't really true (despite being repeated even by Eich). What it has common with Scheme, tons of other languages that nobody will ever say of them to be related to Scheme have. What it doesn't have in common is what makes Scheme scheme. See also:

http://journal.stuffwithstuff.com/2013/07/18/javascript-isnt...



That article states that Javascript isn't Scheme, which is a point I never argued (I think you've read far too much into my "inheritance" point).

Javascript was inspired by Scheme, and obviously other languages as well. Since we're referencing Eich, he has also personally talked[1] about how he was hired at Netscape to write a Scheme for the browser and how he later developed a new language with ideas borrowed from Scheme (as well as Self, TCL and a few other languages IIRC). Thus there are obviously going to be some inheritance from Scheme in Javascript; even if they are conceptually very different languages and even if those qualities inherited are also shared amongst a multitude of other languages.

You see, something doesn't have to be exactly like, nor even uniquely like, to still have inheritance. Much like how derivative works in art where the predecessor stands up as an original piece - separate from the parent's vision - despite sharing the same lineage. Such is the beauty of derivative works - you can take inspiration from the preceding material yet still invent something different.

So that's what I meant when I said that Javascript inherited homoiconicty from Scheme (though obviously I was wrong about Javascript being homoiconic itself - and I thank you for that correction)

[1] http://brendaneich.com/2008/04/popularity/


>Javascript was inspired by Scheme, and obviously other languages as well.

Well, I didn't argue that JS isn't Scheme (that is of course obvious).

I argued that it doesn't seem to have anything specifically Schem-y about it.

Eich says it was "inspired by scheme", but I, like the article author, fail to see any such inspiration.

JS doesn't have Scheme syntax, nor does it have Scheme semantics (of course that's obvious to see). It also doesn't have the most celebrated Scheme features (from homoiconicity and macros to tail call optimization). And all the other stuff (GC, closures, etc), was already available in languages predating Scheme, and he knew that (Lisp, Smalltalk, etc).

And he even mentions the language Self, which is a much closer to JS than Scheme. I think he mainly just wanted to do a Scheme, but INSTEAD he did JS, which is mostly Self, Java syntax and a few other ideas thrown together.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: