Hi Nick,
There are a certain class of applications that modify their code at
runtime - is the intention that these use the restful Closure
JavaScript compiler API?
One of the downsides to GWT is the need for
compilation (there's no compiler on GAE) - also making this a
*requirement* of a straight javascript solution takes away the
'dynamic' part of a 'dynamic language', and turns it into, well, just
a language.
The Closure JavaScript library does allow us to run
without compilation, so we can use it dynamically, but as the original
poster noted, it takes up some pretty serious space - it would be
great to see google host this on a CDN to support this alongside the
compiled scenario. Thanks,
colin
On Nov 7, 10:03 pm, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:
> Hi Adrian,
>
> Are you referring to the recently-released Closure JavaScript library? The
> intention is that you use it with Closure Compiler, producing a single
> script you can include with your app, so there's no need to include the
> entire thing.
>
> -Nick Johnson
>
> On Fri, Nov 6, 2009 at 6:18 PM, acuth <adrian.cuthb...@gmail.com> wrote:
>
> > The Closure library download is 149MB and 2,933 files. I don't really
> > want to have that as a static dir in GAE. Does Google host it anywhere
> > so it can be referenced from a GAE app?
>
> --
> Nick Johnson, Developer Programs Engineer, App Engine
> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> 368047
Surely you talking about the closure *compiler*, not the closure *library* here
Admittedly my java is rusty, so dont know if you can use the provided
jar directly from (java!) appengine code. But downloadable as a 4mb
jar file so I would think that can be used on appengine.
I don't know enough about the library to know if having it accessible
in a common location (like Django in python?), would actually be a
benefit.
A user changes a piece of javascript, or adds a piece of javascript -
> What sort of runtime modification are you talking about?
for the sake of the example lets assume the javascript is stored in
the GAE datastore. Something that you get from javascript, and
precisely because it doesn't require compilation, is the ability to
press refresh on your browser and see the changes take effect.
The
only opportunity to compile here appears to be via the rest api - do
you know if this api is suitable for GAE (e.g. execution timeouts
could be a problem via URL Fetch?).
Lets look at a widely available definition of a dynamic language
> Not at all - all the dynamic features of Javascript are available to you,
> whether you use the Closure library compiled or not.
http://en.wikipedia.org/wiki/Dynamic_programming_language
'...that execute at runtime many common behaviors that other languages
might perform during compilation,...'
The first feature listed there is 'Extension of the program'. Lets
assume my extension requires a google closure api that has not been
compiled in. If I'm not hosting the closure library on GAE, and it's
not on a CDN, then I need some other hosting solution, or I need to
recompile everything.
Clearly requiring a compilation phase does not retain all of the
dynamic language features of javascript. From one perspective,
linking is performed by the closure compiler when traditionally it was
performed by the browser at runtime. Of course compilation offers
performance improvements, but in return you suffer a loss of dynamic
language flexibility - its a well understood trade-off. With
Closure, google is offering a solution that supports both static and
dynamic linking, but without the CDN, the latter option has (even
greater) performance problems.
Unless you're suggesting that there is no valid use case for retaining
dynamic linking (in production or otherwise), then there is a clear
benefit to a fast, reliable and free host for the google Closure
Library. I would argue that there are some valid, and highly valuable
use cases that *require* dynamic linking, at runtime, in production.