Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Dart scripts run natively in the browser?

Tags:

html

dart

The Dart language looks like a very nice technology to build web applications for the web. For me it seems that there are no browsers available (yet?) which can run Dart scripts natively. Although there's a description on Dart's site about how to embed such scripts into HTML. I understand that for now i have to "compile" Dart scripts to Javascript. But will this change in the future or the language is designed to be translated to other script standards similar to Haxe?

like image 313
NagyI Avatar asked Oct 10 '11 17:10

NagyI


People also ask

Does dart run in the browser?

Is Dart supported by my browser? Although no production browsers can execute Dart code directly, all modern browsers can execute Dart code that's been compiled to JavaScript.

Does dart run on Chrome?

To use the Dart DevTools or Chrome DevTools to debug a Dart web app, you need the following software: Google Chrome. Dart SDK, version 2.0. 0 or higher.

Is Dart native fast?

Dart is AOT (Ahead Of Time) compiled to fast, predictable, native code, which allows almost all of Flutter to be written in Dart. This not only makes Flutter fast, virtually everything (including all the widgets) can be customized.

Is Dart compiled or interpreted?

Also, there is a Dart Virtual Machine that acts as an interpreter. Thus, Dart is an interpreted compiler language.


2 Answers

This is speculation, but I guess that Chrome will likely support dart natively in the future. It will mean that Chrome will be able to outperform other browsers that don't have the native support.

Update: There's a hint from The Official Google Code Blog that it might be coming:

The Dart VM is not currently integrated in Chrome but we plan to explore this option.

Update 2: It looks like I was right! Here's some recent news:

Additionally, and perhaps most importantly, Google is releasing Dartium, a Chromium build with native Dart support.

It’s more than likely that Dartium is part of a series of steps that Google will be taking to launch native support in Chrome — greatly improving the usefulness of Dart. Bringing native support into other browsers like Firefox and IE, on the other hand, will be quite the challenge.

Update 3: Since I posted this answer, Microsoft have released TypeScript which is a competing technology. I'd say it's unlikely that Microsoft have any intention of integrating Dart into Internet Explorer as they would probably prefer people to use TypeScript rather than Dart.

like image 126
Mark Byers Avatar answered Oct 17 '22 18:10

Mark Byers


The official answer is Yes, Dart will run natively in Chrome. The branch of Chrome, affectionately called Dartium, is now available as source, and binaries will be released soon. More information on how to get and build the source: http://code.google.com/p/dart/wiki/BuildingDartium

like image 30
Seth Ladd Avatar answered Oct 17 '22 18:10

Seth Ladd