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."
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. =)
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...
its either javascript, flash or silverlight.
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.
almost forgot you Javafx :o
And flash pretty much depends on javascript (Well, last time I checked, actionscript was pretty much an implementation of Ecmascript).
Nerd rage is the funniest rage.
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)
Try Closure! It's open!
Sometimes, life itself is sarcasm...
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.
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?
I currently use jquery and jtemplates with json data. How do the closure template commands compare to jtemplates? I didn't really see any ajax functionality in the tutorials but I haven't had time to delve any deeper. Has anyone spent more time with this?
I'm still going to read through it, was just wondering if anyone else has more experience with closure.
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.
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).
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.
"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)"
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!
The main problem I've found is how web servers/web browsers tend to rewrite the html used in the page. Sometimes. So sometimes there will be no quotes around attributes for elements in IE6, but there will be double quotes around attributes for elements in Firefox. It drives me crazy when using specific html commands from jquery especially.
.. sigh).
But largely I've found jquery to be a lifesaver as another person said above. There are quirks, but they are fairly minor and only if you are doing really complicated stuff you probably shouldn't be doing on the client side anyway (but sometimes you have to when you are forced to use a COTS product hosted on their servers
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...
None of us would use JavaScript? Maybe one of us likes it.
Stop confusing the DOM with JavaScript. I think you'd be hard-pressed to find 100 flaws, and less than 10 core language problems (e.g., non-library), with many in both lists being subjective issues.
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:
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.
What would really be nice is an HTML/XML-like language that has features for building real desktop-like GUI's 95% declaratively in a state-ful way instead of JavaScript IF's, loops, and pathy set/gets.
Table-ized A.I.
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.
How does that contradict my previous point?
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.
If I had a choice, I would use Javascript.
ayottesoftware.com
Good grief. Homophone insanity. We've got Clojure [...] "closures" [...] And now Google jumps in with "Closure"
It's worse than that; there's also Clozure Common Lisp.
So javascript is synonymous with ass-to-mouth? I take it you mean the receiving end.
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
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
de-facto standard ATM
Some saying about when the only tool you have is a hammer comes to mind here...
Oracle has various Java-based products, for example the Oracle database installers. Since it is in their best interest that these run everywhere -- Linux-servers, Windows, Solaris, their own Unix -- I highly doubt they will hurt Java deliberately. It is more likely that they aim for interoperability. ...).
Either way, Java is fully open source
=> nothing can control it, it can only have more or less development in some direction
=> nothing *can* kill it, it can only be abandoned.
So I disagree, it is the only language that does "write once, run everywhere" correctly (also considering the defined interfaces for libraries such as audio, bluetooth, databases,
NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
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
... 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.
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
I'm hoping for http and html to "drain out". They're a lot more crufty than any browser.
I know the GP post isn't the easiest to read, but you replied to a post that boiled down to "why use web technologies when you can write native apps" with "it's either javascript, flash or silverlight" and got modded insightful? WTF?
Anyway, what's wrong with C/C++ and a cross-platform GUI lib, like, say... wxWidgets? Or if you want something at a lower level, SDL?
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
Yes, it's not Javascript that's the problem, it's the web browser. We should just take the javascript interpreter out of the browsers and use it alone to interpret Javascript programs. Let the program talk directly to the web server, database, whatever. You could even use ports other than 80! ;)
And Ruby, PHP and Perl. Check it out for yourselves: http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=v8&lang2=python&box=1
JavaFX is not open and Flash is better supported under Linux.
And I'm still not allowed to use PNG transparency at my job. :(
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
I think in the case of PNGs, the workaround for IE^'s quirks are worth it.
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.
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.
Needs more doc
Want OO in JavaScript? http://dean.edwards.name/weblog/2006/03/base/
Want error handling in JavaScript? https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Exception_Handling_Statements
on of the most elegant inheritance models I have ever seen is written with JavaScript
And killing off No Machine;'s business model while they are about it!
Do Google actually use NX in a big way? It is easy to imagine what they might do with it.
If you think Javascript isn't very powerful and cannot see its advantages, particularly with dynamic types, then you obviously haven't used it.
This is my sig.
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
Well, you forgot vbscript ;)
Rethinking email
I think that the Eclipse Application Platform looks fairly good and is highly functional too. I never like the windows look all that much. But why does it have to look the same. A lot of Apps are now design like web-pages now, Flash applications, they don't look like the any of the native UIs anyway.
Or HTML5
Which basically means "Javascript".
Save your wrists today - switch to Dvorak
err.. that's it really.
----------------------------------- My Other Sig Is Hilarious -----------------------------------
And flash pretty much depends on javascript (Well, last time I checked, actionscript was pretty much an implementation of Ecmascript).
ActionScript and JavaScript are both variations of ECMAScript, so they are similar languages, but there are some differences, especially since browsers still only support older versions of JavaScript. The most obvious one that I remember is that ActionScript defines classes in the normal Java way, and that variable types are checked at compile time. I've read that newer versions of JavaScript (1.6 or 2.0, maybe?) add support for normal class definitions.
You're looking at it from the wrong perspective. Javascript isn't there to make your life easier. It's there to provide a mechanism for you to do something while minimizing the attack surface of the browser.
They could have included a full scripting language with the browser, but they chose not to for security and efficiency reasons. Javascript vulnerabilities don't show up half as much as Flash vulnerabilities, and it's because the language is intentionally simplistic.
libraries like jquery have been solving this problem for a while.
PNG support works in Internet Explorer 6, but is limited to BOOLEAN ( indexed ) transparency. IE7 and IE8 support alpha transparency. There is a nasty filter hack for IE6 if needed, but I would never use that.
This is the Internet. You can say "fuck" here. - AC
Something from way back at the first post in this thread just came to mind:
People continue to use JavaScript to do things it was never meant to do and then wonder why it's so much slower than desktop applications.
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
oh yeah lol, I see your point.
i should be modded down ...
what about QT? .
---
Javascript Programming Feed @ Feed Distiller
Well, I tried my hand at dynamic menus back in 2002 when I was new to HTML and JavaScript, and it just turned out to be a royal messy pain in the ass compared to what I was used to (C++ and Delphi), so I mostly avoided trying anything fancy inside a browser since then and I'm a bit out of the loop.
My eyes have been opened though after seeing these libraries and watching a presentation by Douglas Crockford earlier today, so I'm actually quite looking forward to foraying into JavaScript again, as long as I only use "the good parts" and don't get too pissed off at any issues that still remain with the DOMs we have to work with :)
which is totally what she said
JS has try/catch blocks. JS has OO syntax if you want it (debatable issue anyway). Debugging JS is easy using Firebug or Visual Studio.
I'm not going to win you over by arguing, but some of us do like it, probably for some of the reasons you hate it.
It would be really nice to know how Google Closure compares to GWT at a technical level. Of course, it's pretty clear to see how they differ at a high level: GWT is written in Java and compiled to JavaScript, and Closure seems to be an all JavaScript system with UI libraries and templating features. I'd just love to know more about their comparative analysis of their internals and targeted usage scenarios.
"all standardize on one OS though"
Now I realize that all is a broad term and that this is /. But wasn't this done in the 90's by a Mr. Bill Gates?
Oh and it's Standardize with a z.
Common Sense
No, and no. We spell it with an s where I come from. Little place called the UK. Quit being so racist, you big racist.
Oh and just in case you didn't get it (which I'm guessing you didn't if you think there is a standard way of spelling standardise), that was a joke about being a racist.
which is totally what she said
I'd like to have real OO syntax
If you want "real" classes you can use a JavaScript implementation that supports the proposed standard. Or choose a library - they do make prototyping look and smell like OO. Sure there are quirks, but all languages have their own quirks. Or are you complaining about current browser implementations?
and proper error handling.
Not sure of your gripe. Never had a problem.
Debugging JS [snip] is a nightmare.
The Microsoft Studio JavaScript debugger works fantastically well. I prefer not to use MS tools, but I use the best tool available to me. Other in-browser JS debuggers have their advantages.
maintaining a large JS codebase is a nightmare.
What's your problem? JavaScript wasn't designed to be an "enterprise" language and mostly does not have enterprise tools. However, it is not much more difficult to manage than most other dynamic languages. Pick the right tool for the job.
I'm not confusing anything with anything.
Definitely sounds like you *are* confusing the language JavaScript, with the implementations you know.
Happy moony
"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."
Yeah, well, I even saw a Java development environment that was fully dependent on IE6 and ActiveX. You only need a single PHB that is wowed by the web graphics and all your developers are f*cked for years (I'm wondering which software they use now, although people investing in that should go bust). But that does not mean other software hasn't moved on.
Not even with the workarounds? Wow, that sucks.
BTW, if you can use the workarounds but don't want to deal with setting it all up, I've written two documents that may be of use.
--- Mr. DOS
I've always loved the fact that there is more than one accepted spelling of standardise.
Ahh - My eye!
The doctor said I'm not supposed to get Slashdot in it!
It's still more work that gui dev because you have to marshal state between the server and the app, but it's gotten a lot better.
Hadn't seen that article before. Brilliant, thanks!!