Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

WHAT? They skipped all the way from Lisp to JS? Why?


view as:

JS has always been a LISP in Algol clothing.

Only, you know, without List Processing. And seventeen things that test false. And all numbers being floating-point (except when optimized implementations fudgily pretend that small values are integers). And a switch statement that you have to put into a function in order to get a return value out of it (everything returns a value in Lisp). Maybe it's more of a Scheme in Algol clothing; not everything returns a value in Scheme.

And no tail-call recursion.

Actually Scheme is Algol in LISP clothing. I don’t know what that makes JavaScript.

There were some similarities, but I'd say Scheme is more different than similar.

Scheme is GC'd

Scheme is fundamentally based on functions rather than proceedures

Scheme functions are first-class

Scheme uses tail recursion in place of loops

Scheme uses CPS and continuations (even though that was no doubt a mistake)

Scheme has symbols and programs are composed of symbols.

Scheme makes use of macros pervasively (not even C-style preprocessors were in ALGOL)

Scheme has only expressions while ALGOL has statements.

A lot of surface-level API designs and names seem inspired by ALGOL, but the fundamental building blocks seem very different to me.


Scheme adapted lexical scoping and block structure from Algol 60. Lexical scoping was a major departure from LISP in 1970s. Call/CC was not in the original Scheme. Probably added in R4RS. Macros came later too. My point was that calling JS Scheme in Algol clothing even less valid than calling Scheme Algol in LISP clothing!

Legal | privacy