DukeScript: A safer way to 'write once, run anywhere'

DukeScript lets Java developers code fluently across mobile, web, and desktop platforms

DukeScript: 'Write once, run anywhere' without the Java Plug-in

Created by NetBeans co-founder Jaroslav Tulach, DukeScript is a cross-platform mobile, web, and desktop rendering technology that seeks to fulfill Java's "write once, run anywhere" potential. Using DukeScript APIs, developers can write applications in Java and HTML5 and run them in any Android, iOS, desktop browser, or HTML5/JavaScript environment.

What sets DukeScript apart is that it runs Java on the client side but without the Java Plug-in and its associated update and security concerns. Unlike a Java-to-JavaScript compiler, DukeScript uses UI bindings and an in-house VM to enable cross-platform compatibility between desktop and mobile environments. Written by Tulach, the Bck2Brwsr VM enables both ahead-of-time and just-in-time compilation, with extensible support for additional VMs.

Anton Epple, DukeScript's co-creator with Tulach, described the framework's basic architecture in an interview with InfoQ editor Abel Avram:

DukeScript applications run inside a JVM and use the HTML-Renderer to display the page. When the page is loaded, DukeScript binds the dynamic elements of the page to the data model using Knockout.js internally. The difference to a classic Knockout.js application is that the data model consists of Java Objects, which the user can manipulate from his Java code. This way the business logic can be completely written in Java and is cleanly separated from the UI.

DukeScript was one of Oracle's Duke's Choice Award winners for 2014. Learn more about DukeScript from Epple's InfoQ interview or Tulach's DukeScript for Dummies video tutorial.

This story, "DukeScript: A safer way to 'write once, run anywhere'" was originally published by Java Everywhere.