Showing posts with label Dart programming. Show all posts
Showing posts with label Dart programming. Show all posts

Monday, 10 October 2011

First information on DART Programming language

Programmer and project leader Lars Bak detailed the project in a talk today at the Goto conference conference today in Denmark and in a blog post. Dart is geared for everything from small, unstructured projects to large, complicated efforts--Gmail and Google Docs, for example.

"If we want to focus on making the Web better over time, we have to innovate," including with new programming languages, Bak said in an interview today.

Google also unveiled a Dart language site including open-source tools for writing Dart programs, code samples and tutorials, supporting libraries of supporting software, the Dart language specification, and forums for discussion.

A month ago, details about Dart raised some hackles about Google's Web technology tactics when an 2010 internal memo about it, then called Dash, surfaced on a mailing list. One tidbit from that memo is that Dart's goal is "to replace JavaScript as the lingua franca of Web development."

Google is a big company, though, and others within the company remain strong JavaScript adherents. And Bak, while not denying Google has big ambitions, was quick to proclaim JavaScript alive and well.

"It's not going to replace JavaScript," Bak said. "JavaScript is is a cornerstone of the Web today, and it will continue to be for a long, long time."

Bak bristled at some of complaints about Google's approach to creating Dart in-house and not through a more collaborative approach.

"I don't buy the argument that before writing any line of code or designing any features, you put it in a standards committee, because that would just be a lot of screaming," Bak said. "You have to have coherent design before you start adopting Dart as a standard."

Making a standard is a goal, though. "It will be fairly lonely to create a standards committee when here's only us in it. We first have to get the backing of other partners before we can make a standard that's useful," he said.

Google is releasing Dart now for the next step in its maturation: outside feedback and participation. "We hope the other browser vendors will be excited," Bak said, adding that today is the first that Google has shared details about Dart with them or others.

Google is evaluating the best way to integrate Dart directly into its Chrome browser, something Bak is keen on. One reason: it will enable a "snapshotting" technology that dramatically improves a Web app's start-up time. Snapshotting involves taking an application and "serializing" it into a single block of data.

    Dart's design goals are:

    Create a structured yet flexible language for Web programming.

    Make Dart feel familiar and natural to programmers and thus easy to learn.
   
        Ensure that Dart delivers high performance on all modern Web browsers and environments ranging from small handheld devices to server-side execution.

    Dart targets a wide range of development scenarios: from a one-person project without much structure to a large-scale project needing formal types in the code to state programmer intent. To support this wide range of projects, Dart has optional types; this means you can start coding without types and add them later as needed. We believe Dart will be great for writing large web applications.
   
    Dart programs will be able to run within a Dart virtual machine--essentially a layer of software that acts as a computer to execute programs. They'll also be able to run using a compiler that translates Dart code into JavaScript code for browsers that don't support Dart, Bak said.
       
        Google's Chrome browser has served as a vehicle to get the company's technology such as WebM and SPDY useful for at least a portion of Web users. Though the 2010 Dart/Dash memo said Google planned build Dart support into Chrome, Bak was cautious about making any definite statements beyond saying browser integration brings benefits. It's notable, though, that Bak led development of Chrome's V8 JavaScript engine, so he's hardly a stranger to the Chrome team or to the challenges of improving Web-app speed.
       
        Building Dart into Chrome could let Google build Dart versions of its advanced Web apps that--if the language lives up to its billing--could be better than those Web apps today.
       
        "Google has a lot fairly big Web applications. That includes Gmail and Docs. I hope many of these apps will be converted into Dart," Bak said--but cautioned that was his personal option, not an explicit plan.
       
        Introducing new programming languages is tough. Though many hope that computing can improve by reforming or replacing languages, the incumbent power of existing languages is strong. Educating thousands or millions of programmers, building developer tools, and creating supporting libraries of code all can take years. As newer languages such as Java, JavaScript, and C# attest, though, it is possible.
       
        Google also is trying to gain a foothold for Go, a programming language geared more for native software that today would most likely be written with C or C++.
       
Dart is designed to address several shortcomings Google sees with Web programming today, according to the Dart technical overview:

