Slashdot Mirror


Brendan Eich Discusses the Future of JavaScript

snydeq writes "JavaScript creator Brendan Eich talks at length about the future of JavaScript, ARAX, disputes with Microsoft, and the Screaming Monkey scripting engine for IE in an interview with InfoWorld's Paul Krill. JavaScript 2, which Mozilla's Eich expects to be available in some form by the end of the year, will 'address programming in the large.' To do that, Eich hopes to improve the integrity of the language without sacrificing flexibility and making JavaScript 'painfully static in a fixed way like Java does.' Eich does not expect Firefox support for JavaScript 2 until at least Version 3.1 of the browser. As for Internet Explorer, Eich explains how Screaming Monkey will help bring JavaScript 2 to IE should Microsoft drag its heels on providing meaningful support."

164 comments

  1. 1-page version by taupin · · Score: 5, Informative

    is here.

  2. Really? by Goaway · · Score: 3, Insightful

    We can't expect support for Javascript 2 in Firefox until the next version? But I want it to magically appear in the current one!

    1. Re:Really? by UnknowingFool · · Score: 1

      Considering Javascript 2 isn't really done until the end of the year, there's no reason it should be in the current version. Remember 3.1 will be a point release not a full release so 6 months away to the next point release isn't unreasonable.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    2. Re:Really? by Twigmon · · Score: 1

      Also, the technology used in web development lags about 2 years behind current browser technology.

      Unfortunately, it is going to be a very log time until Javascript 2 is used in the real world.

    3. Re:Really? by Pollardito · · Score: 2, Funny

      since the last version prior to 3.0 was 2.0.0.14, 3.1 might be further off than it sounds

    4. Re:Really? by Demiansmark · · Score: 3, Informative

      RTFA. The interview ends with a discussion about how they may be implement JS 2.0 with or without the support of IE through Screaming Monkey, and if it rolls out with Firefox 3.1 then the normal cycle of waiting years for the majority of browsers to support it shouldn't apply.

    5. Re:Really? by Mongoose+Disciple · · Score: 1

      You're assuming everyone uses the most current version of their chosen browser. That would generally be the smart thing to do, so of course it's not what people as a whole actually do. :)

    6. Re:Really? by Aaron+B+Lingwood · · Score: 1

      I typed about:config but couldn't set dom.javascript2.enabled to true.

      --
      [Rent This Space]
    7. Re:Really? by Goaway · · Score: 1

      See, that was one of these "jokes" making fun of the wording of the article.

    8. Re:Really? by GeckoX · · Score: 1

      How many people downloaded FF3 last week? (Heck, my Dad even did of his own accord, never even mentioned the existence of FF3 to him)
      And how many people have automatic-updates turned off in windows?

      It's not an assumption, it's a reasonable expectation. This isn't 1999 anymore.

      --
      No Comment.
    9. Re:Really? by Mongoose+Disciple · · Score: 1

      And how many people have automatic-updates turned off in windows?

      Nearly every company of medium or greater size. They want to roll out on their schedule, not Microsoft's. I'm not going to argue whether or not this is a smart choice -- it's just the reality out there.

      Shit, over a quarter of the world is still using IE6 -- and IE7 is two years old.

    10. Re:Really? by GeckoX · · Score: 1

      And yet, I did not suggest that all browsers were always updated immediately did I?
      Are you really suggesting that browser update penetration and time lines are as slow as they were 8 years ago? When people used what came on their computer and never ever updated it?

      Updating a browser is not nearly the big deal it used to be perceived as.

      --
      No Comment.
  3. Re:My $0.02 worth by Gewalt · · Score: 1

    The only thing is... I'm worried about how much damage its replacement will cause.

    --
    Modding Trolls +1 inciteful since 1999
  4. Ow. by taupin · · Score: 4, Funny
    This statement made my mind hurt:

    "[...] use JavaScript as kind of an underlying assembly language [...]"

    1. Re:Ow. by Anonymous Coward · · Score: 2, Informative

      It means that the target language of the compiler is JavaScript. In this case, Ruby code, which the browser does not understand, is compiled to JavaScript code, which the browser can run. The association is that normally computer languages are compiled to some sort of assembly language, which is then compiled to object code.

    2. Re:Ow. by Anonymous Coward · · Score: 0

      This statement made my mind hurt:


      "[...] use JavaScript as kind of an underlying assembly language [...]"

      Morfik (proprietary) and GWT (open source) does this already. I must admit although it feels weird for some time, you get used to it.

      History repeating itself - Javascript is the new assembly. And yet I wonder if devs of common browsers will ever introduce lower level primitives or ways to access to their Javascript runtime environments in the name of optimization and efficiency.

    3. Re:Ow. by PCM2 · · Score: 3, Interesting

      And yet I wonder if devs of common browsers will ever introduce lower level primitives or ways to access to their Javascript runtime environments in the name of optimization and efficiency.

      I've heard it said that the JavaScript code output by GWT often gives better performance than hand-coded JavaScript, because the GWT compiler is free to use every dirty syntactic trick in the book to wring the most performance out of the code. By comparison, hand-coded JavaScript has to be read and maintained by humans. Almost everyone sacrifices a little bit of performance for the sake of being able to maintain the code. But since you don't ever maintain the JavaScript part of the GWT application -- you write in Java, maintain the Java code, and treat the JavaScript pretty much as bytecode -- there's no need to worry about whether the JavaScript is written in the "cleanest" way possible. It's OK for GWT to generate code that favors performance over any other criteria.

      --
      Breakfast served all day!
    4. Re:Ow. by Anonymous Coward · · Score: 0

      That's retarded. Assembly language provides a human readable interface to the hardware. JavaScript and other high-level languages are abstract and hardware independant. It makes no sense to call them assembly languages. I can write a compiler that targets Ruby, but calling Ruby an assembly language because of that would just be stupid.

    5. Re:Ow. by shutdown+-p+now · · Score: 1

      Oh, that's nothing. Imagine transparent client-to-server remoting on top of that (i.e., part of the code just runs on the server, and other part is compiled to JS which runs on the client) - now that is insanity.

  5. Javascripts popularity is no real suprise by pembo13 · · Score: 2, Insightful

    VBScript sucks balls and Javascript is capable of getting the job done.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    1. Re:Javascripts popularity is no real suprise by vivin · · Score: 4, Insightful

      Javascript has the potential to be really useful. Well, it already is. I was at JavaONE earlier this year and I went to a few Javascript sessions. One of the most eye-opening sessions was the one where the presenter described Javascript as a LISP-1 language that just happens to look like C.

      As far as improvement, I think it needs a proper object oriented model (the current one is far too confusing), and also should be friendlier to implementations that require recursion. You can write recursive code in Javascript now, but it's very slow. Iterative solutions are faster.

      --
      Vivin Suresh Paliath
      http://vivin.net

      I like
    2. Re:Javascripts popularity is no real suprise by pembo13 · · Score: 2, Informative

      Well iterative solutions are almost always faster across languages.

      --
      "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
    3. Re:Javascripts popularity is no real suprise by Twigmon · · Score: 1

      Well.. We will just use whatever tools we are given to accomplish what we need to do. Javascript is *almost* everywhere, and it is simple to build a site that degrades gracefully on unsupported browsers.

      VBScript is not available on the number of customer machines as Javascript is.

    4. Re:Javascripts popularity is no real suprise by JohnnyBGod · · Score: 2, Informative

      You can write recursive code in Javascript now, but it's very slow. Iterative solutions are faster.

      Which means... it's pretty much like every imperative language on the planet?

    5. Re:Javascripts popularity is no real suprise by vivin · · Score: 3, Informative

      You can write recursive code in Javascript now, but it's very slow. Iterative solutions are faster.

      Which means... it's pretty much like every imperative language on the planet?

      Recursive solutions in other languages are slower than iterative solutions but not by as much as a factor when compared to recursive vs. iterative solutions in Javascript.

      The Javascript interpreter in browsers does not really optimize recursive code. Compare this to other interpreted languages (this paper talks about LISP, and Javascript incidentally, is a LISP-1 language), or compilers. This is why most tips for Javascript optimization talk about removing recursion because of bad performance of recursive code in Javascript.

      So if you're able to optimize for recursion in Javascript 2, it wouldn't impact performance as much as it does now.

      --
      Vivin Suresh Paliath
      http://vivin.net

      I like
    6. Re:Javascripts popularity is no real suprise by rolux · · Score: 1

      If you consider what these guys are doing with JavaScript 1, then can anyone tell me why we need JavaScript 2?

      (Hint: We *don't*.)

      --
      My next comment will be ready soon, but moderators can beat the rush and mod it up early.
    7. Re:Javascripts popularity is no real suprise by Anonymous Coward · · Score: 0

      That's a really naive question.

      It's not always what you can do with something but how it is done.

      Why a c when there is asm. A c++ when there is c. I can go on for hours.

      Syntax and built in functionality do matter and javascript is years behind in both.

    8. Re:Javascripts popularity is no real suprise by MemoryDragon · · Score: 1

      Problem with javascript is it looks nice on paper but fails miserably productivitywise in bigger systems. The main issues are, no dedicated namespacing which makes mixing of various libraries a real hell (no worries propotype will fix everything by simple hijacking the dollar operator which then is also used by jquery and others, also it makes huge sense to simply override the array so that other libraries fail....), the other really weak point lies in the way it exposes inheritance. It has semi like class constructs (everything is a function, even classes are functions) and then simply provides the virtual method table. The result was that every library added its own sometimes broken sometimes not but often incompatible way of inheritance to deal with the bigger codebase.

      The third and biggest problem is the browsers themselves, javascript most of the times is used in browsers and then you have to program against a central singleton/beast out of hell. The dom tree with behavior different over most browsers. This singleton is an antipattern in itself, instead of having small page parts which are not influencable by others every code targetted against the page has to rely on this singleton and has to hope that no other code does some modifications which break things. Componentization is a hell in itself in such an environment. There are solutions to the problem but they only work on exactly one browser and leave the others out.

      And yes javascript is very Lisp alike with functions being the core of everything if you drill down. It is a functional language in its core which looks like C, but that does not clear up its deficiencies for bigger systems. Sorry for that. I spend 90% of my coding time currently in javascript doing component programming and I really see the problems with it. The academic crowd might cheer, but I always love it when I have to leave javascript land for a while programming in other languages other areas of programming simply are way less painful. Javascript once things become bigger feels a lot like C++ in the pain it can inflict on the programmer, actually it feels way worse!

    9. Re:Javascripts popularity is no real suprise by famebait · · Score: 1

      So we don't need to jump through the hoops that they do?
      _possible_, they're supposed to make them easier too.

      --
      sudo ergo sum
    10. Re:Javascripts popularity is no real suprise by famebait · · Score: 3, Informative

      That's what TFA and Javascript 2 is about: JS1 is the way it is because it was meant to be small and simple. Usage has changed and thus requirements, and JS2 is the first opportunity to fix the big things.

      --
      sudo ergo sum
    11. Re:Javascripts popularity is no real suprise by MemoryDragon · · Score: 1

      Yes, I was aware that they are going to fix things, the main issue here is the browsers which still count for 95% of all javascript usages have to standardize. A plugin for the IE is a no go. Applets would work really fine nowadays they cannot be used due to being a plugin, flash only can be used because everyone has flash on his machine, once Microsoft drops the default flash install on a future windows version flash will go the same way applets did. Unfortunately standardizing new language versions is one thing, getting the browser vendors to support it another one. (See various things the W3C standardizes)

    12. Re:Javascripts popularity is no real suprise by TheRaven64 · · Score: 1

      Not true for any algorithm which maintains an internal stack on any modern CPU. Most modern CPUs will have very fast push and pop instructions, often aliased with hidden registers. If you write a recursive implementation, you get to use these. If you write an iterative solution, you don't. If your compiler supports tail call optimisation (most do) then you also get the space usage of an iterative solution.

      Try running some benchmarks before you make general statements in future. In languages which are compiled to native code the recursive solution is very often faster.

      --
      I am TheRaven on Soylent News
    13. Re:Javascripts popularity is no real suprise by Anonymous Coward · · Score: 0

      In my opinion (and it carries all the weight of some anonymous coward), sometimes the easiest solution, instead of recursion, is to write code that generates code and executes it on-the-fly. This is equivalent to unfolding loops, but on a function scale: all in a compact, albeit difficult to read form. I think JavaScript, being an interpreted language, really lends itself well for this.

    14. Re:Javascripts popularity is no real suprise by tcr · · Score: 1

      no worries propotype will fix everything by simple hijacking the dollar operator which then is also used by jquery and others
       
      jQuery plays nice by letting you disassociate $ by calling jQuery.noConflict(). I like their attitude.
      Not sure about the other libraries.

      --


      Information wants to be beer.
    15. Re:Javascripts popularity is no real suprise by jonasj · · Score: 1

      Applets would work really fine nowadays they cannot be used due to being a plugin, flash only can be used because everyone has flash on his machine, once Microsoft drops the default flash install on a future windows version flash will go the same way applets did. *What* are you talking about? Flash is not and has never been part of a default Windows install.
      --
      You know, Microsoft's street address also says a lot about their mentality.
    16. Re:Javascripts popularity is no real suprise by cecom · · Score: 2, Interesting

      You make be taking this claim that JavaScript is a LISP language a little too far. A couple fundamental things that are missing are macros, tail recursion ... Lastly, and perhaps most importantly, this is not how JavaScript is widely being taught and used.

    17. Re:Javascripts popularity is no real suprise by vivin · · Score: 2, Interesting

      It's not a claim:

      JavaScript Programming Language: The language everyone loves to hate

      Javascript and LISP

      Douglas Crockford's page on Javascript

      As far as your last point regarding how Javascript is being widely taught and used, all it states is a major problem with the way the language is understood. Just because a language is taught a certain way doesn't mean that the language IS that way. If you delve deeper into Javascript you'll see that it's more like lisp and less like C or Java.

      --
      Vivin Suresh Paliath
      http://vivin.net

      I like
    18. Re:Javascripts popularity is no real suprise by cecom · · Score: 2, Informative

      As far as your last point regarding how Javascript is being widely taught and used, all it states is a major problem with the way the language is understood. Just because a language is taught a certain way doesn't mean that the language IS that way. If you delve deeper into Javascript you'll see that it's more like lisp and less like C or Java.

      But I have. If you delve deeper into LISP you will see that calling a language without tail recursion and macros LISP-like is an exaggeration ...

      The links you have provided concentrate on closures, and closures, while no doubt very useful, are not the one defining characteristic of LISP. The first link (the PDF) is the only one that actually contains any data to justify the claim, but it simply ends up repeating the same thing several times for stronger effect. "Functions are first class objects" - no more than in most other languages including C. "Functions can be higher order" - duh, this is implied by closures. In short, while the individual arguments are true, the whole PDF loses credibility because it doesn't objectively discuss the important differences between LISP and JavaScript. It is not sufficient to simply emphatically claim something :-)

      I do agree that JavaScript has some important LISP-like traits, and that it is more powerful than many people really realize, but calling it a LISP is just exploiting the unfortunate fact that almost nobody knows LISP.

    19. Re:Javascripts popularity is no real suprise by Haeleth · · Score: 2, Insightful

      If you delve deeper into LISP you will see that calling a language without tail recursion and macros LISP-like is an exaggeration ...
      Congratulations: you have come up with a definition of "LISP-like" that excludes both McCarthy's original LISP and ANSI Common Lisp. You must be proud.
    20. Re:Javascripts popularity is no real suprise by vivin · · Score: 2, Informative

      I'd say a strong case is made for Javascript's "LISPness" even without tail-recursion and macros. I get what you are trying to say, in that LISP != Javascript and that Javascript is not LISP (because it's a language in its own right). But I'd go so far as to say that Javascript has more in common with LISP-like languages than imperative ones. This is why Javascript is used wrongly quite often. In fact, when I realized Javascript was so much like LISP, everything fell into place. I've written LISP code before and once I started thinking "functionally", Javascript suddenly became more powerful.

      "Functions are first class" and "Functions can be higher order" in that document are not simply there for effect. The fact that Javascript has closures is very important because you can have lambdas/anonymous functions just like lisp. For example, consider the Y-combinator in Javascript:

      function Y(le) function Y(le) {
              return function (f) {
                      return f(f);
              }(function (f) {
                      return le(function (x) {
                              return f(f)(x);
                      });
              });
      }

      vs. the same in Lisp:

      (define Y
          (lambda (le)
              ((lambda (f) (f f))
                (lambda (f)
                    (le (lambda (x) ((f f) x)))))))

      You couldn't do it that easily if Javascript wasn't so lisp-like :)

      --
      Vivin Suresh Paliath
      http://vivin.net

      I like
    21. Re:Javascripts popularity is no real suprise by cecom · · Score: 1

      So, ANSI Common Lisp doesn't have macros now ? As far tail recursion, it is true that typical CL programming style doesn't require tail recursion, but many (most?) implementations do offer it.

      Was your point that JavaScript really is CL in disguise ?

      But, yes, the original poster (and the referenced links) said LISP-1 (Scheme), so I should have been more explicit.

      BTW, the lack of tail recursion _and_ goto in the same language is a fundamental limitation. (I am referring to the well known paper)

    22. Re:Javascripts popularity is no real suprise by cecom · · Score: 1

      I think we are basically in agreement.

      As another poster noted, I was thinking more of Scheme, and not Lisp in general. The power of Scheme, (and what I perhaps incorrectly projected to all Lisp) lies in being able to express anything (multiple-entry-exit procedures, indexed jumps, switch/case, loops, while/break, gotos, exceptions, co-routines, etc) using just the fundamental language constructs - lambdas with tail-recursion and continuations. Perhaps more importantly, besides emulating most constructs from other languages, it allows for powerful new ways of expression which are impossible in other languages. Combine that with macros and you have the ultimate power. (Of course, it is a pity that there isn't a single usable Scheme implementation (well, probably with the exception of Bigloo http://www-sop.inria.fr/mimosa/fp/Bigloo/ )

      So, from that angle, JavaScript is much closer to Java and C than Lisp-1.

      On the other hand, closures and higher order functions are not necessarily Lisp specific. You can write the Y Combinator in SML, etc.

  6. Insightful by Mensa+Babe · · Score: 4, Interesting

    I wholeheartedly agree with Brendan that we should at any cost stop JavaScript in particulat and Ecmascript in general from being as painful as Java in any way possible. However what we should do is not only improving all of the ECMA-262 derivatives but to make a systematical progress towards better flexibility and interoperability of various scripting approaches in the future. Take for example the wonderful project by Mehmet Yavuz Selim Soyturk called PJS which is an important step in the direction to allow the Parrot virtual machine, designed to run Perl, Tcl, Javascript, Ruby, Lua, Scheme, Befunge, Lisp, PHP, Python, Perl 6, APL, Java, .NET, et al., to run on JavaScript, so all of those languages could be used together to enhance your browsing experience on the Web. For this to be even remotely plausible the JavaScript must be as flexible and as fast as possible because it would basically mean running high-level language code compiled to the Parrot intermediate representation (PIR, or IMC), that converted to the Parrot assembly language, assembled, linked, converted to Parrot bytecode and then execuded on the Parrot virtual machine or PVM which would itself be a large JavaScript interpreted script running in a Web browser, running in the operating system... You get the picture. A logical step forward would be to include PVM in all of the major browsers to run the Parrot bytecode natively and efficiently in the browser. There are already plans to include PVM interpreter in Firefox which means it will be available as a viable target for scriping dynamic html pages for all of its derivatives like Camino, Galeon and Konqueror. Hopefully the commercial browsers would follow (the Artistic license is not anti-commercial like GPL so there should be no legal problems with the integration). I really look forward to the future of perfect interoperability when every single Web page could potentially run scripts written in literally dozens of programming languages simultaneously. One day we will experience that synergy thanks to people like Brendan Eich,Mehmet Yavuz Selim Soyturk, Larry Wall, et al. if they only agree to work together on one common solution to the big mess of Web scripts that we have today. Let's all hope they will.

    --
    Karma: Positive (probably because of superiour intellect)
    1. Re:Insightful by lightversusdark · · Score: 2, Funny

      You can't spell superior.
      Or use line breaks.

      --
      "There is nothing nice about Steve Jobs and nothing evil about Bill Gates." - Chuck Peddle
    2. Re:Insightful by Simon+(S2) · · Score: 1

      There are already plans to include PVM interpreter in Firefox which means it will be available as a viable target for scriping dynamic html pages for all of its derivatives like Camino, Galeon and Konqueror. Just a quick note: Konqeror does not use jecko, the HTML rendering engline ff uses, but KHTML.
      --
      I just don't trust anything that bleeds for five days and doesn't die.
    3. Re:Insightful by Anonymous Coward · · Score: 1

      Mensa_Babe, did you ever hear of paragraphs or are they somehow beneath you?

      I see loads of shit about parrot but frankly I can't focus on it (free as in too-much-beer). I like register based VM's and Tamarin (cool as it is) is never going to give other VM implementations (excluding luaJIT) the ass-kicking they so richly deserve.

      Can you please do a cliff notes version for this inebreated AC? Many thanks...

    4. Re:Insightful by Simon+(S2) · · Score: 1

      jecko = gecko...

      --
      I just don't trust anything that bleeds for five days and doesn't die.
    5. Re:Insightful by Red+Flayer · · Score: 2, Insightful

      Don't worry about it. Troll, (s)he is... better ask Surak. Or one of the other sockpuppets.

      --
      "Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
    6. Re:Insightful by Anonymous Coward · · Score: 1, Interesting

      What I wonder is does the idea of embedding the Parrot VM into Firefox mean that the Mozilla developers have re-thought their stance on the "no threads in JavaScript" issue?

      To me this is still the single missing feature that makes me believe that JavaScript is still a toy language that really shouldn't be used for anything major. Without dedicating a thread to the UI, there's absolutely no way to ensure that you have a responsive UI. It also makes unit testing certain things a huge bitch. The other serious issues that are being addressed in JavaScript 2 (packaging, typing, etc) are all basically annoyances compared to this issue.

    7. Re:Insightful by Anonymous Coward · · Score: 0

      jecko = gecko... jingo!

    8. Re:Insightful by jo42 · · Score: 1

      That reads like marketing pablum...

    9. Re:Insightful by Anonymous Coward · · Score: 1, Informative

      You can sort of do threads in JavaScript.

      Well, except you can't touch any UI, that's all single-threaded main-thread-only. That means you can never do it for web pages, because those things have a global object that's, umm, the window. As in, a UI thing. Oops.

      Using threads in JS XPCOM components that never touch the DOM (which would be analogous to what a hypothetical Parrot VM would be doing; see also PyXPCOM) would work. Mostly. (The global object there is "BackstagePass")

      You just have to ignore a few assertions.

    10. Re:Insightful by mollymoo · · Score: 1

      Google Gears will let you do threads in JavaScript, so you can make responsive apps which do something approaching real work. The lack of threads is a bitch though, you have to not do anything too strenuous, live with an unresponsive GUI or do something really dirty like insert SetTimeout calls in your heavy lifting code to give the UI a chance (and hope the OS/browser can manage a short enough timeout that performance doesn't turn entirely to poop).

      --
      Chernobyl 'not a wildlife haven' - BBC News
    11. Re:Insightful by ahabswhale · · Score: 1

      I strongly agree with the idea of using a VM that supports many languages than being locked into JavaScript/ECMAScript like we are now. I cannot stand that language but there's not freedom right now. Sun had the right idea with their language neutral VM so now you can run anything from Ruby to Scala to Groovy on it (which are all far superior to JavaScript IMHO). That said, I wouldn't want to use a newly designed VM for this. I would prefer that everything sit on the JVM.

      --
      Are agnostics skeptical of unicorns too?
    12. Re:Insightful by m50d · · Score: 1

      Konqueror is not a firefox derivative, but an independent project. You can tell by the way it doesn't leak hundreds of megabytes of memory.

      --
      I am trolling
  7. screaming monkey? by Red+Flayer · · Score: 3, Funny

    As for Internet Explorer, Eich explains how Screaming Monkey will help bring JavaScript 2 to IE should Microsoft drag its heels on providing meaningful support.
    Maybe it's just me, but I'm curious why he would name it "Screaming Monkey". I could see maybe an allusion to speed ("screaming" is sometimes a term used to describe something going really, really fast so s/Grease/Screaming makes sense, I guess).

    But really I think it shows the understanding Eich has for the thousands of codemonkeys hammering away at JS for IE. I'd be screaming too if I was coding JS for IE.

    On the other hand, I've had the (dis)pleasure of a rollicking night of Victory Golden Monkey followed by a visit from the Beer Monkey. Waiting for MS to make IE support JS2 might cause an additional night or two like that.

    FWIW, the Beer Monkey usually howls, rather than screams. YMMV... depending on the quantity of Golden Monkeys consumed.
    --
    "Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
    1. Re:screaming monkey? by FrankSchwab · · Score: 1
      --
      And the worms ate into his brain.
    2. Re:screaming monkey? by Anonymous Coward · · Score: 0

      Oh, that's named after Ballmer, no doubt.

      Need I mention the screaming and jumping he made when he showed off I don't know what product?

    3. Re:screaming monkey? by larry+bagina · · Score: 4, Interesting

      "Spider Monkey" is the mozilla/firefox javascript implementation. I read screaming as "kicking and screaming" -- ie, IE will get javascript 2 whether they want it or not.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:screaming monkey? by seanonymous · · Score: 1

      It's because lots of Vodka was consumed during development. 'Screaming' is bartender 'code' for 'vodka'.

    5. Re:screaming monkey? by Anonymous Coward · · Score: 0

      The current javascript engine for Mozilla products is called "Spidermonkey."

    6. Re:screaming monkey? by Anonymous Coward · · Score: 0

      Screaming monkey boy... DEVELOPERS DEVELOPERS DEVELOPERS etc.

      Be silent, caps filter

    7. Re:screaming monkey? by Anonymous Coward · · Score: 0

      Others have already mentioned SpiderMonkey being the current Mozilla JS engine; there's also plans for ActionMonkey, being the marriage of ActionScript (i.e. Tamarin, the Adobe JS engine) with SpiderMonkey.

      Oh, and IronMonkey for possibly running Iron[Python|Ruby] (i.e. CLR-ish things) with Tamarin.

      It's also easier to buy screaming monkey mascots.

    8. Re:screaming monkey? by rrohbeck · · Score: 1

      I had to think of Steve Ballmer immediately.

    9. Re:screaming monkey? by mkcmkc · · Score: 1

      Maybe it's just me, but I'm curious why he would name it "Screaming Monkey". Use IE for a while and you'll know...
      --
      "Not an actor, but he plays one on TV."
    10. Re:screaming monkey? by Zigg · · Score: 1

      Maybe it's just me, but I'm curious why he would name it "Screaming Monkey".
      When I first heard the name, I suspected it might be an allusion to Ballmer's infamous jumping-about-the-stage routine.
  8. synergy with html 5 by bcrowell · · Score: 5, Interesting

    IMO the changes proposed for js 2 aren't very exciting. The biggest problems with js aren't really problems with the language design, they're problems with the lack of standardization in the interface to the browser. I don't see the burning need to make js more oo, more statically typed, or more like java.

    What I think really will be cool is the synergy between js and html 5. Html 5 has lots of good features for doing web apps, including audio, persistent storage, and graphics (canvas, inline svg without xhtml). Most of this is stuff you could have done before using java applets or flash, but now you'll be able to do them using a w3c standard that the vast majority of users will probably end up actually having supported in their browsers.

    1. Re:synergy with html 5 by dukoids · · Score: 1

      Fully agreed. Maybe I'd like to see a class keyword that extends the object literal syntax to allow simple prototype definition, though...

      class Person {
        prettyName: function () {return firstName + " " + lastName}
      }

      Ok, perhaps also something like new Person() {firstName: "Bernd"})

    2. Re:synergy with html 5 by Actually,+I+do+RTFA · · Score: 3, Interesting

      flash, but now you'll be able to do them using a w3c standard that the vast majority of users will probably end up actually having supported in their browsers.

      It may not by a w3c standard, but I'd rather use Flash. The vast majority of end users already have it downloaded, and it really is uniform across browsers/OSes, unlike w3c standards. At least I don't need 5 browsers and 2 boxes to test all the significant combinations.

      Also, thanks to Adobe (probably the only think worth thanking them for) protecting the Flash name, Microsoft cannot do the embrace/extend/extinguish path on the name. HTML, JS, CSS, Microsoft was able to invent alternates for all these w3c standards. Even Java with J++. Not so with Flash.

      So I guess my point is, I'm willing to bet on greater market penetration of Flash, then of w3c compliant browsers.

      --
      Your ad here. Ask me how!
    3. Re:synergy with html 5 by SnT2k · · Score: 1

      With HTML5, I think it would actually be a bigger programming headache if JavaScript didn't get a makeover anytime soon if it intends to "synergize" with HTML5. I don't want a "JavaScript Framework" implemented on top of the language just to implement rudimentary OOP concepts like inheritance and namespaces. Granted, the current implementation lends itself to a different programming paradigm (which is definityle not the traditional OOP we come to love and hate) but, as I see so far, no mere mortal has yet to uncover a proper paradigm exposed by Logos... I mean... the prototype classes of JavaScript.

      Moreover, I believe that having a language makeover is a good way to "re-stabilize" the browser implementations: since the script languags is already a different monster the browsers might as well re-implement their front-end and because users/programmers are now more critical on the implementations as opposed to before, there's a good chance that the browsers would "get it right".

    4. Re:synergy with html 5 by mkcmkc · · Score: 3, Informative

      It may not by a w3c standard, but I'd rather use Flash. The vast majority of end users already have it downloaded, and it really is uniform across browsers/OSes, unlike w3c standards. At least I don't need 5 browsers and 2 boxes to test all the significant combinations. Well, you don't have to test to be sure that your Flash app probably won't run correctly under Linux, or for users who care about security (and will thus disable it), or for users who've given up after be pummelled with Flash ads, or on platforms that Flash doesn't support.

      Javascript sure has it's problems, but at least their is FLOSS code with which to fix them. With Flash, Adobe can pull the rug out from under you any time they like, as they did with their SVG plugin.

      --
      "Not an actor, but he plays one on TV."
    5. Re:synergy with html 5 by gaspyy · · Score: 1

      Ah, you're so out of time...
      Adobe has Open sourced the SWF file format, the Flex framework (for building .net-style flash apps) and donated the Tamarin (look it up) project to Mozilla. I'd say your worries are unfounded.

      Also, pull the plug on flash? One of their crown jewel? The plugin present on 98% of all computers? You got to be joking. They pulled the plug on SVG because no one wanted it. At the time, Adobe tried SVG as a possible competition to Macromedia (the owners of Flash); in the end, they figured it'd be easier to buy Macromedia than sell SVG as a viable alternative...

      Oh, and I know most slashdotters think flash==evil_ads, but you can build some very cool stuff with it; I am working on a chess game in AS3 (actionscript 3) and it's very rewarding; it makes me feel like when I was 13 and was playing with my ZX Spectrum...

    6. Re:synergy with html 5 by MemoryDragon · · Score: 1

      The burning need comes once you move out of the hello workd and 5 liner domain into real systems design... Sorry to say that...

    7. Re:synergy with html 5 by famebait · · Score: 1

      The biggest problems with js aren't really problems with the language design, they're problems with the lack of standardization in the interface to the browser. Not so. It is a problem you run into sooner, certainly, but it can be remedied with libraries, as all the ajax libraries do. The fundamental language design problems, however, are inevitable every time your code grows into a large system with several authors.

      Granted, the need for libraries means your system _does_ grow into that state sooner than strictly necessary, but it's still only a difference in degree. You really do need good support complex systems and multiple libraries.

      --
      sudo ergo sum
    8. Re:synergy with html 5 by GeckoX · · Score: 1

      Do you really think we don't know what Flash is capable of?
      This is /., open standards will be chosen above closed technologies every time. Further, Flash has been abused extensively, leaving a bad taste in the mouth for many. 98%? Totally pulled that out of your ass. I can find no data to back that up anywhere, none. Accessibility? Pathetic with Flash.

      Flash has it's uses. Flash will still exist in a JS2/HTML5 world. However, Flash will not supplant these, despite your desire for it to do so.

      I would be shocked if the improvements in JS2 and HTML5 didn't actually steal back a lot of 'market share' from Flash. Heck, the canvas tag alone opens up a world of possibilities that we used to have to relegate to Flash only. Don't take it as a personal insult, this is a good thing.

      --
      No Comment.
    9. Re:synergy with html 5 by Anonymous Coward · · Score: 0

      I'll be honest and say it's a while since I looked at Flash...
       
      However, I don't think a movie/frame/onionskinning paradigm is particularly useful for mainstream application development.

    10. Re:synergy with html 5 by Anonymous Coward · · Score: 0

      Great! Soon I'll be able to force-fed my graphic-intensive ads to people without the need of any plugin.

    11. Re:synergy with html 5 by jonasj · · Score: 1

      Adobe has Open sourced the SWF file format, the Flex framework (for building .net-style flash apps) and donated the Tamarin (look it up) project to Mozilla. I'd say your worries are unfounded.

      I'm sorry, but I don't think you know what you're talking about.

      They released _some_ documentation for the SWF file format (to say they "open sourced" it is nonsense), but that document were missing large portions necessary to implement the file format, and the information that they did release contained practically nothing that the free software community hadn't already reversed engineered, and the license agreement for their Flash player still contains anti-reverse engineering clauses which obstruct free software developers. The SWF documentation release was a big PR move with no substance.

      Read and/or watch from 3:20 of .

      The scripting engine that you mention (Tamarin) is only a small part of the Flash player, and Flex is just a project running on top of Flash -- it's no good in itself.

      --
      You know, Microsoft's street address also says a lot about their mentality.
    12. Re:synergy with html 5 by Actually,+I+do+RTFA · · Score: 1

      Well, you don't have to test to be sure that your Flash app probably won't run correctly under Linux, or for users who care about security (and will thus disable it), or for users who've given up after be pummelled with Flash ads, or on platforms that Flash doesn't support.

      Nice way to say "slashdot subscribers" many different ways, so the group can be counted multiple times. Fact is, Flash has something like a 98% install rate. Compare that to the penetration of browsers that can complete the Acid2 test. Hell, compare that to the penetration of browsers that don't mangle a couple common w3c standards. I'd rather lose Linux users than MS/IE users from my site (assuming that it's not an extremely technical site (I also dispute this assertion*).

      I disable Flash and JavaScript until given a reason not to (for security and ad purposes). I think most people disable both or neither. I tend to find Flash less annoying, but that's only because it tends to be more self-contained.

      Flash is supported on a ridiculous number of platforms. The Wii for instance. I don't know about the other consoles. Also, there is a huge by Adobe to get it onto cell phones.

      With Flash, Adobe can pull the rug out from under you any time they like, as they did with their SVG plugin.

      This statement is wrong. First, the swf file format is open*. Second, they pulled their plug on SVG, their Flash competitor, and then bought Flash for several billion dollars. Flash is ultimately what Java wanted to be, a universal language, albeit a simple one. It would be an impossible business case to discard Flash, unless it is so far in the future that the coding choice of www.whatever.com is no longer relavent.

      * Since the .swf format is open, I doubt there is not a valid player for Linux.

      --
      Your ad here. Ask me how!
    13. Re:synergy with html 5 by ELProphet · · Score: 1

      With Flash, Adobe can pull the rug out from under you any time they like, as they did with their SVG plugin. Yes, they could, but wouldn't that be a little more akin to shooting yourself in the head than throwing the baby out with the bathwater? Adobe's biggest products (read, cost to buy) are Photoshop, Premiere, and (after acquiring Macromedia) Flash. Their entire business is modeled around providing tools to build PDFs and Flash applications, and they're damned good tools. While you can bitch and moan about it being "proprietary" all you want, in the end that's what protects it- Adobe keeps and defends it as proprietary, and that's how they stay in business. Sorry, Flash is here for the long run.
    14. Re:synergy with html 5 by ahabswhale · · Score: 1

      90% of all Flash sites are HORRIBLE. They are so commonly bad that I block all flash now and won't go to a Flash only site.

      Also your assertion that it's uniform across browsers and OSes is true but Flash has different bugs that appear running in the same browser on different OSes (e.g. Firefox 2 on WinXP and Ubuntu). So it's just more debugging you have to deal with and it may take a while before a fix appears.

      IMHO, Flash is the worst thing to happen to the web.

      --
      Are agnostics skeptical of unicorns too?
  9. Here's what Javascript 2 looks like by vivin · · Score: 4, Informative

    This site has an example of Javascript 2, and a translator from Javascript 2 to the current version. I really like the type-safety features and the MUCH better way to do OO.

    In response to the parent, in the article they talk about how Microsoft is fixated on 3.1 and not 4. Hence, there is "Project Screaming Monkey" which aims to create a scripting engine for IE that can run Javascript 2 and not depend on Microsoft to support Javascript 2. Then, IE can support Javascript 2 (through the Flash Player - full details in the article). I wonder if it is possible to do something similar for Firefox. Perhaps via a plugin? But I suspect performance would suffer greatly. Or maybe 4->3.1 translator like at ecmascript4.com that would do an "on-the-fly" translation.

    --
    Vivin Suresh Paliath
    http://vivin.net

    I like
    1. Re:Here's what Javascript 2 looks like by weston · · Score: 4, Interesting

      I really like the type-safety features

      Fortunately, the type safety features will be optional.

      and the MUCH better way to do OO.

      This is a matter of opinion, and is definitely contested.

      Q: "If you could do Java over again, what would you change?"
      A: "I'd leave out classes" - James Gosling

    2. Re:Here's what Javascript 2 looks like by zoips · · Score: 1

      I really like the type-safety features and the MUCH better way to do OO. Javascript never really got prototypes right. I think the looks-like (duck typing) way of doing OO is very nifty, and prototypes (true prototypes like in Io and SELF) is probably one of the best ways of doing it.

    3. Re:Here's what Javascript 2 looks like by Pastis · · Score: 5, Informative

      > "If you could do Java over again, what would you
      > change?" "I'd leave out classes," he replied.

      "After the laughter died down, he explained that the real problem wasn't classes per se, but rather implementation inheritance (the extends relationship). Interface inheritance (the implements relationship) is preferable. You should avoid implementation inheritance whenever possible. "

      Not the same as saying that he didn't want java to be OO.

      http://www.javaworld.com/javaworld/jw-08-2003/jw-0801-toolbox.html

    4. Re:Here's what Javascript 2 looks like by Anonymous Coward · · Score: 0

      Javascript is OO without classes.

      GP, if I understood it correctly, was not talking about leaving OO out, but about Class-based OO vs. Prototype-based OO. Because GGP mentioned a "_way_ of doing OO"

    5. Re:Here's what Javascript 2 looks like by MemoryDragon · · Score: 1

      This depends on the point of view, there was a time between 92 and 2000 when implementation inheritance was seen as the goto of the 90s, due to the strong binding of code it provides. The view has changed somewhat, also due to the fact that without implementation inheritance you have to rely on delegation a lot and you get a huge code bloat. To my knowledge the goto still is an antipattern, implementation inheritance never fully made it onto the anti pattern list and again is an accepted pattern among others.

  10. HotRuby by DragonWriter · · Score: 4, Informative

    Eich says: "Some of these techniques, like HotRuby, actually translate Ruby into JavaScript."

    HotRuby implements, in JavaScript, a VM that executes Ruby 1.9 bytecode; it does not translate Ruby into JavaScript.

  11. JS 2 in FF3.1? by DragonWriter · · Score: 3, Informative

    Eich does not expect Firefox support for JavaScript 2 until at least Version 3.1 of the browser.

    That's kind of misleading: What he actually says (from TFA) is "They won't be in Firefox 3. They won't be in probably the 3.1 that we've talked about doing, but they might be in our [nightly] builds, our trunk builds. It'll be like a draft version of the spec, so we might call it JavaScript 1.9 or 1.99. We don't want to get people to confuse it with what becomes the final spec, but we have to be able to test it with real programmers and get usability feedback."

  12. I want embedded javascript by Chris_Jefferson · · Score: 3, Interesting

    I really like javascript as a language, independant of webapps. When I recently wanted to embed a scripting language in a C++ program I work on, I seriously considered javascript, as I thought more people would know it than lua and python. There does not however seem to be an easy way to embed javascript in an arbitrary program. Is there some reason it isn't suitable for this kind of thing, or is it just the browser writers embed the javascript too deeply?

    --
    Combination - fun iPhone puzzling
    1. Re:I want embedded javascript by Shados · · Score: 1

      Dunno... in Windows there's a billion way to do it, from the Windows Script Host for anything able to use COM components, to CodeDom for managed (.NET) environments, and a bunch of third party solutions.

      Dunno about the *nix world, however.

    2. Re:I want embedded javascript by MisterBlueSky · · Score: 1

      You can embed SpiderMonkey (http://www.mozilla.org/js/spidermonkey/) in your application to allow JavaScripting. But I don't how easy or difficult that would be.

    3. Re:I want embedded javascript by larry+bagina · · Score: 3, Interesting

      It's fairly trivial to embed WebScript/kjs. It's not terribly difficult to embed the mozilla/spider monkey interpreter either. It comes with a command-line javascript shell.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:I want embedded javascript by JebusIsLord · · Score: 3, Interesting

      I've not had a lot of experience with JavaScript, but the whole concept of writing a large application in a prototype-based language seems daunting to me. Probably because I always start with an object diagram, translate that to a class diagram, and then write the classes. What sort of code diagram would you use to describe the high-level object interactions in a javascript app? How does the source code get broken up? (I tend to use 1 file per class).

      --
      Jeremy
    5. Re:I want embedded javascript by Chris+Burkhardt · · Score: 3, Informative

      Many of these would probably suit you: List of ECMAScript Engines.

      Some helpful documentation:
      How to embed SpiderMonkey in your C/C++ program (try Rhino for Java apps).

      Although in my opinion Lua is so similar to JavaScript in all the right ways, and is so easily embedded, that it might be a better choice anyway.

      --
      "And there be unix which have made themselves unix for the kingdom of heaven's sake." - Matt. 19:12
    6. Re:I want embedded javascript by Anonymous Coward · · Score: 1, Informative

      Qt let's you do this. It comes with a Ecma-262 engine (i.e. javascript) that integrates with the rest of Qt in your code.

    7. Re:I want embedded javascript by Hank+Scorpio · · Score: 2, Interesting

      I'd recommend checking out the latest version of Qt. (4.4.0 was recently released, and now even includes a WebKit widget.) As of version 4.1, I think, it includes a module called QtScript which is a full JavaScript interpreter that can integrate very easily with your C++ code. You don't have to have a GUI to use Qt -- it is split into several libraries and you can easily omit the GUI libraries, and just use QtScript, if you'd like. Plus it has an excellent API that is a real pleasure to work with. Not to mention cross platform!

      Hmm, this sounds like an advertisement -- they're not paying me, I swear! I am just a very satisfied user (been using Qt for more than 5 years).

    8. Re:I want embedded javascript by Chris_Jefferson · · Score: 1

      Thanks, I shall look at QtScript. That looks list just what I want.

      --
      Combination - fun iPhone puzzling
    9. Re:I want embedded javascript by Anonymous Coward · · Score: 0

      I really like javascript as a language, independant of webapps.

      When I recently wanted to embed a scripting language in a C++ program I work on, I seriously considered javascript, as I thought more people would know it than lua and python.

      There does not however seem to be an easy way to embed javascript in an arbitrary program. Is there some reason it isn't suitable for this kind of thing, or is it just the browser writers embed the javascript too deeply?

      For me the real problem with JavaScript was the lack of broad standard libraries.
    10. Re:I want embedded javascript by Anonymous Coward · · Score: 0

      It is pretty easy to do this with JavaScriptCore from WebKit. I wrote an Apache module which allows you to run JavaScript on the server for laugh a few weeks ago.

    11. Re:I want embedded javascript by Anonymous Coward · · Score: 0

      An object diagram, seriously JavaScript is a prototyped language you can construct objects in JavaScript. As well if you use a JavaScript toolkit like Dojo it makes building web application and objects fairly simple.

    12. Re:I want embedded javascript by mollymoo · · Score: 1

      You do pretty much the same thing. It's really not very different, just imagine the class definition and constructor being rolled into one.

      You break up the source code however you like, but you often get many classes in one file because a) JavaScript apps and thus classes tend to be smaller than those in C++ or Java and b) you're usually loading it over HTTP so keeping the number of requests down helps. You can fetch new code and add things (eg. new methods) to objects and "classes" of objects at runtime, which can influence how you lay files out - you might have a "class" for a dynamic element which has collision physics in a separate file so you're not carrying that baggage when you're not using it for a game, but you use the same class elsewhere for simpler dynamic content. Working that way tends to flatten you "class" hierarchy - rather than Manager and Technician inheriting from Employee you can just have Employee and add Manager or Technician (or both) capabilities to it as and when required. That's basically how you do multiple inheritance, but you'd only do it at object creation time if you wanted a more class-based feel. You can design in a very similar style to rigid class-based languages if you want to, but you'll be missing half the fun.

      That kind of flexibility makes it easy to write code that's bug-prone and impossible to follow, let alone debug. Combined with the lack of strong typing, namespaces and the kind of debuggers other languages enjoy you need some discipline to write medium to large JavaScript apps - object checking, type checking, naming conventions and exception handling are essential tools.

      --
      Chernobyl 'not a wildlife haven' - BBC News
  13. Bright future by steveha · · Score: 3, Interesting

    Here's an overview of ECMAScript 4, the new version of JavaScript:

    http://www.ecmascript.org/es4/spec/overview.pdf

    It sure looks to me like they are taking all the coolest stuff from Python and grafting it onto JavaScript.[1] The result will be a language a lot like Python, but with code blocks wrapped in curly braces and no significant whitespace.

    One of the biggest changes will be a class inheritance model much more like Python's. The prototype-based inheritance will still be available, but I for one will be happy to use the new model.

    Already, my favorite features from Python have been grafted on to JavaScript, and are available right now in Firefox 2:

    http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7

    Steve Yegge has said that he thinks he knows what the "Next Big Language" will be. I think he is talking about JavaScript, and I think he may be right.

    steveha

    [1] If you are a fan of some other language, it may look to you like they are grabbing cool things from your language. And far be it from me to argue about which language a feature was "really" borrowed from. Python borrowed much of its cool features from other languages anyway.

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:Bright future by Anonymous Coward · · Score: 0

      Yes, Brendan and the others explictly say they are trying to make it more like Python in their Bugzilla comments. With new features especially they try to follow Python in corner cases, etc.

    2. Re:Bright future by quanticle · · Score: 1

      I think he is talking about JavaScript, and I think he may be right.

      Doubt it, and here's why. In the eleventh paragraph, he mentions this:

      JavaScript had Netscape, Sun, and Microsoft (among others).

      This, of course, means that JavaScript is already a big language in his eyes, therefore, it cannot be the next big language.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    3. Re:Bright future by SnT2k · · Score: 1

      Actually, with templated type parameters (i.e. generics), the 'like' keyword for type constraints (which resembles C++0x concepts), the 'nullable' data types (which resembles the use of pointers in C to an extent) and function bindings, it's starting to look a lot like C++/0x.

      If I'm not mistaken, ECMAScript 4 was partially implemented by AS3/Flex (actually, ECMAScript 3 + some features of 4). I've been programming on it for quite a while and I must say that I love it. It provides a near-perfect balance of static types (helpful for auto-completions) and dynamic types (useful for things like webservice invocation).

      Now if they would only provide us with operator overloading... (it would make linear algebra oriented calculations simpler). But in any case, I'm already happy enough as it is with better datatyping and traditional classes. The prototype paradigm used in previous Javascript versions doesn't lend itself too well to traditional OOP approaches.

    4. Re:Bright future by MemoryDragon · · Score: 1

      Here's an overview of ECMAScript 4, the new version of JavaScript:

      http://www.ecmascript.org/es4/spec/overview.pdf

      It sure looks to me like they are taking all the coolest stuff from Python and grafting it onto JavaScript.[1] The result will be a language a lot like Python, but with code blocks wrapped in curly braces and no significant whitespace.

      One of the biggest changes will be a class inheritance model much more like Python's. The prototype-based inheritance will still be available, but I for one will be happy to use the new model.

      Already, my favorite features from Python have been grafted on to JavaScript, and are available right now in Firefox 2:

      http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7

      Steve Yegge has said that he thinks he knows what the "Next Big Language" will be. I think he is talking about JavaScript, and I think he may be right.

      steveha

      [1] If you are a fan of some other language, it may look to you like they are grabbing cool things from your language. And far be it from me to argue about which language a feature was "really" borrowed from. Python borrowed much of its cool features from other languages anyway.

      Actually having real inheritance and still have the access to the virtual method table was there way before python, I dont think python has a single feature which was not copied from other languages. Even the code block feature which most non python users hate (and therefore not touch the language) was there before one way or the other. Not sure if there is even one feature which was invented by Python. Maybe one the language fanboys in public forums promoting their language... Ah no that was invented by the Lisp crowd :-) Sorry to be that harsh but my stance on ***fill in the language of your choice*** has changed somewhat. The last usable language which really brought new things onto the table was Smalltalk adn that one was invented in the 70s. All others either rehashed old concepts or if they tried to make new things were utterly unusable. The funny thing is that the scripting language domain is the worst in this regard. Not speaking necessarily of python, basically all newer scripting languages do the same with different syntax and everyone of those languages have their load of fanboys trying to promote their language as newest kid on the table doing fabolous things which smalltalk and others already did in the mid 70s.
    5. Re:Bright future by gwniobombux · · Score: 1

      I think he is talking about JavaScript, and I think he may be right. Doubt it, and here's why. In the eleventh paragraph, he mentions this:

      JavaScript had Netscape, Sun, and Microsoft (among others). This, of course, means that JavaScript is already a big language in his eyes, therefore, it cannot be the next big language.

      Sorry, parent's right. Yegge gave it away. One occasion I'm aware of is his OSCON keynote (flash video).
    6. Re:Bright future by Anonymous Coward · · Score: 0

      GP post:

      far be it from me to argue about which language a feature was "really" borrowed from.

      Your post:

      [a bunch of ranting about how everything pre-dates Python]

      Conclusion:

      YOU FAIL IT.

  14. Google Web Toolkit? by TheNarrator · · Score: 4, Interesting

    I can't believe nobody brought up GWT (http://code.google.com/webtoolkit/) yet.

    GWT is a system put out by Google whereby you write your code in a subset of Java and then it compiles the Java down to cross-browser compatible speed and size optimized Javascript.

    The implementation of Java is pretty good and includes just about everything you would expect except for threads. It's absolutely effortless to program in compared to hand coded Javascript -- especially for large projects.

    The other benefit is "hosted mode" whereby you run your webapp in a special runtime that lets one use Eclipse's modern interactive debugger to fix bugs in the Java code that gets turned into equivalent Javascript.

    If you want to see a neat demo of what can be done with GWT check out :

    http://www.gpokr.com/

    1. Re:Google Web Toolkit? by Anonymous Coward · · Score: 0

      If you want to see a neat demo of what can be done with GWT check out :

      http://www.gpokr.com/ [gpokr.com]

      Doesn't work in Opera 9.5

      This is GWT without Opera support. Epic fail.

    2. Re:Google Web Toolkit? by JakeD409 · · Score: 1

      This looks very cool. Have you used it? Do you know anyone else who has used it? I've found a bunch of descriptions of it on the web, but not a lot of "reviews" per se.

    3. Re:Google Web Toolkit? by Anonymous Coward · · Score: 0

      See my post above for a review, hint: it's an epic fail.

    4. Re:Google Web Toolkit? by AKAImBatman · · Score: 5, Informative

      I've used GWT. Here's the long and short of it...

      Pros: GWT is very cool in that you can quickly write Java-based interfaces that run in the web browser as Javascript. Because GWT includes a wide variety of components, interfaces are super-simple to create. You can even make your own widgets and reuse them as libraries to make even more complex widgets.

      Cons: (Better grab a seat.) It's nearly impossible to debug code outside of the GWT test shell. Which really sucks if your code relies on a web application in some way, but you can't decipher "Error in line 127: b is null". Which brings me to the next major problem. GWT does not integrate with Javascript very well. You can use a JNI-style interface to run bits of Javascript code in a Java method, but for the most part the worlds stay far apart. Which means that you can't easily use GWT objects or Javascript objects interchangeably to solve problems. More often than not, a Javascript object would be faster than the Java code you're writing. But since you can't intertwine them...

      Which brings me to the next con. Because the layout is determined by the construction of the built-in widgets, it's often difficult to achieve a layout that meets the specs. Doing simple things like removing spaces from tables, or applying pre-existing styles invariably end up more difficult to do than they should be. And even when you can apply a style, it applies the style to an element which is inside a container element (or vice-versa), thus preventing you from styling the layout of the specific element you're trying to target.

      Another frustrating aspect is that GWT dumps out hashed file names. Different hashes for every compile, too. Which wreaks all kinds of havoc with source control systems. Ideally you'll want to generate the Javascript code at compile-time because of this mis-feature. Unfortunately, GWT does not ship with an ANT plugin. You can find a few that people have made, but I haven't yet found one that's of particularly high quality.

      Generated GWT code is obviously quite large. Whatever you save with GWT's obfuscator is more than made up for by the fact that GWT compiles in its libraries every time.

      Last but not least (and quite possibly the most frustratingly), you can only plug the components together at compile time. Mixing and matching renderers, data models, and I/O backends at runtime is pretty much a no-no. You get it right when you compile it. Period. Which really reduces the flexibility of the technology. Instead of being able to combine plugins at runtime, you have to create a new project for every variation of the component. Alternatively, you can write your code to have a half-billion runtime settings.

      --

      If you want my advice, learn Javascript. GWT may provide you with a good stop-gap solution, but the trade-offs can be incredibly painful at times. And since Javascript is obviously not going anywhere, you know you'll get a good return on investing in the education. If you need a good place to start, Douglas Crockford has an excellent introduction to the language here. Also, trying READING the Javascript Client Guide. It really does explain the language well, including some of its incredibly advanced features. (That 95% of so-called JS coders have no idea exist.) :-)

    5. Re:Google Web Toolkit? by famebait · · Score: 3, Insightful

      No, that was the long of it.
      This is the short:

      Generated code is evil.

      Now for the medium:

      Code generation tends to look like it will save you time, but it usually only does so for the first five minutes, then it starts costing.

      A code generator is in fact a compiler (or a compiler is a code generator, if you will), and should be specced a such. That means:

      1) Unless the compiled code runs as reliably as that from established 'proper' compilers, it really is worse than useless. This is impossible unless your architecture and OS is fixed and known at compile time. For Java and similar, the VM is the architecture and the standard libraries are the OS. For javascript the architecture is the interpreter, but the OS includes is the browser's API.

      2) When things go wrong, you need to be able to track directly back to the source to develop efficiently. Java and pals retain enough in in the bytecode to do this well, and in C ou compile with debug symbols. Most code generators to Java and javascript dop nothing in this area, and cannot be debugged efficiently.

      --
      sudo ergo sum
    6. Re:Google Web Toolkit? by Eythian · · Score: 3, Informative

      I use GWT for a fairly large project. It does have it's problems, but I think they're far outweighed by the gains.

      Looking at your cons:

      Debugging outside of hosted mode is a bit of a pain, but there are things that make it easier. There is a module you can add that gives you a debug console, allowing 'printf' style debugging. Combine that with setting the compiler to output full names, rather than compressed ones helps. That said, I find it pretty rare to need to do that. 99% of issues are taken care of in hosted mode where you have proper debugging with eclipse.

      Styling of widgets appropriately comes with practice. You learn where you need to call .setStyleName/.addStyleName pretty quickly, and using things like firebug to experiment with CSS options makes it no more difficult than anything else.

      Hashed filenames are used to prevent browser caching issues. The browser will cache the large hashed filename, but not the small 'loader' file (because that's how you configure your server). So when you update the application, the client will always get the latest version. On the other hand, if you haven't updated, then the client can cache the large wad of javascript, thereby reducing load times. I don't put the derived files into version control anyway...they're derived files, you shouldn't need to do that, typically.

      You don't need an ANT plugin. I use:
      [java classpathref="gwt-classpath" classname="com.google.gwt.dev.GWTCompiler" fork="true" maxmemory="1512m" failonerror="true"]
              [arg value="-logLevel"/]
              arg value="ERROR"/]
              [!--arg value="-style"/]
              [arg value="PRETTY"/]--]
              [arg value="-out" /]
              [arg value="dist/gwtbuild" /]
              [arg value="${entrypoint}" /]
      [/java]
      (de-XMLed for slashdot)
      and it works fine.

      While the compiled javascript can be quite large, it's not accurate to say it includes all its libraries every time. It optimises any unused code out in order to reduce the size (I think this is why the compile process takes so damn long on a large project). If, instead, you mean that it doesn't load on demand, or separate them into files, or whatever...you (as a browser user) don't want that, it'll increase load time by causing more HTTP requests.

      I do agree that there is no runtime introspection such as reflection, in order to customise behaviour, but I haven't found that to be an issue. I just wrote the application to be flexible on its own. Load a different application model to have it do different things within one runtime. But, that is the way most regular java apps work anyway, until you get in to dependency injection and similar techniques.

      However, if you want to use all the handy tools that java coding gives you, and (almost) seamlessly pass complex objects between the server and the browser, there is nothing better that I'm aware of. Basically, our application manages a lot of data and presents it in various ways while allowing the user to interact with it in the browser, and GWT has been ideal for this. It's also nice that you can manipulate the output code if you really need to (e.g. part of my build.xml modifies the compiled javascript to prevent a bad interaction between firebug and the way the GWT JS does something).

      There are tradeoffs involved in taking a language from one environment (JVM) to another (JS), but I really don't think it's as bad as you make out.

    7. Re:Google Web Toolkit? by AKAImBatman · · Score: 1

      Combine that with setting the compiler to output full names, rather than compressed ones helps.

      That would help immensely. I have not found such an option, though. (And we've been looking for it!) How do you enable full symbols?

      Styling of widgets appropriately comes with practice. You learn where you need to call .setStyleName/.addStyleName pretty quickly, and using things like firebug to experiment with CSS options makes it no more difficult than anything else.

      My point was not that it can't be done, only that it is clunky. Invariably I have to rework my use of the widgets several times before I find a layout that I can style appropriately. This is less of an issue when you're building a desktop-replacement app, but it can be a bit figidty when you're trying to integrate GWT into an existing webpage layout. What's really interesting in my case is that our art department gives us mockup HTML so that we know the layout is feasible. Unfortunately, GWT has its own ideas about how components should be laid out, thus creating the wrestling match.

      Hashed filenames are used to prevent browser caching issues.

      Except they don't work. It is not feasible in many cases to configure the server not to cache the *.nocache.js. If it was a dynamic file it would be easier, but it's not. So the first step in testing a new compile in IE is... clear your cache. :-/

      You don't need an ANT plugin.

      Your solution is workable, but easy to break. Path issues cause enough headaches to where it has yet to be economical to switch over to GWT compiles for builds. Of course, our current situation is slightly complicated by a predecessor who configured quite a few projects without ANT. This does make converting more difficult than starting from scratch. :-)

      If, instead, you mean that it doesn't load on demand, or separate them into files, or whatever...you (as a browser user) don't want that, it'll increase load time by causing more HTTP requests.

      Not really. If you're using modular Javascript, it will be cached once and then reused after that. If I have 3 GWT components on my site, the AJAX, JSON, and GUI libraries are getting loaded three times over. If I have 3 Javascript-based components, the AJAX, JSON, and GUI libraries are loaded once, then reused by each component.

      Speaking of JSON, I distinctly dislike the way it's handled in GWT. One of the reasons why JSON is so great is that I have a simple Javascript Object once the JSON is parsed. In GWT I have to jump through an incredible number of hoops to retrieve the simplest value. e.g.:

      parsed.get("myvalue").isString().stringValue();

      Ouch.

      I just wrote the application to be flexible on its own. Load a different application model to have it do different things within one runtime. But, that is the way most regular java apps work anyway, until you get in to dependency injection and similar techniques.

      That's not really true. The MVC model of Swing is highly customizable, and SPIs make Java APIs extremely pluggable. Even if it was true that Java code is not highly pluggable, pluggability would still be the Javascript way. It's incredibly frustrating that I have to make a super-project that contains all possible variations of the component, plus code to configure all those possible variations. I'd much rather be able to take well-testing components, generically slap them together, and have a working component emerge.

      For example, let's say I've got a feature-rich component that displays records returned from the server. I originally write it to handle JSON data. Now let's say my company has a legacy XML stream they want to use the component with. I need to add XML as a feature to the component rather than writing a new data model that you would include

    8. Re:Google Web Toolkit? by TheNarrator · · Score: 1

      I admit, there is a big leap of faith with GWT. Basically you have to trust that the Google knows what they are doing with regards to understanding Javascript, browser bugs, and all the little gotchas and puzzles that Microsoft has inserted into their browser and Javascript engine (intentionally or not) to thwart more complex cross-browser Javascript development.

      In essence the same is true with Java. You have to trust that they have managed to sort out all the quirks with the win32, mac and linux apis to effectively handle cross platform development. It's a little easier to handle these cases, as Microsoft actually provides a good debugging environment for win32.

      So I think code generation is fine as long as the target platform is sufficiently ugly to justify it and the tool authors know what they are doing.

    9. Re:Google Web Toolkit? by Eythian · · Score: 1

      That would help immensely. I have not found such an option, though. (And we've been looking for it!) How do you enable full symbols?

      It's not full symbols like you'd get from a regular stacktrace, but it does give you more meaningful names. I think it's passing '-style' to the compiler. I can't recall the options it takes, but I know one of them is 'PRETTY', which IIRC gives you reasonably formatted JS.

      My point was not that it can't be done, only that it is clunky. Invariably I have to rework my use of the widgets several times before I find a layout that I can style appropriately. This is less of an issue when you're building a desktop-replacement app, but it can be a bit figidty when you're trying to integrate GWT into an existing webpage layout.

      Yes, that is a different case. In my situation, we're building an app that is completely GWT-based, no old code to fit it in with, and the only HTML we have is in the loader index.html.

      Except they don't work. It is not feasible in many cases to configure the server not to cache the *.nocache.js.

      Ours get served up by glassfish, so I wrote a filter that gets the requests and adds appropriate caching headers to the files on the way out. It doesn't seem to be 100% perfect, but I suspect that's just because I haven't taken the time to ensure it works in all cases yet.

      Your solution is workable, but easy to break. Path issues cause enough headaches to where it has yet to be economical to switch over to GWT compiles for builds. Of course, our current situation is slightly complicated by a predecessor who configured quite a few projects without ANT. This does make converting more difficult than starting from scratch. :-)

      Again, all of our stuff is ANT driven, which makes it pretty easy. I have build scripts set up that do all the various things, like set up the paths, compile the parts of the application, build war files, upload them to the application server, etc. So our build process (staging or production) is just run the appropriate ANT script, and sit back and wait for an hour (on the fast machine).

      Not really. If you're using modular Javascript, it will be cached once and then reused after that. If I have 3 GWT components on my site, the AJAX, JSON, and GUI libraries are getting loaded three times over. If I have 3 Javascript-based components, the AJAX, JSON, and GUI libraries are loaded once, then reused by each component.

      Fair point, I probably wouldn't be too inclined to use GWT to give fancy addons to a page, unless it was really worth it. I'm coming more from the direction of a large application that happens to run in the browser.

      Speaking of JSON, I distinctly dislike the way it's handled in GWT. One of the reasons why JSON is so great is that I have a simple Javascript Object once the JSON is parsed.

      I don't see why you would do that...I mean, I'm sure there's a use-case, but I don't know what it is. Oh, I suppose if you're getting JSON from another source...perhaps there's a library out there that makes it easier? 'rocket' seems to have stuff that can do that, from a glance.

      That's not really true. The MVC model of Swing is highly customizable, and SPIs make Java APIs extremely pluggable. Even if it was true that Java code is not highly pluggable, pluggability would still be the Javascript way.

      We've just moved (as in, the day before yesterday) to GWT 1.5 for testing on our project (a surprisingly easy migration, BTW, provided you're prepared to patch .jars that are no longer being maintained), which supports annotations (and other Java 1.5 stuff). I have yet to see if they can be used in such a fashion.

      For example, let's say I've got a feature-rich component that displays records returned from the server. I originally write it to handle JSON data. Now let's say my company has a legacy XML stream they want to use the

  15. faster math for RSA by Anonymous Coward · · Score: 0

    If JS was fast enough to encrypt in RSA with a a decent key length, you could use it for secure password authorization without the need for SSL. The server sends a public key, the browser uses it to encrypt the password in an onSubmit(). That would be great. The max I was able to do was RSA-16 (or something ridculously low) on a Pentium III when I tried a few years ago. Any more than that and a "stop script?" dialog popped up. You can't use a one-time pad because you have no secure way to send it to the browser.

    1. Re:faster math for RSA by gullevek · · Score: 1

      unless someone disables javascript ... or uses a browser that cannot do it ... I'll stick with SSL

      --
      "Freiheit ist immer auch die Freiheit des Andersdenkenden" - Rosa Luxemburg, 1871 - 1919
    2. Re:faster math for RSA by AnyoneEB · · Score: 1

      Some sites already do this, although not with RSA, but with MD5 or some other cryptographic hash, of which there exist JavaScript implementations which are plenty fast. See the LiveJournal login page. There is also HTTP digest authentication, but that requires browser support and users are used to typing their user/pass into an HTTP form, not using HTTP auth.

      --
      Centralization breaks the internet.
    3. Re:faster math for RSA by Anonymous Coward · · Score: 1, Insightful

      unless someone disables SSL ... or uses a browser that cannot do it ... I'll stick with rot13

    4. Re:faster math for RSA by Anonymous Coward · · Score: 0

      Neither of those is secure against anyone observing the traffic. Right?

    5. Re:faster math for RSA by AnyoneEB · · Score: 1

      Both methods are intended to protect passwords, not sessions. Assuming MD5 is sufficiently secure - which it is believed to be for this purpose despite some attacks on it because both methods use a challenge string which is somehow concatenated with the password - someone reading the traffic would be unable to get the user's password and therefore unable to login as them.

      On the other hand, the LJ method does not prevent session hijacking by reading the traffic, copying the cookie, and using it before the user logs off or their session expires. LJ does have an optional security measure to allow access from only your own IP, but if an attacker is already reading your traffic, they are probably also on the same network as you so they could send packets as from your IP.

      Digest auth goes a bit further and authenticates on every request with the request URI as part of the hash, so an attacker could change submitted POST data or pages sent to the client in attempt to hijack the session, but could not simply steal it and browse any page. That is, the attacker has to be actively changing the communication between the client and server to even hijack a session while with LJ's auth (and in general most auth on unencrypted websites) they only need to read the cookies.

      Both methods make no attempt to hide the content of the website or information sent to the website; that's what HTTPS is for. They only make it nearly impossible to steal passwords and make it difficult to hijack another user's session.

      --
      Centralization breaks the internet.
  16. Standard JS Please by DigitalisAkujin · · Score: 0

    I don't mind Javascript 2, that's all well and good but stock Javascript needs to be standardized across the board. It's good that IE8 is finally going to be standards compliant for rendering but they all really need to sit down and figure out how to standardize JS. The irony on this one is that MS came out with some really good extra JS features back in the day so you have these features that the IE team pioneered but then it was added as a stock feature but differently. Libraries like Prototype.js and Mootools are nice but I still want a standard JS setup.

    1. Re:Standard JS Please by bunratty · · Score: 2, Informative

      You mean like a formal standard for the language? That's ECMAScript. Do you mean a standard way of interfacing with the browser? That would be DOM. Or do you mean some practical tests of scripting to ensure that different browsers behave consistently? Sounds like Acid3.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    2. Re:Standard JS Please by moosesocks · · Score: 1

      WebKit and Firefox have their own share of proprietary functions that are supposedly intended for internal/embedded use only.

      --
      -- If you try to fail and succeed, which have you done? - Uli's moose
    3. Re:Standard JS Please by Achoi77 · · Score: 1

      almost all modern browsers should be compliant to ECMA-262 (3rd ed), well, at least the wikipedia entry tells me that is so

      As long as you stick to that, you should be totally fine. this is all you'll ever need for docs. I've yet to run into any standardization issues with javascript when coding for ff/ie. If you stick to the basics there really shouldn't be anything you can't do to break on either firefox or ie.

      What are all these standardization issue people keep talking about? Can I see an working example? (this isn't sarcasm, I'm just curious what everybody is referring to - like I missed the party)

  17. Iterative vs Recursive is an implementation issue by weston · · Score: 2, Informative

    Not to be pedantic, but this isn't strictly true. It's very difficult to even write an iterative solution in, say, Prolog, and you'd probably have to abuse a database to do it, and it almost certainly wouldn't be faster. By contrast, tail-recursive calls tend to be optimized in many implementations so you hit speeds on the order of many iterative constructs in interpreted environments.

    And at the bottom of this issue is the fact that it's an implementation issue, not a language issue. There's no reason for certain recursive expressions not to be as fast as certain iterative ones.... except the compiler or interpreter doesn't output them that way.

  18. *rolls eyes* by Estanislao+Mart�nez · · Score: 1

    One of the most eye-opening sessions was the one where the presenter described Javascript as a LISP-1 language that just happens to look like C.

    Isn't that more or less what they always say when they come up with some new-fangled language?

    1. Re:*rolls eyes* by Anonymous Coward · · Score: 0

      Except Javascript isn't "new-fangled", and Javascript IS Lisp-1.

    2. Re:*rolls eyes* by Estanislao+Mart�nez · · Score: 1

      Javascript is not a Lisp. I thought this should be obvious enough, but let's point out some key differences:

      1. Javascript doesn't have native syntax for a symbol type.
      2. Javascript doesn't have native syntax for empty list, pairs, or lists built up from those.
      3. Javascript code doesn't map into the data types of the language.
      4. Javascript doesn't have macros.

      Calling a language a "Lisp" on the basis of nothing more than first-class functions is silly.

  19. ECMAScript 3.1 by MrMunkey · · Score: 2, Interesting

    Eich talked about some reasons for the 3.1 update to the language. Based on what I've heard from both Doug Crockford and Chris Wilson is that it would be a good idea to fix some of the really big issues in the current version of the language before throwing a new OO model and type system on top of it. It's best to build on a good foundation. There are also concerns about making the engine slower, but I'm waiting to see benchmarks before making my judgement. Personally I like the programming model of JavaScript as it is, but I'm a minimalist when it comes to code.

    1. Re:ECMAScript 3.1 by Anonymous Coward · · Score: 0

      The rational behind 3.1, as I understand it from the mailing lists, is not to prepare for other future versions by laying out a nice foundation but to push the new features of ecmascript 4 into library code. I appreciate simplicity in my languages and I love Javascript but that doesn't mean we need to limit the language to one specific technique of programming (lambdas, closures, etc) the way crockford does. Eich wants to fix those things but since we're here, why not also add in some gaps the language has been lacking, like something other than prototypal inheritance which every single javascript library abstracts away. It's useful at times and I've come to appreciate its extensibility, but that doesn't mean that sometimes I don't want to just create a class without all the manual fiddling.

  20. For those who don't know by Anonymous Coward · · Score: 0

    ... I think that Brendan really pays attention. I've submitted a lot of "policy" bugs (i.e. use threads, bittorrent for the win!) to Mozilla, and he's got strong, and well supported, opinions. I've a lot of respect for him, and he tirelessly puts up with a lot of munchkins (like me) submitting technologically misfit opinions.

  21. "significant [sic] whitespace" by mkcmkc · · Score: 1

    The result will be a language a lot like Python, but with code blocks wrapped in curly braces and no significant whitespace. Python's whitespace situation is arguably no different than Javascript's. That is, you need to begin each line with whitespace that shows the indentation of the block in question. If you don't, your code is crap. Python goes a little farther and requires that your code not be crappy in this way.

    Also, non-leading whitespace is not significant in Python.

    --
    "Not an actor, but he plays one on TV."
    1. Re:"significant [sic] whitespace" by Anonymous Coward · · Score: 0

      Python's whitespace situation is arguably no different than Javascript's.

      Actually, it is. In Python, you must indent a block the same; in JavaScript, you don't need to.

      I take your point: everyone indents code anyway, so the curly braces are more or less wasted effort. That doesn't mean your "[sic]" was called for or even appropriate.

      I'm a fan of Python and I actually like the block-by-indenting. The fact remains that there are large numbers of people who really, really don't like it. A language that is very much like Python but uses curly brace indenting may gain significant traction from those large numbers of people, so this was worth remarking upon.

      Python goes a little farther and requires that your code not be crappy in this way.

      That is true. It is also true that you can have a subtle error in Python, if someone edits a source file with an editor that auto-indents using tabs, and accidentally introduces a tab in the wrong place. I've been bitten by this. (There is a reason why the Python documentation says to never write code that mixes spaces and tabs.)

      And please don't say something like "the guy who did that is a moron". He's not, actually.

      As I said, overall I like the whitespace blocks. But I'm aware of its drawbacks as well as its advantages.

      Also, non-leading whitespace is not significant in Python.

      Well, thanks for pointing that out, I guess. Not that anyone had claimed otherwise.

  22. The Point: OO != Classes & imp. inheritance by weston · · Score: 5, Interesting

    Not the same as saying that he didn't want java to be OO.

    Oh, no, that's not the point at all. The point is this:

    OO != Classes

    And in fact that Classes may not be the ideal way to orient a program around objects. And the bonus point is that the person who implemented what's the arguable current king of OO languages understands this. He's not the only one. The Drupal Devs also have a thing or two to say on the subject.

    I'm very familiar with the Allen Holub article you referenced -- stumbled across it three or four years ago, and it eventually led me to buy Holub's book on patterns. The takeaway point about the hazards of implementation inheritance is one that I think he overstates, but it's absolutely necessary given the way most people learn OO programing these days. Most books and tutorials hammer on extends and necessarily use examples of class hierarchies because it's necessary to teach what all the OO syntax does, but this really isn't what OO programming is about.

    The interesting thing is that Javascript is one of the few popular languages where this is quite clear. There are weak clases, there is no "extends", and therefore very little magic implementation inheritance. You can code up syntax for this, if you like, as many of the major libraries do, which I think illustrates the power of the model and the language, but by and large, the prototype inheritance method means that you're doing interface inheritance or very explicit implementation sharing. This means the pitfalls Holub points out are easier to avoid, and there's many other bonuses. It also unfortunately means a bit extra work in some cases where implementation inheritance is handy and less dangerous, but it's not all that much, and I think the tradeoff is worth it.

    Now, the next version of Javascript will particularly be nice for developers of libraries who have reasons not to trust the developers using what they're producing, because they'll be able to freeze things they can't freeze now with the static typing and class definitions.

    But I'm pretty afraid a prevalent culture that seems to have a fairly narrowly scoped idea of object orientation and "best practices" is going to clap their hands and grab onto the familiar classes as they approach Javascript, rather than really understand the breadth of the language, and in 3-4 years, you'll have newly-minted team leads fresh from their recent readings of Fowler and GoF talking about tortured design patterns using static types and classes when a little sprinkling of dynamic language will do the job.

    Please, allay my fears by not saying "JS2 finally bring real OO programming to Javascript."

    1. Re:The Point: OO != Classes & imp. inheritance by MemoryDragon · · Score: 3, Interesting

      Actually I personally saw it always as the weak point javascript of providing class like constructs and no inheritance, instead exposing the virtual method table directly. (Prototype is nothing else) This basically ended in, colliding namespace constructs, different incompatible inheritance constructs by third party libraries etc... You cannot really design big systems without those two constructs, and javascript exactly is moving into that arena without being properly equipped for it.

      In the end javascript is the classical example of a 95% academic language. Looks nice on paper, it is very fast in designing small systems, it is very flexible which makes the academic crowd cheer but fails utterly once you have to design bigger systems because the productivity of the language goes down the toilet due to the fact that vital 5% of the language are missing.

    2. Re:The Point: OO != Classes & imp. inheritance by weston · · Score: 4, Insightful

      instead exposing the virtual method table directly. (Prototype is nothing else)

      Not precisely, since the prototype property also exposes properties, as well as methods. Or, more precisely, methods are properties in javascript, since functions are first-class.

      You cannot really design big systems without those two constructs

      Not at all true. Well, it's tautologically true. You can't design big systems the way that most programmers who currently work on big systems design them in statically-typed explicitly class-based languages. And by some accounts, this turns out to be a huge advantage, because you get a LoC compression similar to what you'd see with Ruby.

      (As for namespaces -- PHP has the same problem, but worse, given that you can't even appropriate static ad-hoc classes as a namespace mechanism. And yet the namespace problem has been more or less practically addressed by conventions, and you can't argue anymore that people aren't building large systems in it.)

      different incompatible inheritance constructs by third party libraries

      It's true composing "extends" implementation inheritance implementations across libraries is likely to get you in trouble. But then again, simply using implementation inheritance can get you in trouble, in C++, in Java. And having to settle on conventions and libraries is not a fatal hit to a project.

      In the end javascript is the classical example of a 95% academic language.

      Acadmic? Why? Because it's functional, or didn't start life with "extends"?

      Javascript's shown itself as quite practical contender in a huge amount of the heavy lifting that's gone on in the RIA space over the last 5 years, and that's not half what's going to happen as it gets traction elsewhere.

    3. Re:The Point: OO != Classes & imp. inheritance by MemoryDragon · · Score: 2, Insightful

      Actually speaking of php and big systems, I did some heavy typo 3 programming, and I saw the problems which were caused by the simple fact that there were no namespaces. Yes you could do a big system bug look at the mess the entire system (in this case typo3) was in... It took years almost a decade to get typo3 where it is now, and it is still a mess. Calling php as the classical example of namespaces are not helping in designing big systems is like a joke. In the end you even can design big systems even in hex code but that does not mean you should target them with such languages! The same goes for javascript, therefore I am happy that the newer efforts towards standardizing next versions of javascript try to tackle it. Btw. as for rails, it works because the basic structures are outlined by the codegens rails has, the programmer is basically pushed on rails :-) Which means rails enforces certain structures to bypass certain limitations of the underlying language!

    4. Re:The Point: OO != Classes & imp. inheritance by shutdown+-p+now · · Score: 1

      Oh, no, that's not the point at all. The point is this:

      OO != Classes

      While this is true, this was not the point Gosling was originally trying to make. His was that classes != extends. You can absolutely do away with implementation inheritance, retain classes, and provide some more flexible facilities for code reuse, such as mixins and/or syntactic sugar for aggregation and delegation - see Sather for an example.
    5. Re:The Point: OO != Classes & imp. inheritance by weston · · Score: 1

      While this is true, this was not the point Gosling was originally trying to make. His was that classes != extends.

      That was pretty much Holub's point, but it seems unlikely that it was Gosling's if he was even only half-serious about his statement.

      Still -- I'd be interested in reading what Gosling had to say at length. It's hard to find an real transcript of the even Holub's quoting from, and I haven't seen an explanation from Gosling in another context yet.

      . You can absolutely do away with implementation inheritance, retain classes, and provide some more flexible facilities for code reuse, such as mixins and/or syntactic sugar for aggregation and delegation - see Sather for an example.

      Or Javascript, for that matter. :)

    6. Re:The Point: OO != Classes & imp. inheritance by shutdown+-p+now · · Score: 1

      Or Javascript, for that matter. :)
      Not at all. JavaScript has neither "extends" nor classes. Sather, on the other hand, does have classes, but not "extends".
  23. call for UN by Max_W · · Score: 1
    Since Internet becomes the means of communication for the whole planet we should not leave the standards implementation to the decisions of some obscure marketeers and programmers.

    The ability to communicate via the electronic signals and display results on computerized devices is not Mozilla's or Microsoft's achievement. It is the humanity's achievement.

    The international conferences are to be held organized by UN on this subject. We should not allow browsers or other programmes in our countries which are the result of petty squabbles between small groups of marketeers and programmers.

    Buggy incompatible browsers should be banned by UN internationally as illegal drugs. Enough is enough. I do not want to see any more these ridiculous "if IE6", "if Mozzilla", etc. There should be the basic standards implemented by the international law, which would provide a safe and effective usage of Internet.

  24. P.S. by mkcmkc · · Score: 1

    P.S. It's worth noting that trailing whitespace in Javascript may be significant. In particular, under some circumstances, a trailing end-of-line will be treated as if it were a semi-colon...

    --
    "Not an actor, but he plays one on TV."
  25. Re:My $0.02 worth by famebait · · Score: 2, Insightful

    Are you sure you know the difference between the language and the proprietarty APIs the browsers expose to it?

    --
    sudo ergo sum
  26. Wrong by Anonymous Coward · · Score: 0

    On all points...

    1) Generated Javascript from the GWT compiler is on average much faster than hand written JavaScript. Unless you want to make your JavaScript source unmaintainable, compiled code is always faster.

    2) Layout is standard in GWT. Meaning, if you use one layout GWT ensures it looks the same in every browser. This is huge for productivity.

    3) Hash file names are brilliant. If you understand how HTTP caching works you'll realize this is an automatic versioning system.

    4) GWT does not compile in it's libraries each time. In fact, the compiler does excellent dead code elimination with incredible detail. It only includes the code you use. It also is able to optimize the code for size and speed throughout your app, the framework, and any other modules you use. Try doing this with other bloated javascript libraries (which the frameworks themselves are substantially larger than a GWT app). On top of all this when the browser downloads the app it only downloads code for that browser (no IE specific code if you're using FF), which further reduces size. GWT apps are small.

    I find it hard to believe that this poster did a decent evaluation because everything is very off base. It sounds like a developer who's invested time in one technology (JavaScript) and has a resistance to another, which is actually perfectly cool. Why learn new technology when you're already good in another. I think GWT is a hard sell to a JavaScript programmer because it basically says "JavaScript sucks" and that can be kinda personal. But just for the record, this guy is wrong on all counts.

    1. Re:Wrong by AKAImBatman · · Score: 1

      Generated Javascript from the GWT compiler is on average much faster than hand written JavaScript. Unless you want to make your JavaScript source unmaintainable, compiled code is always faster.

      This is incorrect for the same reason that GWT code is larger than its pure Javascript brethren. For every cycle you save in GWT's compiler, you spend two more on being constrained by Java's class model. Javascript is a LISP-style language. Heavily dependent on concepts like loose object definitions and lambda code. (These's features are one of the reasons why LISP is easily one of the fastest languages in existence.) Jumping through the Java hoops only ensures that you will have more code than necessary, have to perform more operations than necessary, and will generally waste a lot of cycles that could have been eliminated in pure Javascript.

      Meaning, if you use one layout GWT ensures it looks the same in every browser.

      If only that were true. Try loading GWT in Opera sometime and see how well it works. What's that? You wanted to target devices like smartphones and game consoles? So sorry. No can do.

      Hash file names are brilliant. If you understand how HTTP caching works you'll realize this is an automatic versioning system.

      I understand quite a bit about HTTP caching. And having to include the com.whatever.MyClass.nocache.js ensures that older versions of IE will always need their cache cleared before the new component will be available. So you'll forgive me if I'm not impressed.

      GWT does not compile in it's libraries each time. In fact, the compiler does excellent dead code elimination with incredible detail. It only includes the code you use.

      That's nice. You still have the most of the widget library, JSON library, networking library, and a few other libraries in nearly every component. They're recompiled into your code every time, ad nauseum. This creates an incredible amount of bloat that would be avoided in pure Javascript by separating libraries out into their own, reusable files. Even Google knows this.

      On top of all this when the browser downloads the app it only downloads code for that browser (no IE specific code if you're using FF), which further reduces size.

      IE-specific code should always be kept to a minimum. In my projects, that comes down to conditionally including runtime patches to IE's object model. So I guess you could say that I'm one step ahead of GWT. ;-)

      Try doing this with other bloated javascript libraries (which the frameworks themselves are substantially larger than a GWT app).

      You're assuming that most of these libraries are good examples. As it so happens, most common Javascript libs are universally bad. I generally try to avoid them like the plague as they are bad enough to make GWT look like an amazing solution.

      GWT is not an amazing solution. It's a decent solution that does a fairly good job for those unfamiliar with Javascript technology. But if you actually know Javascript well, you WILL be regularly frustrated by it.

      For the record, I need to stop replying to anonymous cowards. They never know what they're talking about. :-/

  27. Re:Iterative vs Recursive is an implementation iss by SatanicPuppy · · Score: 1

    It's not about the speed of recursion, its about the inevitable memory footprint issue. A loop, while seldom as elegant, doesn't carry the memory overhead of a recursive function which must reach its boundary condition before beginning it's calculations.

    Using a language like LISP or Scheme, you learn to love recursion for its elegance. But when you start trying to apply that love to real world problems you run into significant memory issues, along with a lot of flack from fellow programmers who don't appreciate being forced to read dense recursive code.

    --
    ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
  28. stupid fucking new comment system by jonasj · · Score: 1

    Read and/or watch from 3:20 of . Read http://www.linux.com/feature/134378 and/or watch from 3:20 of http://www.youtube.com/watch?v=zoNvsiBTQDE.
    --
    You know, Microsoft's street address also says a lot about their mentality.
  29. Re:Iterative vs Recursive is an implementation iss by Timothy+Mallon · · Score: 1

    That's a good point. I wrote some functions in Haskell to detect irregularities in large text files. I wrote with tail-recursion optimization in mind and got good space and time performance compiling with GHC, which is a *very* smart (and big and slow) compiler. That said, recursion is the natural idiom for a language built around recursively defined data types, which JavaScript isn't.

  30. Balmer by yabos · · Score: 1

    It's obviously an internal pot shot at the screaming monkey Steve Balmer.

  31. I can only suggest by Anonymous Coward · · Score: 1, Informative

    that you read up on tail recursion and the so-called Tail Call Optimization..

  32. Convention can serve as well as Mechanism... by weston · · Score: 1

    Calling php as the classical example of namespaces are not helping in designing big systems is like a joke.

    That'd be a great point if that where what I'm doing, but it's not. I'm pointing to PHP as an example of a language that's thoroughly handicapped -- there is no natural mechanism for namespaces -- but has developers and projects who've almost entirely skirted the issue by using certain conventions.

    The moral of the story isn't that PHP is Teh Awesome (it has many, many ugly warts, and even with the increased efforts at seeding a smarter development culture, many PHP devs and projects are still messes). The moral of the story is that with a good convention and initiated developers, many perceived handicaps rooted in missing mechanisms are mitigated or eliminated.

    the newer efforts towards standardizing next versions of javascript try to tackle it.

    Have these additional tools available may indeed turn out to be helpful for certain situations, but it's really a pretty good thing they haven't existed before now, otherwise, it's fairly likely there'd be even fewer people who understand the alternative philosophy, mechanisms, and convention that already exists. And if the new features dilute a culture where people understand these things, it may not be a net win.

    Btw. as for rails, it works because the basic structures are outlined by the codegens rails has, the programmer is basically pushed on rails :-) Which means rails enforces certain structures to bypass certain limitations of the underlying language!

    I don't really use Rails or Ruby a ton, but this seems wrong to me. The conventions of Rails have nothing to do with any "limitations" of Ruby. They're abstractions for dealing with certain sets of recurring problems, specifically in one type of broad modeling useful for web apps. Like any abstraction, there are real limits to the breadth of situations it's designed for, but the basic ones behind Rails are quite flexible if you understand Ruby and have more than passing familiarity with Rails. Rails is a case not of convention substituting for missing mechanisms, but convention enhancing and enhanced with mechanisms of a broadly powerful dynamic language.

    1. Re:Convention can serve as well as Mechanism... by MemoryDragon · · Score: 1

      Actually the biggest problem of enforcing conventions over language structures is, that in javascript for example, everyone rolls out his/her own solution to the problem and you end up with incompatible solutions which tackle the problem.

      The classical problem is the extension problem and inheritance problem of javascript. The prototype guys rolled their own mechanisms which then broke unwillingly several other libs which had perfectly correct code, they just did the mistake to iterate over arrays via foreach which was hitchhiked by prototype with added functions.

      The same goes for inheritance, having access to a vtbl, construct is good and flexible, rolling your own inheritance solution is not.

      In php especially in typo3 and probably other systems many designers got away with it because there was not too much advanced oo in the supporting libs, so adding namespaces, pseudo inheritance (before PHP4) etc... worked to some degree. In javascript it is entirely different namespaces, advanced OO are the norm not the exception and collisons between libraries are a day to day affair. But still the structures enforced by the lack of certain language features caused a huge mess. Try to program a plugin for typo3 and you will long for the Win32 api which is a similar mess, due to lack of decent OO in those days.

      So sometimes not enforcing structures is not a bad thing but in many ways it can become a mess which is hard to clean up afterwards. (IE try to argue with the prototype guys to give up the $ operator or the hitching of arrays and other base objects/functions provided by the language, you will get the answer that it is a correctly allowed behavior by the language designers which it is, but it breaks other perfectly correct code)

  33. Re:Iterative vs Recursive is an implementation iss by shutdown+-p+now · · Score: 1

    There is no memory overhead for tail-recursive calls - they are precisely equivalent to a loop.

  34. Microsoft already has JavaScript 2 by Anonymous Coward · · Score: 0

    I find it interesting that there's worry about whether Microsoft will implement JavaScript 2, when they've already done a large chunk of the enhancements in anticipation of the new standard. They call it JScript 8.0 and it runs on the CLR (.NET).

  35. "here for the long run" (TM) by mkcmkc · · Score: 1

    you can bitch and moan about it being "proprietary" all you want, in the end that's what protects it- Adobe keeps and defends it as proprietary, and that's how they stay in business. Sorry, Flash is here for the long run. I've been in this field long enough to realize that no company--and certainly no technology or file format--is definitely "here for the long run". We can take bets, but it's no sure thing...
    --
    "Not an actor, but he plays one on TV."
  36. Re:Iterative vs Recursive is an implementation iss by Anonymous Coward · · Score: 0

    Not to be pedantic, but this isn't strictly true.

    Shhh, this is where the "almost" part kicks in.