3 ms·
> Could you implement Smalltalk environment in browser in two weeks? You're being unfair: you compare a Javascript interpreter against a Smalltalk environment.
by loup-vaillant 13y ago
> Could you implement Smalltalk environment in browser in two weeks?
You're being unfair: you compare a Javascript interpreter against a Smalltalk environment. Obviously, If I were in a rush, I would start with a simple interpreter first.
Realistically, if you don't really care about performance (I doubt Brendan Eich did at the time), implementing a JavaScript interpreter is neither easier nor harder than implementing a Lisp or Smalltalk or Self interpreter. I maintain that ease of implementation simply was not an influential factor either way.
Therefore, Javascript was invented for other reasons. My best guess is, Brendan Eich wanted his language to be non-intimidating to C, C++, and Java users. Apparently, it worked.
Oh. That is a typical "Worse is Better".
Okay, I retract. "Worse is Better" is an excellent explanation for Javascript. There are just other kinds of short term benefits persisting through time than the mere ease of implementation.
- Ygg2 13y agoOk. Then implement a Smalltalk interpreter in a week. And then make it look like Java, because that was Brendan's task.
- loup-vaillant 13y agoHmm… I think that's pretty much what Brendan did, although he likely started with Self instead of Smalltalk. JavaScript makes a strong emphasis on objects, and had closures from the beginning. Then it has a Java-ish syntax. As for actually implementing a smaltalk interpreter, it can now be done in 300 lines: http://www.youtube.com/watch?v=EGeN2IC7N0Q http://www.youtube.com/watch?v=EGeN2IC7N0Q (I believe he used Maru http://piumarta.com/software/maru/ http://piumarta.com/software/maru/ ) With current techniques, a language specialist can implement Smalltalk in a day. I'm not that strong, though. It could take me from a week to a month, depending on how much I need to learn. (Parsing the syntax is easy, but I'm less sure about the semantics.)