Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #7320
| From | Duncan Booth <duncan.booth@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Google Dart Released Today |
| Date | 2011-10-13 08:21 +0000 |
| Message-ID | <Xns9F7D5F12F3F07duncanbooth@127.0.0.1> (permalink) |
| References | <cb47d781-dc6b-4e5b-9ccb-6e1d18edcf3b@l30g2000pro.googlegroups.com> <1094da0d-f929-49ec-9875-1096cb4ff481@db5g2000vbb.googlegroups.com> <6ff9c23e-a7d9-42fe-9e86-8799eddcfd93@6g2000prh.googlegroups.com> <c1b545ef-4fa2-4e47-b555-396facc6b6c2@j20g2000vby.googlegroups.com> |
Scott Sauyet <scott.sauyet@gmail.com> wrote: > dhtml wrote: >> Michael Haufe wrote: >>> dhtml wrote: >> >>>> Dart is a new language by Google with new syntax and new operators. >>>> A language overview >>>> here:http://www.dartlang.org/articles/idiomatic-dart/ >>>> Goals:http://www.dartlang.org/docs/technical- overview/index.html#goa >>>> ls >> [ ... ] >>> I think the generated code is a minor issue in comparison. >> >> Take a look at this code and then tell me if you have a different >> opinion:https://gist.github.com/1277224 > > FWIW, I posted the results from a code-coverage tool [1] at > > http://scott.sauyet.com/Javascript/Test/2011-10-12a/? HelloDartTest. > html > > According to JSCoverage, 31% of the generated code is executed when > the script is run. > > I can't figure out whether to cry because that is so low, or because > it is so high. You should do neither. That output example posted on github was the hello world program compiled with all optimisations disabled. As such it is not suprising that it includes the complete Dart runtime library. Debug compilation adds in a lot of type checking code that isn't present at all in a production build and it also keeps all of the unused classes and methods around. > > Digging into the details, though, a lot of what is run is the function > declarations and named function expressions, rather than the actual > bodies of these functions. You can see this choosing the Summary Tab > and the "HelloDartTest.dart.app.js" link in that tab. > Yes, so if you allow the optimiser to run you lose those function declarations for the cases where Closure can tell for certain the code is never used. You still keep a fair bit of the runtime support so there's no way you could call the output lean but the optimised Javascript is only 5% as long as the one posted on github and 39 lines instead of 17297. A possibly fairer comparison is to compile with optimisation turned on and the '--human-readable-output' option which results in 2188 lines that are arguably just about readable. Perhaps those numbers will improve further before dart is actually released, but if browsers ever include native support they become irrelevant anyway. I think a lot of the code left after optimisation is the isolate worker code since even as simple an example as hello world runs in a Dart isolate. -- Duncan Booth http://kupuguy.blogspot.com
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar
Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-10 10:44 -0700
Re: Google Dart Released Today "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2011-10-10 14:24 -0700
Re: Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-10 22:36 -0700
Re: Google Dart Released Today David Mark <dmark.cinsoft@gmail.com> - 2011-10-10 23:41 -0700
Re: Google Dart Released Today "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2011-10-11 05:33 -0700
Re: Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-11 14:06 -0700
Re: Google Dart Released Today Swifty <steve.j.swift@gmail.com> - 2011-10-12 07:13 +0100
closure bindings (was: Google Dart Released Today) Andreas Bergmaier <andber93@web.de> - 2011-10-11 23:56 +0200
Re: closure bindings (was: Google Dart Released Today) David Mark <dmark.cinsoft@gmail.com> - 2011-10-11 16:20 -0700
Re: closure bindings Bwig Zomberi <zomberiMAPSONNOSPAM@gmail.invalid> - 2011-10-12 15:02 +0530
Re: closure bindings Antony Scriven <adscriven@gmail.com> - 2011-10-12 05:12 -0700
Re: closure bindings dhtml <dhtmlkitchen@gmail.com> - 2011-10-12 18:27 -0700
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-12 13:24 +0200
Re: closure bindings "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2011-10-12 08:56 -0700
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-12 21:15 +0200
Re: closure bindings "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2011-10-12 15:21 -0700
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-13 20:56 +0200
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-13 21:36 +0200
Re: closure bindings "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2011-10-13 16:41 -0700
Re: closure bindings dhtml <dhtmlkitchen@gmail.com> - 2011-10-13 22:39 -0700
Re: closure bindings "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2011-10-14 09:03 -0700
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-14 20:05 +0200
Re: closure bindings dhtml <dhtmlkitchen@gmail.com> - 2011-10-12 18:38 -0700
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-14 23:34 +0200
Re: closure bindings dhtml <dhtmlkitchen@gmail.com> - 2011-10-14 16:56 -0700
Re: closure bindings Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-10-15 02:44 +0200
Re: closure bindings dhtml <dhtmlkitchen@gmail.com> - 2011-10-14 21:18 -0700
Re: closure bindings David Mark <dmark.cinsoft@gmail.com> - 2011-10-12 18:28 -0700
Re: Google Dart Released Today Antony Scriven <adscriven@gmail.com> - 2011-10-11 15:13 -0700
Re: Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-11 22:33 -0700
Re: Google Dart Released Today Scott Sauyet <scott.sauyet@gmail.com> - 2011-10-12 07:27 -0700
Re: Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-12 18:29 -0700
Re: Google Dart Released Today Duncan Booth <duncan.booth@invalid.invalid> - 2011-10-13 08:21 +0000
Re: Google Dart Released Today Scott Sauyet <scott.sauyet@gmail.com> - 2011-10-13 04:46 -0700
Re: Google Dart Released Today unbewusst.sein@fai.invalid (Une Bévue) - 2011-10-13 14:03 +0200
Re: Google Dart Released Today Duncan Booth <duncan.booth@invalid.invalid> - 2011-10-13 12:40 +0000
Re: Google Dart Released Today unbewusst.sein@fai.invalid (Une Bévue) - 2011-10-13 17:51 +0200
Re: Google Dart Released Today Duncan Booth <duncan.booth@invalid.invalid> - 2011-10-13 13:31 +0000
Re: Google Dart Released Today Duncan Booth <duncan.booth@invalid.invalid> - 2011-10-13 15:17 +0000
Re: Google Dart Released Today Karl Tikjøb Krukow <karl.krukow@gmail.com> - 2011-10-14 13:02 +0200
Re: Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-14 12:36 -0700
Re: Google Dart Released Today Karl Tikjøb Krukow <karl.krukow@gmail.com> - 2011-10-15 19:30 +0200
Re: Google Dart Released Today David Mark <dmark.cinsoft@gmail.com> - 2011-10-10 22:23 -0700
Re: Google Dart Released Today Matt McDonald <matt@fortybelow.ca> - 2011-10-12 19:48 -0600
Re: Google Dart Released Today dhtml <dhtmlkitchen@gmail.com> - 2011-10-12 21:04 -0700
csiph-web