Java was in the past one of the most widely used platform-independent languages, but with the arrival of modern web browsers, JavaScript had largely taken its place. The objective of this thesis was therefore to implement an ahead-of-time compiler from Java bytecode to JavaScript. In the first part, we briefly describe Java bytecode and virtual machine, and compare it with JavaScript. Next, we present the implementation of our compiler, which roughly consists of five phases. We follow with a few examples of its use, along with the comparison with preexisting tools. In conclusion we analyze the finished compiler and present a few options for further improvements.
|