Slashdot Mirror


Google Releases Open Source JavaScript Tools

Dan Jones writes "Google has open sourced several of its key JavaScript application development tools, hoping that they will prove useful for external programmers to build faster Web applications. According to Google, by enabling and allowing developers to use the same tools that Google uses, they can not only build rich applications but also make the Web really fast. The Closure JavaScript compiler and library are used as the standard Javascript library for pretty much any large, public Web application that Google is serving today, including some of its most popular Web applications, including Gmail, Google Docs and Google Maps. Google has also released Closure Templates which are designed to automate the dynamic creation of HTML. The announcement comes a few months after Google released and open sourced the NX server."

42 of 158 comments (clear)

  1. Nice... by socceroos · · Score: 2, Insightful

    These could come in handy. Google has had a fair bit of experience making Javascript apps that run acceptably. I've got a project coming up, and I'll bookmark this for consideration.

    Thanks Google. =)

    1. Re:Nice... by tixxit · · Score: 2, Insightful

      I am pretty sure that the Closure Compiler is meant to be used with code written for, and in the style of, the Closure Library.

  2. Closure/Clojure/closures by John+Whitley · · Score: 4, Insightful

    Good grief. Homophone insanity. We've got Clojure doing interesting things in the language and concurrency space. Block support in C/Objective-C reinjecting "closures" into everyone's vocabulary. And now Google jumps in with "Closure" just to make sure that no one has any idea what anyone else is talking about...

    1. Re:Closure/Clojure/closures by Anonymous Coward · · Score: 5, Funny

      Sounds like a real clojure-fuck.

    2. Re:Closure/Clojure/closures by rjstanford · · Score: 2, Funny

      First google steals "chrome" from mozilla

      Yeah, because nobody before Mozilla used the word "chrome" to describe user interface elements...

      Before you know it, auto manufacturers will be using it to describe shiny yet non-functional external parts of their vehicles that aren't even tied to the powertrain! Those bastards!

      --
      You're special forces then? That's great! I just love your olympics!
  3. Re:My gawd by prozaker · · Score: 5, Insightful

    its either javascript, flash or silverlight.

  4. Unimpressive by BitHive · · Score: 4, Interesting

    Half the demos don't work and these widgets are hideous even by Google standards. I'm gonna stick with ExtJs for the forseeable future.

    1. Re:Unimpressive by lhoguin · · Score: 2, Interesting

      Looking at the library's source code, I don't find many new things that I can't already find in another library. I'm sure there's interesting components, but this looks more like another case of NIH than anything. If their code really is faster I'd rather have them work on existing libraries and try to speed things up for everyone rather than creating more of the same thing.

      Of course, if everyone uses Google's tools and libraries, it makes things easier for them to optimize Chrome, which is probably the whole point.

    2. Re:Unimpressive by amicusNYCL · · Score: 3, Informative
      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    3. Re:Unimpressive by jhfry · · Score: 2, Insightful

      Of course, if everyone uses Google's tools and libraries, it makes things easier for them to optimize Chrome, which is probably the whole point.

      Uhh... no.

      I would imagine that Google had been developing these libraries for years prior to even thinking about building a browser. This also explains why they have their own libraries rather than using "existing" libraries... their libraries are "existing" libraries. In fact, I would wager that their libraries were more complete than many of the competing libraries were a few years ago.

      I am guessing that if you were to compare Google's libraries to many of the "existing" libraries you wish they would contribute to, you might find that they are very similar in capability and likely equal or faster. Why should Google pay its folks to work on another library when they paid to build this one and their folks are familiar with it and use it every day in all of their web products.

      I would say, more than anything, this release is a way of Google saying that their libraries are not so much better than competing libraries so they gain no advantage by keeping them closed. If their release results in wider adoption of Google's libraries, perhaps the additional eyes will result in some improvements, if not they haven't lost anything.

      --
      Sometimes the best solution is to stop wasting time looking for an easy solution.
  5. Embracing and extending by gmuslera · · Score: 3, Insightful

    I know that it probably work in current major browsers without problems, but somewhat look a bit like a push towards Chrome. If things start to base more and more in javascript, specially complex one, not only the old browsers will die (ok, killing IE6 for good is an obligation for the future of mankind, or at least internet), but also current/competitive browsers not so fast at the javascript arena will get a big hit too. Good enough will stop being enough when most internet need complex javascript and a blazing fast javascript engine to work. But i suppose that is better that it be based on open standards from the start than the adoble flash way.

    I suppose that complaining about this sounds like asking to forget civilization and go back to rural communities and simpler old way of life, but sometimes you miss the good old web as it used to be (yes, even the slashdot comment editor from 1997)

    1. Re:Embracing and extending by maxume · · Score: 2, Informative

      You can turn on the old comment system (well, the pre-javascript one, I don't remember if it is the same as what there was in 1997).

      --
      Nerd rage is the funniest rage.
    2. Re:Embracing and extending by Rylz · · Score: 4, Interesting

      look a bit like a push towards Chrome.

      Funny, I've also heard this argument the other way around. A lot of people seem to think that Chrome is actually meant simply to push every browser developer to build faster JavaScript support and to catalyze other technologies that will allow Google to develop better web applications. Maybe this release is also a push towards those goals.

      --
      Sometimes you've gotta roll the hard six.
    3. Re:Embracing and extending by amicusNYCL · · Score: 2, Interesting

      If things start to base more and more in javascript, specially complex one, not only the old browsers will die (ok, killing IE6 for good is an obligation for the future of mankind, or at least internet), but also current/competitive browsers not so fast at the javascript arena will get a big hit too. Good enough will stop being enough when most internet need complex javascript and a blazing fast javascript engine to work.

      It's not really that bad. I've been developing a pretty massive application based on ExtJS that runs surprisingly fast in IE6. In Chrome or Firefox it runs very fast. I'm talking about 450KB minified Javascript files here, doing things like laying out data in sortable filtering grids, tree structures, drag and drop, etc. I'm surprised at how well IE manages to use it.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    4. Re:Embracing and extending by nurb432 · · Score: 4, Insightful

      It also kills off older hardware that was perfectly fine for rendering server side processing, but will choke with this move back to client side ( which personally, i think is the wrong direction, but that is a different discussion )

      --
      ---- Booth was a patriot ----
    5. Re:Embracing and extending by the_womble · · Score: 2, Funny

      That makes a lot more sense. Google does not make money from Chrome. It does make money, and plans to make more, from web apps that benefit from fast javascript.

      Incidentally, is MS improve Javscript performance? I know Mozilla are.

  6. invented by Norville Barnes: by Joe+Snipe · · Score: 4, Funny

    Try Closure! It's open!

    --
    Sometimes, life itself is sarcasm...
  7. Re:My gawd by Dhalka226 · · Score: 2, Insightful

    Personally I find your post to be completely trollish, but let's go ahead and assume everything you've said is correct.

    So what?

    I don't personally find web-based tools better than ones I install on my own system. Let's go ahead and assume that nobody does and nobody ever will. Why is it wrong or in any way bad that web sites want to push as close as they can to that functionality, either as a replacement for it or simply to enhance their own users' experience? If it becomes the problem you're oh-so-afraid of, it means that people actually like what's going on. I know that's nasty to some geeks who think they know best and anybody who doesn't agree are worthless peasants treading on their turf, but to more reasonable people it's a good thing.

    Yes, people will make bad decisions in when, where and how they use JavaScript tools. That's true of any tool. It doesn't devalue it.

  8. Re:My gawd by CannonballHead · · Score: 2, Insightful

    Why are people investing so much in a fundamentally flawed scripting language that has almost no use at all outside the browser

    Got any other [well supported] options?

  9. Re:My gawd by Post-O-Matron · · Score: 4, Insightful

    Let me guess: you're a non-web developer? A.K.A a "real" developer.

    Well, in the current web world saying "why use Javascript??" is about a smart question as asking "Why use C??" or "Why use Java??" in the desktop world.

    It may have 10,000 flaws in it, but that's the de-facto standard ATM.

    Furthermore, unlike the desktop realm were you install your dependencies with an installer, in the web you have to wait 5 years for the crap old technologies to drain out after the new better one comes out.

    None of us would use Javascript if we had a choice, but we don't. So toolkits like JQuery or this release by Google are life savers.

  10. Re:My gawd by asdf7890 · · Score: 4, Informative

    Why are people investing so much in a fundamentally flawed scripting language that has almost no use at all outside the browser and that Palm Pre thing that is basically a browser in a plastic case?

    Actually JavaScript is a rather good language in many ways, though it does have some flaws. Give "JavaScript, the Good Parts" a quick read some time.

    The main problem in the place where people usually see the language, in the browser, is when interacting with the Document Object Model in browsers - a model that isn't exactly my favourite environment to start with and that is before considering all the hacking you have to do to get things to work well on multiple browsers (even when only considering modern versions).

  11. You can build applications using javascript by pizzach · · Score: 2, Interesting

    It's not that rare. Many cellphones are going this route nowadays as well as the Mac OS X dashboard widgets and Mac OS X apps. Then of course, there are the gtk javascript bindings.

    Javascript is finding itself in more and more places nowadays.

    --
    Once you start despising the jerks, you become one.
  12. "The" NX server? I don't think so. by Lemming+Mark · · Score: 4, Insightful

    "The announcement comes a few months after Google released and open sourced the NX server."

    That's a bit confused... it may just be a typo but it's resulted in a misleading statement. Google released *their* NX server as open source. Previously the FreeNX project had independently created an open source NX server, using libraries provided by NoMachine (inventor of the NX protocol) who provide all of the clever compression stuff from their server as open source libraries.

    The summary makes it sound like Google were solely responsible for the existence of an open source NX server, whereas actually I'd say they're "standing on the shoulders of giants (NoMachine), next to some other dude who was already up there (FreeNX)"

  13. Apache v2.0 by RiotingPacifist · · Score: 5, Informative

    It seams silly to mention that it's open source without giving the license. Btw It's not copyleft, allows linking from other licenses and is GPLv3 compatible

    --
    IranAir Flight 655 never forget!
  14. Re:My gawd by RichardJenkins · · Score: 5, Funny

    in the web you have to wait 5 years for the crap old technologies to drain out after the new better one comes out.

    Pah! Optimists...

  15. Re:jtemplates vs. closure templates? by Azureflare · · Score: 2, Informative

    Okay wow, spent some time looking over the API reference.. This thing seems awesome! I love the UI components they've opened up. Those could be pretty useful. Too bad it might mean having to rewrite all my jquery code to closure, but maybe that's not such a bad thing. There's a lot of things in there that would be very nice to use. I'm probably going to try creating some simple projects before adopting it though.

    You know what'd be great? If there were more tutorials that show off a lot of the functionality you can achieve with closure. Hello world and notepad editors just don't cut it as demos. (Hint hint google :)

  16. Re:jtemplates vs. closure templates? by Azureflare · · Score: 2, Informative

    Addendum: I realize their various apps use this as their language but when I say "demo" I mean demo with source code (e.g. tutorial :)

    P.S. WTB edit feature on slashdot.

  17. Lego-like by Art3x · · Score: 5, Informative

    The Closure Library has a lot of useful-looking classes and functions, like for working with Arrays, Dates, or the URL. They're divided into short files, so that you can use just the parts you want and not have to download one big file.

    jQuery has definitely been a great library, especially at finding things in the DOM. And I think its API for handling events is easier (definitely less to type) than this. But it doesn't have all of the things that this has --- short helpers that probably I would end up writing on my own (and already have started to).

    I'm also interested in the UI Widgets like an Autocomplete text field. I've been waiting for the jQuery UI team to finish that one widget for months, but for some reason their development is so slow!

    Standard Disclaimer about JavaScript:

    1. 1. JavaScript is a nice language.
    2. 2. Writing JavaScript to work in Internet Explorer, Firefox, Safari, and Opera is a nightmare like no other.
    3. 3. Mainly it boils down to writing JavaScript to work in (A) Internet Explorer and in (B) browsers that are not Internet Explorer.
    4. 4. The "core" JavaScript is really nice: dynamic typing, super-short syntax for hash tables, arrays, regular expressions; dot-chaining of members and methods.
    5. 5. The browser API, or "DOM", part of JavaScript is different in IE than in the rest, and this, I think, is the main reason it's a pain. But jQuery and other libraries smooth this over.

    Like has been said, watch the Google Video "JavaScript: the Good Parts" to elaborate on this. And if you hate JavaScript but are forced to write it and haven't read JavaScript: The Definitive Guide, it's the best book on JavaScript and one of the best O'Reilly books period.

    1. Re:Lego-like by lhoguin · · Score: 2, Informative

      I'm also interested in the UI Widgets like an Autocomplete text field. I've been waiting for the jQuery UI team to finish that one widget for months, but for some reason their development is so slow!

      I've been using the original autocomplete plugin for a long time now, it works great. This is the plugin that is used as a basis for the UI autocomplete component. Anything preventing you from using it in the meanwhile?

  18. Re:My gawd by Post-O-Matron · · Score: 2, Insightful

    I'm not confusing anything with anything. I'd like to have real OO syntax and proper error handling. Debugging JS or maintaining a large JS codebase is a nightmare.

    Sure it's awesome for small things here and there, but the problem is exactly the fact that it's usage has grown way beyond that.

  19. Re:My gawd by buchner.johannes · · Score: 2, Interesting

    It's a sad thing that mono is currently better supported on GNOME than Java. Where are the Java desktop programs?

    Anyone unhappy with Flash and Silverlight should really push JavaFX and make his/her desktop Java-ready. Let's kill Silverlight and Flash with Javascript and JavaFX, the open languages.

    --
    NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
  20. Re:My gawd by Nefarious+Wheel · · Score: 3, Interesting

    Let's kill Silverlight and Flash with Javascript and JavaFX, the open languages.

    Sad face here, I wonder just how open Java will remain. Consider: Java was defined by the Sun Java Test Suite, wasn't it? And now Oracle owns Sun. Oracle has long been known to me as a very agressive closed, proprietary company living off their software licenses.

    Should the Open Source community still be backing Java, now that the rather benign hand of Sun is no longer controlling it? Is it time to rally around something else now? Some language where you aren't in danger of being sued for infringement if you copy a test suite?

    I am worried about Oracle pulling the strings, at some point they may think it in their best interests to act in such a way as to drive the language to more proprietary platforms. It's within their scope to do so, and it may be in their best interests to try. What was once the language choice for clear sailing is now in treacherous waters I think. Write once, run everywhere - for a given value of "everywhere".

    --
    Do not mock my vision of impractical footwear
  21. Re:My gawd by markkezner · · Score: 4, Informative

    I'd like to have real OO syntax

    What is it about JS's OO syntax that isn't "real"?

    Is it because it's prototype-based instead of the class-based paradigm that you're probably used to? There are actually some advantages (and disadvantages) to this approach. Just because it may not be what you're used to or comfortable with doesn't make it bad.

    --
    Dangerous, sexy, turing complete: Femme Bots
  22. Re:My gawd by Mr.+DOS · · Score: 5, Insightful

    Why is this modded funny? Apparently someone's forgotten that IE6 was released in August 2001; it's taken just over eight years for its market share to be superseded by another browser, and it's still firmly entrenched in some corporate environments.

          --- Mr. DOS

  23. wait... by smash · · Score: 2, Funny

    ... is google evil this week, or not?

    --
    I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
  24. Re:My gawd by VGPowerlord · · Score: 3, Insightful

    To extend the analogy someone else used earlier, OO in Javascript is like attempting to tighten a screw with a hammer.

    --
    GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  25. It's also faster than Python by melted · · Score: 2, Informative
    1. Re:It's also faster than Python by Dragonslicer · · Score: 4, Insightful

      It's also faster than Python And Ruby, PHP and Perl.

      Languages can't be faster or slower than other languages, since a language is just a syntax specification. Compilers, interpreters, and other runtime environments are what you would compare for speed. In the case of JavaScript, you have several competing implementations (at least 4 or 5 that are well known, plus many others that aren't well known), and speed is probably the only significant selling point in any of them. With the rest of the languages you list, there's really only one commonly used implementation of each, and it's written by the same group that's responsible for the language specification, so there tends to be less focus on speed of the interpreter and more focus on adding new features to the language itself.

  26. How does this integrate with GWT by Chrisq · · Score: 2, Interesting

    GWT is a great Java to Javascript environment, but falls down in that to produce new components (ouside the toolbox provided) is difficult and requires raw javascript. Does anyone know if these products integrate or work together, because what would be really nice would be to be able to use closure to produce GWT components

  27. Re:My gawd by kripkenstein · · Score: 4, Interesting

    None of us would use Javascript if we had a choice, but we don't. So toolkits like JQuery or this release by Google are life savers.

    JavaScript the language is actually very nice - the main problems with 'JavaScript' are browser inconsistencies, the DOM, etc. etc.

    But if you take JavaScript itself, then yeah it has some problems - it was rushed - but it has good parts: It's a dynamic language, supports closures, first-class functions, convenient object definition syntax (from where we get JSON), etc. Due to its ubiquity, it also has the most secure and fast engines of any dynamic language (except for LuaJIT, but a comparison there is a topic all in itself).

    Because of those, JavaScript is being used more and more as a scripting language outside of web browsers, for example in desktop environments, game engines, etc. If you stick to good coding practices in JavaScript, you can write large and robust applications in it.

    But, again, to return to the original point, the current state of JavaScript in browsers is very messy. Which is why we need things like jQuery, and maybe this new library from Google as well.

  28. Re:My gawd by kripkenstein · · Score: 4, Informative

    To extend the analogy someone else used earlier, OO in Javascript is like attempting to tighten a screw with a hammer.

    I respectfully disagree.

    See for example John Resig's approach. Basically it adds more familiar class-based inheritance to JavaScript, building upon the existing prototype-based inheritance. I am using it in a large project (see my homepage link), and it works great. Btw, it seems Google has something similar in the Closure Library, as well, but I didn't check if it was as concise as Resig's.

    JavaScript is a flexible language (Crockford once called it "Lisp in C's clothing"), which lets you 'extend' it in ways like the one linked to above.

  29. Re:My gawd by somersault · · Score: 2, Insightful

    I used to hate the idea of web apps, then I started to see them as an important tool for helping people transition away from Windows. Unless we all standardise on one OS though, which probably will never happen, then web based or otherwise interpreted apps will continue to be very useful, so I've just kind of accepted it.

    I can't wait to use some of this stuff in some of my projects here at work. I first tried to get into dynamic web pages when the whole lack of standards between IE and Netscape was making dynamic HTML stuff a complete mess. It mostly put me off from trying anything too fancy interface-wise again, beyond a few show/hide buttons, and a CSS based menu system that I use. It doesn't make much sense for everyone to have to write their own code to emulate standard interface elements, so it's great to see such a high quality library made available for everyone :)

    --
    which is totally what she said