Small scripts often evolve into large web applications with no apparent structure--they're hard to debug and difficult to maintain. In addition, these monolithic apps can't be split up so that different teams can work on them independently. It's difficult to be productive when a Web application gets large.

 Scripting languages are popular because their lightweight nature makes it easy to write code quickly. Generally, the contracts with other parts of an application are conveyed in comments rather than in the language structure itself. As a result, it's difficult for someone other than the author to read and maintain a particular piece of code.

 With existing languages, the developer is forced to make a choice between static and dynamic languages. Traditional static languages require heavyweight toolchains and a coding style that can feel inflexible and overly constrained.

 Developers have not been able to create homogeneous systems that encompass both client and server, except for a few cases such as Node.js and Google Web Toolkit (GWT).

 Different languages and formats entail context switches that are cumbersome and add complexity to the coding process.

Monday, 3 October 2011

How to compile and execute/run Dart programming language

Please follow the instructions in the PreparingYourMachine page.

Building everything

Follow the steps in GettingTheSource to retrieve everything (use all.deps). You will end up with a tree that looks like this:
   dart/
     client/
     compiler/
     corelib/
     language/
     runtime/
     tools/
     ...
then, from the dart directory use the build.py script under tools/:
$ cd dart
$ ./tools/build.py --arch=ia32
We recommend that you use a local file system at least for the output of the builds. If your code is in some nfs partition, you can link the out directory to a local directory:
$ cd dart/
$ mkdir -p /usr/local/dart-out/
$ ln -s -f /usr/local/dart-out/ out

Testing

All tests are executed using the test.py script under tools/. You can run all tests as follows:
$ ./tools/test.py --arch=ia32,dartc,chromium
You can run a specific test by specifying it's full name or a prefix. For instance, the following runs only tests from the core libraries:
$ ./tools/test.py --arch=ia32,dartc,chromium corelib
the following runs a single test:
$ ./tools/test.py --arch=ia32,dartc,chromium corelib/ListTest

Troubleshooting and tips for browser tests

  1. If a test fails, run it again individually, passing also -v --keep_temporary_files
  2. To probe the test failure with a debugger, grab the URL printed by the test, load it in Chrome, and go at it with Dev Tools.
    • Note: the generated html test is deleted unless you specify --keep_temporary_files when running test.py.
    • Tip: in the Scripts tab's lower left is a "stop sign" icon you can use to break on any exceptions in your test.
Some common problems you might get when running tests for the first time:
  • some fonts are missing. chromium tests use DumpRenderTree, which needs some sets of fonts. See LayoutTestsLinux for instructions in how to fix it.
  • no display is set (e.g. running tests from an ssh terminal). DumpRenderTree is a nearly headless browser. Even thought it doesn't open any GUI, it still requires to have an X session available. There are several ways to work around this:
    • use xvfb:
    • xvfb-run ./tools/test.py --arch=chromium ...
    • other options include, using ssh X tunneling (ssh -Y), NX, vnc, setting up xhost and export the DISPLAY environment variable, or simply run tests locally

Building the standalone VM

Follow the steps in GettingTheSource to retrieve the standalone VM (use standalone.deps). You will end up with a tree that looks like this:
   dart/
     corelib/
     language/
     runtime/
     standalone.deps/
     tests/
     third_party/
     tools/
then, from the runtime directory use the build.py script under tools/:
$ cd dart/runtime
$ ../tools/build.py --arch=ia32
We recommend that you use a local file system at least for the output of the builds.

Testing

All tests are executed using the test.py script under tools/. You can run all tests as follows from the runtime directory:
$ ../tools/test.py --arch=ia32
By default the build and test scripts will select the debug binaries. You can build and test the release version of the VM by specifying --mode=release or both debug and release by specifying --mode=all on the respective build.py and test.py command lines.

Dart programming language from Google

After the release of GO Lang from Google on 2009, we didnt hear any thing from our search giant.May be the last one that I head is appengine supports the Go lang , mean while the cost of appengine increased like anything. Every one was busy with Android and the Motorola's acquisition by Google.  So what is DART ? No idea. They are not ready to reveal any thing till October . On October they may release the brief on GOTO developers conference . May be that conference may be for this new programming languages release. But we may expect this may change the web programming or no one cares.
Thinking +ve , the key people involved are Lars Bak , who worked for Sun many years , who owns dozens of patents and Gilad Bracha , a veteran of SAP Labs . The only thing that we can think is the new language, is purely for web and will need Chrome / Android . Bracha blogs mentioned that “However, Javascript remains a seriously limited language for platform implementation. Here are some of the problems.Concurrency primitives. There aren’t any.”  So are they targeting Oracle’s Java? One thing by reading Bracha’s blog , I felt that , this Dart is a language that has the capability of communicating to the machine directly like C and in the same time it can play around with Web.