goto java;

A session at JavaZone 2014

Thursday 11th September, 2014

2:20pm to 3:20pm (CET)

As Java developers we can learn a lot by studying the compiler. It is very interesting to see what happens to our code on the way to become byte codes.
Contrary to what you may believe, the compiler is in fact surprisingly easy to understand. The compilation process is intuitive, with clearly defined stages: lexing, parsing, attribution, flow analysis, desugaring and finally byte code generation. Each step will be presented with familiar examples that Java developers experience in their everyday work.
Adding goto syntax follows the same step-by-step process, hooking into the relevant stages along the way. The changes can be done incrementally with supporting unit tests to assert the sanity of the compiler.
The example is particularly attractive and educational, as all the required components are readily part of the language: reserved goto word, labeled statements and byte code. A radical change to the language can therefore be achieved with only a tiny effort. This shows how extensible the Java language and virtual machine can be.
Compilation of lambda statements is a particularly interesting new feature. We will look into how this is solved by the compiler, and play with a small naive change to also target earlier releases of the JVM.
Let us demystify the compiler and in a playful manner see what we can do with it!

About the speaker

This person is speaking at this event.
Martin (高馬丁) Skarsaune

Senior Developer and Co-Owner at Kantega

Coverage of this session

Sign in to add slides, notes or videos to this session

JavaZone 2014

Norway Norway, Oslo

9th11th September 2014

Tell your friends!


Time 2:20pm3:20pm CET

Date Thu 11th September 2014

Short URL


Official event site


View the schedule


Books by speaker

  • The SICS Java Port Project: Automatic Translation of a Large Object Oriented System from Smalltalk to Java

See something wrong?

Report an issue with this session