5 ms·
Just to be clear the prototypal inheritance came from Scheme, but the funcational aspects of JavaScript came from Lisp. Scheme's influence on JavaScript was, a
by austincheney 10y ago
Just to be clear the prototypal inheritance came from Scheme, but the funcational aspects of JavaScript came from Lisp. Scheme's influence on JavaScript was, at the time, indeed an open question. On the other hand they absolutely told Eich not to do anything that resembled Lisp. JavaScript was to be Java's little brother and it had to look like and mostly act like its big brother. Eich made it work like Lisp anyways thinking they wouldn't notice given the incredibly short development window and the fact that as long as there was an inheritance concept it would satisfy the "feel enough like Java bit".
Of course nobody noticed JavaScript had influences from Lisp. It was buggy when it initially rolled out and it took a couple of revisions before nested functions were supported. This is backed up by David Flanagan's book "JavaScript: The Definitive Guide", which doesn't mention nested functions and closures until its third edition in 1998, because JavaScript didn't have closures until then. Whether it was a missing feature or due to a defect is something you would have to ask Eich directly.
- hellofunk 10y agoScheme is a lisp, so this is a rather confusing statement. In fact as lisp dialects go, Scheme is typically more functional than Common Lisp.
- goatlover 10y agoPrototypal inheritances comes from Self, not Scheme. Self was inspired by Smalltalk, with a similar environment, but decided to abandon classes in favor of prototypes.