Dart in なごやまつり

Dart in なごやまつり

2013/08/25 なごやまつり https://connpass.com/event/2414/

A8e4760b4a4b9227a12bcd37476987fd?s=128

Tomochika Hara

August 25, 2013
Tweet

Transcript

  1. Dartの型システム @zetta1985 原 知愛 Dart / Java / JS /

    DDD / REST Google信者 #SugoiH_c0hama #nagoya.dart 2013/08/25 なごやまつり
  2. Dart Runtime Dart Code Dart VM Snapshot dart2js JavaScript V8

    etc...
  3. Isolates Isolate Receive Port Isolate Receive Port Send Port Send

    Port Snap shot Snap shot
  4. Development Tools Dart Editor Dartium (Browser) Dart SDK Dart VM

    dart2js dart analyzer dartdoc Pub (Package Manager) Eclipse Plugin IntellJ IDEA Plugin
  5. Language Spec 基本はゆるふわなJava • 言語設計者はGilad Bracha氏 ◦ Java言語仕様 ◦ JavaVM仕様

    ◦ Pluggable (Optional) Type System提唱 • 他、Jochua J. Bloch氏(Effective Javaの人)も
  6. Language Spec • Optional Parameter • Named Parameter • Method

    Cascading • Const Variable • Generics • Named Constructor • Factory Constructor • Library Private • Implicit Interface • Mix-in
  7. 動的型付言語(実行環境) + 型検査器(ツール) || Optional Typing

  8. Java-likeなLL(Dart VM) + dartanalyzer || Dart

  9. 良い所 Future & Stream API

  10. Future: File IO new File("./foo.txt").fullPath() .then((fullpath) { print("foo.txt's fullpath is

    $fullpath"); }) .catchError((e) { print("foo.txt is not exists."); });
  11. Future: HTTP Request new HttpClient().getUrl(url).then((req){ req.headers.add("contentType", "text/html"); return req.close(); }).then((res)

    { res.transform( new StringDecoder()).forEach(print); });
  12. Stream: Standard Input print("Please Input A."); var lines = stdin

    .transform(new StringDecoder()) .transform(new LineSplitter()); lines.listen((str){ print("Your input's length : ${str.length}"); print(str == "A" ? "Just A." : "Not A."); });
  13. Stream: DOM Event var stream = query("input#hello").onClick; stream.listen((e) { window.alert("hello,

    world."); });
  14. Stream: HTTP Server HttpServer.bind("127.0.0.1", 8080).then((server) { server.listen((req) { req.response.write("This message

    from my server."); req.response.close(); }); });
  15. Stream: File Read Stream<List<int> stream = new File('bar.txt').openRead(); StreamSubscription<List<int>> subscription;

    subscription = stream.listen((bytes) { for (var b in bytes) { print(new String.fromCharCode(b)); if (b == '#'.codeUnitAt(0)) { subscription.cancel(); return; } } });
  16. DartとGoogle • Dartの一番のUserは、Google自身 • SPDYのような普及方法を目指す? • GoogleはWebエンジニアと共に、  Web開発の未来を作りたい。 • JavaScriptを駆逐するわけではない

  17. Dartのこれから • dartanalyzerをもっと進化させたい  (個人的に) • Chromeにさえ乗っかれば・・・ • Google App Engine対応が気になる

    • Android対応すればワンチャンあるで
  18. Thanks