Cross-compiling Java to JavaScript via tool-chaining

  • Authors:
  • Arno Puder;Victor Woeltjen;Alon Zakai

  • Affiliations:
  • San Francisco State University, San Francisco, CA;San Francisco State University, San Francisco, CA;Mozilla Corporation, Suite, Mountain View, CA

  • Venue:
  • Proceedings of the 2013 International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Cross-compilation translates between different high-level programming languages and enables programmers to use their skill-set on a platform that ordinarily does not support their preferred language. E.g., web applications for desktop browsers and mobile devices such as Firefox OS or Tizen need to be written in JavaScript and are not easily accessible to Java developers. The combinatoric explosion of possible cross-compilers between languages leads to the idea of tool-chaining: instead of a dedicated cross-compiler, chain two already existing cross-compilers. In this paper we demonstrate the chaining of two cross-compilers -- XMLVM and Emscripten -- to translate first from Java to C and then from C to JavaScript. We describe minor adjustments to XMLVM and Emscripten to optimize the generated code resulting in a competitive cross-compiler. Benchmarks show that tool-chaining yields similar performance relative to dedicated cross-compilers. Specifically, we will compare XMLVM/Emscripten with Google's GWT.