YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Dart presentation

Tópicos em Tecnologia da Computação

Lucas Leal

Page 2: Dart presentation

Agenda

• What is Dart?• Why did Google create Dart? • Does the web really need another language?• What is NEW about Dart?• Why does Dart look so familiar? • How can I play with Dart? Is there a real

editor?

Page 3: Dart presentation

Agenda

• What is in the platform? **• Should I use Dart for my application today?• Who is using Dart in production?• Learn more…

Page 4: Dart presentation
Page 5: Dart presentation

What is Dart?

• Open-source web programming language developed by Google.

• First appearing in GOTO conference in Aarhus, Denmark, October 10-12, 2011.

• Class-based, single-inheritance, object oriented language with C-style syntax.

• It supports interfaces, abstract classes, reified generics, and optional typing.

Page 6: Dart presentation

What is Dart?

• “Batteries included.”– Language and libraries– Tools– VM– Compiler to JavaScript

Page 7: Dart presentation

Why did Google create Dart?

• “We want you to be able to create great web apps. Great web apps improve the web, and when the web does better, everyone wins.” (Walrath, K; Ladd, S)

Page 8: Dart presentation

Why did Google create Dart?

• “Dart helps developers from all platforms build complex, high performance client apps, for the future web,” (Ladd, S)– All platforms: iOS, Android, Java, .NET, C#, C++…– More features, functionalities, integrated– Zero latency, fast computational execution

Page 9: Dart presentation

Why did Google create Dart?

• In another words…

• “Runs web applications at least 2 times faster as it’s possible with JS in V8”

• JavaScript makes the work hard when the application

Page 10: Dart presentation

Does the web really need another language?

• Yes, it does!• Pros:– Developing small applications is easy– Platform independence– Non installation of applications– Supports incremental development– It is EVERYWHERE…

Page 11: Dart presentation

Does the web really need another language?

• Cons:– Developing large-scale applications is hard– No support for libraries– Startup performance is bad

• That said, Dart comes to fill those gaps– No competition with JavaScript (kind of…)

Page 12: Dart presentation

What is NEW about Dart?

• Dart uses a different type checker - “Innocent until proven guilty”

• Nice and compact way to implement a function that evaluates and return a single expression

• Snapshots• Generics, but easy!• HTML library, reusability…

Page 13: Dart presentation

Why does Dart look so familiar?

• They want more than 5 users…• Designed for mass adoption• Scripting language users (JavaScripters), and

structured language users (Java developers)• Anyone familiar with Java, or a C language

should be able to quickly understand Dart

Page 14: Dart presentation

Why does Dart look so familiar?class Point {

Point(this.x, this.y);distanceTo(other) {

var dx = x - other.x;var dy = y - other.y;return Math.sqrt(dx * dx + dy * dy);

}var x, y;

}main() {

var p = new Point(2, 3);var q = new Point(3, 4);print(‘distance from p to q = ${p.distanceTo(q)}’);

}

Page 15: Dart presentation

How can I play with Dart? Is there a real editor?

• DartPad– Executes Dart code interactive in any modern

browser– dartpad.dartlang.org– Provides some code examples

Page 16: Dart presentation

How can I play with Dart? Is there a real editor?

Page 17: Dart presentation

How can I play with Dart? Is there a real editor?

Page 18: Dart presentation

How can I play with Dart? Is there a real editor?

Page 19: Dart presentation

How can I play with Dart? Is there a real editor?

Page 20: Dart presentation

How can I play with Dart? Is there a real editor?

• Dart Editor– Available for Windows, Mac, and Linux– It’s made simple: just select a file and click ‘Run’– Dart Editor compile your Dart code to JavaScript– Features and tools that helps editing Dart code

Page 21: Dart presentation

How can I play with Dart? Is there a real editor?

• ]

Page 22: Dart presentation

How can I play with Dart? Is there a real editor?

• Dartium

Page 23: Dart presentation

How can I play with Dart? Is there a real editor?

• Dartium

Page 24: Dart presentation

How can I play with Dart? Is there a real editor?

• It’s integrated with Chromium (also nicknamed Dartium)

• Dart SDK

Page 25: Dart presentation

What is in the platform?

• Language specifications• Libraries• Compiler to JavaScript• VM• Integration with Chromium• Dart Editor

Page 26: Dart presentation

Should I use Dart for my application today?

• The definitely is YES!

• There are a lot of companies using Dart in production

• The benefits are relevant as showed

Page 27: Dart presentation

Should I use Dart for my application today?

Page 28: Dart presentation

Should I use Dart for my application today?

Page 29: Dart presentation

Should I use Dart for my application today?

Page 30: Dart presentation

Should I use Dart for my application today?

Page 31: Dart presentation

Benchmarking

• DeltaBlue is a one-way constraint solver, originally written in Smalltalk by John Maloney and Mario Wolczko. The main focus in DeltaBlue is on polymorphism and object-oriented programming.

• FluidMotion is a 2D Navier-Stokes equations solver, originally written in JavaScript by Oliver Hunt. The main focus is on accessing numeric arrays, as well as doing floating-point arithmetic.

• Havlak algorithm is an extension of Tarjan’s interval-finding algorithm that deals with irreducible graphs, and constructs a loop-nesting forest for an arbitrary flow graph

Page 32: Dart presentation

Benchmarking• Richards is an OS kernel simulation benchmark, originally written in

BCPL by Martin Richards. The main focus in Richards is on property access and calling functions and methodspolymorphism and object-oriented programming.

• Tracer is a ray tracer benchmark, originally written in JavaScript by Adam Burmister. Both Adam’s and the Octane version in JavaScript use the class emulation pattern from the prototype.js library. Because Dart has a native class system, it’s unfair to do a direct performance comparison with the Octane version. We therefore compare Dart performance with an improved JavaScript version called Tracer. The improved version uses only constructors and prototypes without any abstraction layers in between; it runs 50% faster than the original Raytrace JavaScript benchmark in Octane.

Page 33: Dart presentation
Page 34: Dart presentation
Page 35: Dart presentation
Page 36: Dart presentation
Page 37: Dart presentation
Page 38: Dart presentation

Who is using Dart in production?

• A bunch of companies listed on Dart’s website https://www.dartlang.org/community/who-uses-dart.html

• Google Fiber

Page 40: Dart presentation

References

• Dart’s website: https://www.dartlang.org.• Walrath, K; Ladd, S. What is Dart? O’Reilly, March

2012, CA, EUA.• Walrath, K. What is Dart? Available on:

http://radar.oreilly.com/2012/03/what-is-dart.html. O’Reilly, March 21, 2012. Accessed on May 27, 2015.

• InfoWorld interview: Why Google Dart beats JavaScript, by Paul Krill. Available on: http://www.javaworld.com/article/2078464/mobile-java/infoworld-interview--why-google-dart-beats-javascript.html.

Page 41: Dart presentation

References

• IODev Blog. Dart… Dart… Dart… What is Dart?. June 11, 2012. Available on: http://iodev-blog.blogspot.com.br/2012/06/dartdartdartwhat-is-dart.html.

• Seth Ladd’s Blog. Available on: http://blog.sethladd.com.


Related Documents