Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dart: Preview

Ladislav Thon
December 13, 2011
69

Dart: Preview

Ladislav Thon

December 13, 2011
Tweet

Transcript

  1. <ladicek@gmail.com> Dart: Preview

  2. • Javascript has fundamental flaws that cannot be fixed merely

    by evolving the language. • Dash is designed with three perspectives in mind: ◦ Performance, Developer Usability, Ability to be Tooled • Dash is also designed to be securable • Dash will be designed so that a large subset of it can be compiled to target legacy Javascript platforms https://gist.github.com/1208618
  3. • familiar ◦ both to Java and JavaScript developers ◦

    conservative and progressive • serious ◦ more than 70 committers (from Google)! ◦ Gilad Bracha, Josh Bloch, Lars Bak, Peter Ahé • open Dart is
  4. • ready • widely accepted • statically typed • JavaScript

    killer Dart is not
  5. main() { print("Hello, Dart!"); } Demo

  6. • functions ◦ Lisp for human beings • event loop

    ◦ async programming ◦ GUI • extensibility, expressive power JavaScript: The Good Parts
  7. • mandatory semicolons • main function as an entry point

    Dart does have
  8. • optional types • arbitrary precision int (+ usual double)

    • constants • named constructors and factories • named and optional parameters • properties (getters and setters), operators • interpolated strings • higher order functions, lexical closures • parameterized classes (reified) • event loop • isolates (actors) and message passing Dart does have
  9. • specification • own VM (without bytecode) ◦ API for

    embedding • compiler to JavaScript written in Java • compiler to JavaScript written in Dart • IDE based on Eclipse Dart does have
  10. • a lot of syntactic sugar Dart doesn't have (yet)

  11. • sound type system • variadic functions • public/protected/private •

    enums • method overloading • threads and shared memory • LINQ • generators, list comprehension • pattern matching • extension methods, traits, mixins, multiple inheritance Dart doesn't have (yet)
  12. • production-ready implementation • a lot of existing libraries •

    package system ◦ I'm on it! Dart doesn't have (yet)
  13. #import('matchers.dart'); main() { expectThat("abc", beginsWith("ab")); } Demo

  14. #import('dart:html'); var doc = document; main() { doc.query("#header").innerHTML = ...;

    doc.queryAll("button").on.click.add( (event) { ... } ); } Demo
  15. Because Java is dead and JavaScript sucks. But you can

    still use C#. Why Dart?
  16. • https://gist.github.com/1208618 • http://www.dartlang.org/ • https://github.com/Ladicek/dart-playground • https://github.com/Ladicek/dart-matchers • https://github.com/Ladicek/dart-query

    • https://github.com/Ladicek/dpm • https://github.com/LUCA-Studios- LLC/LUCA-UI-Framework-for-Dart Links