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

JavaScript has the most important dynamic features of Lisp (GC, dynamic typing, first class functions, conditionals, eval, etc). JavaScript, is even a pretty solid tree processing language, because most JavaScript programs manipulate XML trees. XML is basically S-expressions with hundreds of pounds of useless clothing (end tags, attributes, etc) weighing it down.

Considering all this I think what Douglas Crockford said is completely accurate, JavaScript is Lisp in C's clothing. That would also make CoffeeScript Lisp with fairly nice clothing.



> JavaScript has the most important dynamic features of Lisp (GC, dynamic typing, first class functions, conditionals, eval, etc).

The reason this doesn't hold up is because there are a bunch of other languages that also have most of those features of Lisp, and some of them are older than JS. Python, Ruby, and Perl all have similar features. Every language has conditionals now so it's not even worth mentioning. Even Java has GC, broken closures, and reflection.

> JavaScript, is even a pretty solid tree processing language, because most JavaScript programs manipulate XML trees. XML is basically S-expressions with hundreds of pounds of useless clothing (end tags, attributes, etc) weighing it down.

You can manipulate XML in Java and C, does that also make Java Lisp in C's clothing, or C Lisp in C's clothing? Lisp macros manipulate code as trees, but that doesn't mean that any language that can manipulate trees is a Lisp. XML isn't JavaScript code, it's just data. The trees that Lisp macros manipulate is data and also Lisp code.

> Considering all this I think what Douglas Crockford said is completely accurate, JavaScript is Lisp in C's clothing.

It's not "completely accurate". It's mostly inaccurate. It's a cute pithy platitude, but it's not really helpful. Just Google "code is data" and see what kinds of confusion is out there about this.

Apology to Douglas Crockford, who does good work. I actually came back to Lisp through his JavaScript lectures, so I feel a bit bad being harsh.


You can do anything in any Turing-complete language. JavaScript not only can manipulate trees, it often does. Of course, rather or not you see Lisp in it depends upon how you are identifying Lisp.




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

Search: