4 ms·
Netscape had originally planned to use Scheme as their scripting engine. But then Java took off and they wanted something that looked similar... So we ended up
by shakna 10y ago
Netscape had originally planned to use Scheme as their scripting engine. But then Java took off and they wanted something that looked similar... So we ended up with a ten day hack.
- throwanem 10y agoEich ascribed the result less to internal Netscape politics and more to the Scheme interpreter taking longer to implement than expected and there needing to be some scripting language in the browser that shipped - it was either JS or something that he described as being very like PHP avant la lettre. IIRC this happened in comments on jwz's blog - cite on request, though you'll have to excuse me for waiting until i'm back at a machine with a keyboard and a big display before I go hunting it down again.
- zeveb 10y agoIt's really hard to believe that implementing a Scheme or Lisp would be slower than implementing JavaScript, so I would indeed be interested in your cite. My recollection is that Eich's bosses wanted something that looked like CJava++.
- throwanem 10y agoSee your sibling comment (if you haven't already).
- zeveb 10y agoHmmm, I guess my takeaway from that is that it had to look like C, and that iron constraint combined with the time pressure to mean that good features from Scheme were left out, not that implementing JavaScript rather than Scheme was due to time pressure.
- throwanem 10y agoYup. (And it would just figure that, the one time I describe something based on a half-decade-old recollection and don't throw in an "as I recall" qualifier, it'd be the time I misremember in a significantly erroneous way.)
- kbutler 10y agohttps://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/#comment-1018 https://www.jwz.org/blog/2010/10/every-day-i-learn-something... duskwuff: So, since I have to ask: What would we be stuck with if JS hadn't happened? Brendan Eich: Something like PHP only worse, which Netscape's VP Eng killed fast (in early July 1995, if memory serves; I did JS in early-mid-May) since it was "third" after Java and JS. Two new web programming languages were hard enough to justify... also: Ten days to implement the lexer, parser, bytecode emitter (which I folded into the parser; required some code buffering to reorder things like the for(;;) loop head parts and body), interpreter, built-in classes, and decompiler. I had help only for jsdate.c, from Ken Smith of Netscape (who, per our over-optimistic agreement, cloned java.util.Date -- Y2K bugs and all! Gosling...). Sorry, not enough time for me to analyze tail position (using an attribute grammar approach: http://wiki.ecmascript.org/doku.php?id=strawman:proper_tail_calls http://wiki.ecmascript.org/doku.php?id=strawman:proper_tail_...). Ten days without much sleep to build JS from scratch, "make it look like Java" (I made it look like C), and smuggle in its saving graces: first class functions (closures came later but were part of the plan), Self-ish prototypes (one per instance, not many as in Self). and: Scheme was the ideal admired by the JS supporters at Netscape, and the trick used to recruit me. But (see above) the "look like Java" orders and the intense time pressure combined to take out a lot of good ideas from Scheme that would've taken longer (not much longer, sigh) to implement. One example: just the C-like syntax makes tail calls harder (or less likely: consider falling off the end of a function returns undefined, so the last expression-statement before such an implicit return is not in tail position).
- BrendanEich 10y agoNo, I never started implementing Scheme. Where did you read that? Netscape didn't "plan" to do Scheme in any deep or detailed way, either. It was a gleam in the eyes of jg & mtoy when they recruited me. By the time I got there the Java deal was on, and MILLJ was the management edict.