Seth Ladd

blog.sethladd.com · Personal blog · on HN since 2011

Seth Ladd, a Google developer advocate, writes about the Dart language, its JavaScript compilation, and HTML5 games.

What HN saysHN links it to explain tree shaking, Dart's progress toward 1.0, and Dart-to-JS code size reduction.
18HN people shared it
9linked it in comments
12stories submitted
115story points
11 years agolast shared
2011people per year2026

Most-shared posts

  1. 1
    Minification is not enough, you need tree shaking
    5 people · 2 points · first shared 2013 · discussion on HN
  2. 2
    I shrunk my dart to js code by 11x and
    2 people · first shared 2013
  3. 3
    I ported a JavaScript app to Dart
    1 people · 76 points · first shared 2014 · 80 comments on HN
  4. 4
    Why Dart Excites Me
    1 people · 9 points · first shared 2011 · 7 comments on HN
  5. 5
    Dart myths debunked
    1 people · 8 points · first shared 2012 · discussion on HN
  6. 6
    Dart's Sweet Spot is Web Apps
    1 people · 5 points · first shared 2011 · discussion on HN
  7. 7
    What Dart wants
    1 people · 4 points · first shared 2012 · 1 comments on HN
  8. 8
    14 HTML5 Game Developers to Follow
    1 people · 3 points · first shared 2011 · discussion on HN
  9. 9
  10. 10
    How to use Dart with Sencha Touch
    1 people · 2 points · first shared 2013 · discussion on HN
  11. 11
  12. 12
  13. 13
  14. 14
    Booleans in dart
    1 people · first shared 2014
  15. 15
    Learning functions for dart
    1 people · first shared 2012

What HN people wrote when they linked it

mwcampbell · 2016-02-11
A large number of dependencies is only a problem in environments that aren't amenable to per-function static linking or tree-shaking. These include dynamically typed languages like Python, Ruby, and JavaScript (except when using the Google Closure Compiler in advanced mode), but also platforms like the JVM and .NET when reflection is allowed. Where static linking or tree-shaking is feasible, the run-time impact of bringing in a large library but only using a small part of it is no more than the impact of rewriting the small part you actually use. Edit: Dart is an interesting case. It has dynamic typing, but it's static enough that tree-shaking is feasible. Seth Ladd's blog post about why tree-shaking is necessary [1] makes the same point that I'm making here. [1]: http://blog.sethladd.com/2013/01/minification-is-not-enough-you-need.h…
i_s · 2015-01-20
It is more advanced than Box2D [0]? What makes you say that? http://blog.sethladd.com/2011/09/box2d-javascript-example-walkthrough.…
gioele · 2014-06-11
For those like me that do not know the term "tree shaking", it is «a technique to "shake" off unused code» [1]. I suppose it is dead code removal done at link time. But what is "link time" in JavaScript? [1] http://blog.sethladd.com/2013/01/minification-is-not-enough-you-need.h…
melling · 2013-04-02
I think the language is done. After listening to this FLOSS episode, I think they're just finishing off the libraries. http://blog.sethladd.com/2013/03/dart-on-floss-weekly-from-twit-networ… Sounds like 1.0 might be a Google I/O announcement.
mraleph · 2012-01-26
Dart _has_ first class functions: http://blog.sethladd.com/2011/12/learning-functions-for-dart.html What Gilad describes is a way to make an instance of a class to behave like a function.
dragonwriter · 2014-08-20
Reading your quote from the ECMA standard, "no implicit conversions are supported" may be wrong but at the same time not generally misleading. That is, that function errors on null values and returns false for anything that isn't identical to true, so while it does provide a conversion to boolean from any non-null value, anything that isn't exactly a boolean "true" (unless I misunderstand what "identical" does) is going to return false on conversion. This is consistent with other writings on booleans in Dart [1]. So it appears that Dart has implicit boolean conversions, but it converts everything that is not the single "true" value to false, so using an expression that never can evaluate exactly to boolean true in a conditional (unless you mean it to be a wordy way to create unreachable code) is never something you want to do. [1] http://blog.sethladd.com/2012/02/booleans-in-dart.html "The only value that is true is the boolean value true. [...] In a boolean context, everything that is not true is converted to false."
jrockway · 2013-07-10
Dart is already very useful, so I disagree with that assertion. It's the Dart compiler that handles type-checking, not the runtime. If you write "String foo = 42; return foo + 8;" and compile without type checking, you generate code that will work fine. But if you turn on type-checking, you get the type error at compile-time. Furthermore, the compiler is responsible for resolving the dependencies your main program uses ("tree shaking" to remove stuff you don't actually use [1]), so there has to be a compiler even if your browser had a Dart VM built in. [1] http://blog.sethladd.com/2013/01/minification-is-not-enough-you-need.h… I use Dart because it allows me to organize and test my code in a way that is very inconvenient with Javascript. Any speed improvements or IDE support is incidental, I have not yet had any speed problems in Javascript and I don't use their IDE :) The type-checking, library system, and the language itself is wonderful, though.
michaelwww · 2013-03-22
You don't say if you used the 'dart2js --minify' setting, but Closure Compiler should do well. The --minify flag leaves alot more room for additional minification. You say you used two modules. The result really depends on the modules. For example, the Dart/JS interop module adds about 140K un-minified. Tree shaking is always on, so the 140K is after stripping unused code. I initially jumped into Dart because I was interested in doing packaged apps that run locally, so the size over the wire didn't concern me as much. I recently converted an ActionScript app to Dart and the post-minify Dart was around the same size as the compiled .swf file (for comparison, same functionality) Seth Ladd has a couple of posts about Tree Shaking and Minification if you're interested http://blog.sethladd.com/2013/01/minification-is-not-enough-you-need.h… http://blog.sethladd.com/2013/03/i-shrunk-my-dart-to-js-code-by-11x-an…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close