Meeting Details
- Date: Monday 19 May 2008. 6:00pm – 7:30pm
- Where: BreckNock Hotel, 401 King William Street Adelaide mapabsmiddle
- Agenda
- 6:00 Java News and Views (15 mins)
- 6:15 Presentation (60 mins)
- 7:15 Question and Answers (15 mins)
- 7:30 Counter meal and a drink at the BreckNock
Java Compiler API on Bare Metal
New facilities were added to Java 6 to allow the Java compiler to be invoked programmatically and to generate and walk Abstract Syntax Trees (ASTs): the Java Compiler API and Compiler Tree APIs. Also added was the Pluggable Annotation Processing API.
When taken together, these APIs make it possible to create useful and interesting tools for static analysis, refactoring, code generation and so on. As a motivating (and slightly off-the-wall) example for learning about these new APIs, I will present and explain a Java program that, for a small subset of the Java language, generates target code for a microcontroller. The generated code will then be assembled, flashed into, and run on that microcontroller.
This talk could also be entitled: “Embedded Java: Down to the Metal, part 2”, or even “Bare Metal Java” after my 2004 AJUG down-to-the-metal talk in which I hinted at the possibility of doing something like the above. Java 5’s annotations and Java 6’s compiler-hacking features have made this more feasible.
Java, assembly code, blinkenlights. Oh my!
Presenter: David Benn, ASTC
David is a software engineer with ASTC where he develops simulators (and related tools) for various hardware platforms. In his spare time he enjoys stargazing with a computerised telescope, getting low-resource microcontrollers to do amusing things, plumbing the depths of functional programming, bike riding with his family, and generally wondering where the time goes.
Links
- JSR 199, the Java Compiler API http://www.jcp.org/en/jsr/detail?id=199
- JSR 269: Pluggable Annotation Processing API http://www.jcp.org/en/jsr/detail?id=269
- The OpenJDK Project’s javac section: https://openjdk.dev.java.net/compiler/
- The Kitchen Sink Language project: https://ksl.dev.java.net/
- David’s Blog http://dbenn.wordpress.com/
Fine: 19/05/08 08:00 PM
Sede:
BreckNock Hotel, 401 King William Street, Adelaide, SA, Australia


