Profile

Cover photo
Dan Grove
Works at Google
Attended Rice University
2,440 followers|8,376 views
AboutPostsPhotosVideos

Stream

Dan Grove

Shared publicly  - 
 
A stunning report from Syria. Incredibly depressing, and totally worth your time to watch it:

http://www.pbs.org/wgbh/pages/frontline/syria-undercover/
1
Add a comment...

Dan Grove

Shared publicly  - 
 
Osvaldo Doederlein originally shared:
 
My highlights of Dart, from initial reading of the language spec.

- Very good, formal language specification since day zero. It has many open issues, the language is still in early stage. Libraries still minimal (didn't look in detail yet).

- Despite its authors (famous language researchers), Dart is not a crazy new sophisticated post-modern revolutionary language; just the opposite it's very pragmatic and familiar, both in the syntax (as I was sure it would be) and conceptually (was not that sure). There's plenty new cool stuff, but all careful additions that fit well in the familiar core and will be very easy to learn.

- Javascript/Java/C/C++/C# developers will pick it up in no time. It's based mostly on Java - a big win. New stuff starts with the expected no-brainers like string interpolation, properties, list and map literals, first-order functions, optional named arguments and default argument values.

- Simple, high-level concurrency without shared state or explicit locks ("isolates" = actor model); the way to go for any new, high-level language. But an isolate is also a unit of memory management: even static data is separate for each spawned isolate. Yeah there's statics including class members, I had bet on a purer approach. But the isolates remove the major problem. Besides concurrency, you can also use isolates for security reasons (run untrusted libraries without sharing static data). Still a compromise, the spec says "static methods are debatable... only retained because programmers are familiar".

- Class-based like I expected. Has interfaces too, like Java's, down to the syntax (another win - why would it be different? N.I.H. clearly not a factor with Dart's design). [Javascript's prototype-based nonsense is a failed experiment.] Reflection will be mirror-based (straight off NewSpeak); there's noSuchMethod() for initial MOP.

- Also like expected, Java-like exception handling but no checked exceptions. [Win one, lose one - I can hear most people saying "Checked exceptions are a failed experiment" - yeah I don't agree, I love checked exceptions, but it's a lost battle. Besides, in a mostly-dynamic/scripting lang it's even harder to justify.]

- The optional static type declarations are complemented by a choice of "production mode" (lenient - ignores type declarations) versus "checked mode" (strict - does runtime checks and throws exceptions for typing errors). But the naming is bad; I can see thousands of PHB's requiring that production apps run in "production mode", never allowing developers/admins to use checked mode in production. Static declarations are considered at compile time, but errors only produce warnings (compromise for Dart's scripting quality... but please, give me a -Werror switch). Also, the lang spec is silent about performance - normal for this kind of doc, but the description of execution modes implies that static type annotations are only useful for development (finds more errors in checked mode), I wouldn't expect that, needs clarification if type annotations may enable extra optimization in either mode.

- Available docs don't make clear if untyped declarations benefit from type inference. I guess Dart will dodge the complexity of a formally-defined type inference system, leaving that as implementation detail for the JIT. This goes well with the dynamic side of the language and keeps flexibility that eases future evolution. But it's expected that tooling will make inference that's visible to the programmer, e.g. for code completion and safe refactoring, so a unambiguous inference spec would be useful even if as a non-normative appendix.

- OO-pure typesystem like I expected. Down to the common catch that numeric types (like al types) are nullable, so initial values are null, not zero. Dart has no nullability in the typesystem, that's my biggest wart with Dart (open issue in the spec... yes, PLEASE do something about it). There are no "primitive" arrays. I guess types like a fixed-size Array<int> will be implemented as simple arrays, specialized per type, with dense layout and no boxing.

- A decent module system ("libraries"), another bet I 'won' easily, considering the language's authors. The import/include declarations use an URI to identify the target library, way cool.

- Only public/private visibility, no other options like protected. No keywords: class members are private if their name starts with '_'. and most surprising, privacy is not class-scoped, it's module-scoped; so this is more similar to Java's package-private. It's a great choice for a scripting language. The leading underscore looks ugly to my Java-addicted eyes but it screams "private" in every reference to the identifier, which is good considering the module scoping. I like it.

- I don't like the rule for abstract classes - can either have the 'abstract' keyword, or be automatically abstract if there's at least one abstract member (C++'s rule, which sucks). This is going a bit too far to make things simple/dynamic/optional.

- Operator overloading! That was a big, welcome surprise. It's a simple implementation - cannot do crazy stuff like inventing new operator names or messing with precedence, also Dart lacks C++ complications like implicit copy constructors or overloaded typecasts; so the operators are pretty sane.

- General support for immutability, with interesting traits like const constructors (which can make constness an instance-level, rather than class-level decision - and also allows the class to not promise executing the constructor or returning a unique object, so it can do some caching or interning). This plays well with the switch statement (can switch on any type), concurrency (possible to avoid cost of copying in messages between isolates), default argument values, and snapshots (suggested technique for faster startup). Value equality (==, !=) is preferred over reference equality (===, !==).

- Constructors can have an initializer list (like C++ but nicer). This is all that a const constructor can have, so it can be evaluated at compile time. There's another special form for factory constructors. Interfaces can declare constructor signatures too! The interface can declare a standard factory class, so you can actually say "new MyInterface(foo, bar)" and this calls the corresponding factory constructor of some concrete class.

- Generic types start very similar to Java, including upper bounds. No lower bounds or wildcards, and only classes/interfaces can declare generic arguments; so it's way simpler than Java. But the choice for co-variant generics (over a fully sound typesystem) will get the purist upper-half of the internet screaming at Dart. We have typedefs, but right now only for function types. "Because type parameters are in scope in their bounds, we support F-bounded quantification (if you don't know what that is, don't ask)" - OK I can take some patronizing humor in a formal spec ;-) - Only two number types: decimal ints (no size limits) and 64-bit IEEE-754 doubles. I failed to guess this one; I expected a full range of numeric types, all way from byte to decimal plus float/double. [Start countdown for Javascript advocates writing microbenchmarks that really depend on typed arrays of Int8 or Float32 to show that JS is faster than Dart.] Good compromise between simple and efficient; considering also the optional static typing, I guess the effort to unbox numbers, and narrow decimals down to more efficient 1/2/4/8-byte ints will be smaller than for Javascript.

- It's so refreshing to read the spec of a C-family language that does NOT support the octal base :) incredible how long some old cruft takes to die. But Dart keeps Java's labels and labeled break/continue; as the spec explains, this is great for tool-generated code like parsers.

- Not a hybrid-functional language, still the immutable data support helps functional idioms. But seriously guys, can we also have tail recursion optimization?
3
2
Add a comment...

Dan Grove

Shared publicly  - 
 
"geology trumps economics". reading this article, hard to believe that coal industry carries as much weight in politics as it does.

http://www.google.com/hostednews/ap/article/ALeqM5j0Og_1OUwhj_c3uBpZl-tGBfH-SQ?docId=287076de58ee48f898e4d46239af39a1
1
Add a comment...

Dan Grove

Shared publicly  - 
 
on 9/11, read about this amazing missed opportunity.

http://www.vanityfair.com/politics/features/2011/09/preventing-9-11-201109
1
Add a comment...

Dan Grove

Shared publicly  - 
 
Aboard an Alaska 737-400 on the way to SJC. First one of these planes that I've been on with wifi :)
1
Add a comment...
Have him in circles
2,440 people
andrew grove's profile photo

Dan Grove

Shared publicly  - 
 
Neat - early new Dart compiler written in Dart - http://code.google.com/p/dart/source/browse/#svn%2Fexperimental%2Ffrog .
6
Add a comment...

Dan Grove

Shared publicly  - 
 
Kasper Lund originally shared:
 
I highly recommend +Bob Nystrom's article on idiomatic Dart code. It shows a number of neat Dart features in a very accessible way.
1
Add a comment...

Dan Grove

Shared publicly  - 
 
I see that one of the top hits for Berlusconi today is in the Washington Post's "Entertainment" section. not too surprising, I suppose!
1
Add a comment...

Dan Grove

Shared publicly  - 
 
the new definition of freedom, as seen on twitter:


LIBYANA IS LIBERATED , TRIPOLI HAS GSM/3G INTERNET ! #TRIPOLI #LIBYA
21 minutes ago
1
Add a comment...

Dan Grove

Shared publicly  - 
 
only from japan. not sure how i'm living without one:
http://techcrunch.com/2010/07/19/portable-watermelon-cooler/
1
1
Brad Abrams's profile photo
 
I must have one of these! ;-)
Add a comment...
People
Have him in circles
2,440 people
andrew grove's profile photo
Education
  • Rice University
  • NCSSM
Work
Employment
  • Google
    present
  • Azul Systems
  • AltaVista
  • Napster
  • Chromatic Research
  • Sun Microsystems
Basic Information
Gender
Male