DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Google's "Dart" on the JVM

Google's "Dart" on the JVM

James Sugrue user avatar by
James Sugrue
CORE ·
Oct. 18, 11 · Java Zone · Interview
Like (0)
Save
Tweet
13.79K Views

Join the DZone community and get the full member experience.

Join For Free

Google's newest programming language can now be run on the JVM, thanks to the JDart project hosted on Google Code. Unveiled at the goto conference last week, the Dart language is seen by some to be suitable for Java developers who can't get into Javascript. The language is supposed to make it easy to create quick prototypes using structured code. Visual Basic for the web? We'll see. 

The JDart project is in it's early stages, with only a few instructions translated. The JDart compiler generates jar files to run on any Java 7 VM. The author has provided a few examples so you can see what the compiler actually generates. Here's the simple Hello World output. First the Dart code: 

main() {
  print("hello world");
}

Which gets compiled to the following:

public class test {
  public static void main(java.lang.String[]);
    Code:
       0: invokedynamic #18,  0             // InvokeDynamic #0:__main__:()V
       5: return        

  public static java.lang.Object __main__();
    Code:
       0: ldc           #21                 // String hello world
       2: invokedynamic #27,  0             // InvokeDynamic #1:print:(Ljava/lang/String;)V
       7: aconst_null   
       8: areturn       
}

It's very early days for Dart, and it has a long way to go if it has any chance of toppling Javascript. But if you've been messing around with the languages, perhaps this project gives you another reason to consider moving to it for your web applications. 

 

 

Java (programming language) Java virtual machine Google (verb) Dart (programming language)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Implementing RBAC Configuration for Kubernetes Applications
  • A Simple Guide to Heaps, Stacks, References, and Values in JavaScript
  • What Is Cloud-Native Architecture?
  • Why Performance Projects Fail

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo