Profile

Cover photo
Johan Nystrand
Works at Google Inc
Attended Lund University
Lives in Malmö
88 followers|41,818 views
AboutPostsPhotosYouTube

Stream

Johan Nystrand

Shared publicly  - 
 
I support the January 18th Wikipedia blackout to protest SOPA and PIPA. Show your support here http://tinyurl.com/7vq4o8g
1
Add a comment...

Johan Nystrand

Shared publicly  - 
 
I support the January 18th Wikipedia blackout to protest SOPA and PIPA. Show your support here http://tinyurl.com/7vq4o8g
1
Add a comment...

Johan Nystrand

Shared publicly  - 
 
I support the January 18th Wikipedia blackout to protest SOPA and PIPA. Show your support here http://tinyurl.com/7vq4o8g
1
Add a comment...

Johan Nystrand

Shared publicly  - 
1
Add a comment...

Johan Nystrand

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 - and 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.]

- 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 errors 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 turn checked mode on 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 spec, 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 (e.g. IDEs) 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, only the List. I guess types like a fixed-size List<int> will be optimized down to simple arrays 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 makes constness an instance-level, rather than class-level decision - and also allows the language 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++). 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?
1
Johan Nystrand's profile photoPer Bolmstedt's profile photo
2 comments
 
När en rektangel på skärmen blev grå och java-loggan började snurra var man bra förväntansfull.
 ·  Translate
Add a comment...

Johan Nystrand

Shared publicly  - 
1
Martin Hellman's profile photo
 
Hurra!!! Glöm inte heller att kolla Fredagsfläsket... Det är DET som gör att det är fredag.

http://gamlaskivor.wordpress.com/
 ·  Translate
Add a comment...
Have him in circles
88 people
april champagne's profile photo
Anders Ahlin's profile photo
Martin Hellman's profile photo
Peder Bring's profile photo
Rolf Nystrand's profile photo

Johan Nystrand

Shared publicly  - 
 
I support the January 18th Wikipedia blackout to protest SOPA and PIPA. Show your support here http://tinyurl.com/7vq4o8g
1
Add a comment...

Johan Nystrand

Shared publicly  - 
 
I support the January 18th Wikipedia blackout to protest SOPA and PIPA. Show your support here http://tinyurl.com/7vq4o8g
1
Add a comment...

Johan Nystrand

Shared publicly  - 
 
Chung Wu originally shared:
 
Why do salespeople get paid so differently from everyone else indeed?

http://blog.fogcreek.com/why-do-we-pay-sales-commissions/
1
Add a comment...

Johan Nystrand

Shared publicly  - 
 
Ben Parr originally shared:
 
How to upset every single nerd on the planet. (via +Hilary Karls)
1
1
Add a comment...

Johan Nystrand

Shared publicly  - 
 
Martin Hellman originally shared:
 
God morgon!
Fredagsfläsket är levererat. Ha en fin helg.
 ·  Translate
1
Kathy Walrath's profile photo
 
Ugh, that's apparently exactly what it looks like: a mass o' pork. Here's the auto-translation for Anglophones:

Good morning!
Friday's pork is supplied. Have a nice weekend.
Add a comment...
People
Have him in circles
88 people
april champagne's profile photo
Anders Ahlin's profile photo
Martin Hellman's profile photo
Peder Bring's profile photo
Rolf Nystrand's profile photo
Education
  • Lund University
    Computer science
Basic Information
Gender
Male
Work
Employment
  • Google Inc
    present
  • Gapminder Foundation
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Malmö
Previously
Mountain View - Lund
Links
Contributor to