Dart

Vít Koma

Dart Language


  • Scripting language for web development
    • JavaScript replacement
  • Object oriented
  • Optionally typed
  • Syntax similar to Java or C#
  • Targets both client and server applications

Dart Features

  • Optional types
  • Modularity
  • Functional programming support
  • Class-based OOP support
  • Implicit interfaces
  • Generics
  • Mixins
  • Futures

Isolates

  • Isolated unit of running code
  • Isolates does not share memory
  • Communicate by messages
  • Implementations may vary
    • WebWorkers in a browser
    • Threads on server

Tools

  • SDK
    • virtual machine
    • compiler to JS
    • package manager (pub)
  • Dart Editor
  • Dartium

PUB

  • Package manager and build tool
  • Similar to Maven or Gradle
  • Metadata stored in pubspec.yaml file
    • name
    • description
    • author
    • dependencies
    • etc


Running in Browser

 <script type="application/dart" src="my_app.dart"/>
 <script type="packages/browser/dart.js"/>

  • Dartium browser
    • executes my_app.dart (after DOM is loaded)
    • dart.js detects Dart VM and does nothing
  • Other browsers
    • ignore my_app.dart
    • dart.js rewrites previous script element to
      <script src="my_app.dart.js"/>

DOM AND AJAX

  • DOM traversal and manipulation similar to jQuery
  • Simple AJAX calls with futures

RESOURCES

Q&A

Dart

By Vit Koma

Dart

  • 517