Java Magazine, May/June 2018
ORACLE COM JAVAMAGAZINE MAY JUNE 2018 06 from the editor guages Out of the box GraalVM supports JavaScript Python 3 R and Ruby In addition it can run any code destined for the LLVM back end Today this includes C and C among other languages Looking just at the JavaScript support you can swap out the V8 virtual machine in Node js and replace it with GraalVM and your programs will run unchanged However thanks to GraalVMs support for other languages your project can now run more than JavaScript For example you can define data structures in C or C and use them with JavaScript How cool is that A framework called Truffle is available to facilitate using GraalVM for execution of other languages A tutorial including instructions for implementing a simplified language is available here The second key aspect of GraalVM is the performance improvement it delivers Because I have seen only a few benchmarks I am here relying on information put out by the team at Oracle Labs in which they tout the new ways they optimize performance One of these ways is creating native binaries for Java and JVM programs They do this with ahead of time AOT compilation AOT is a term that refers to regular old compilation to native binaries as C C Go and Rust do To run the programs use some memory management and thread scheduling abilities of the Substrate VM which is a JVM like virtual machine that is itself compiled to native code In this sense the Substrate VM can be viewed as simply a runtime library of functions needed for execution This native option removes the JVMs long startup time In addition the code is not interpreted at any point providing further performance benefit Another path to reduced execution time is the use of moreaggressive optimizations For example GraalVM makes extensive use of escape analysis a type of analysis that recognizes certain data objects that can be treated as if they were local variables resulting in far fewer memory allocations Ben Evans and Chris Newland examined escape analysis in considerable detail in the previous issue In addition GraalVM makes expansive use of inline code so that many calls are now replaced by direct execution This optimization is available for Java and the languages discussed earlier GraalVM is an exciting project not only because it continues to expand the possibilities of both Java and the JVM but because it appears to have a genuine opportunity to deliver on the quest of many language infrastructure developers a virtual machine that runs all major languages well Because of its importance in advancing the Java platform and because it is inherently such interesting technology well be covering GraalVM extensively in future issues of the magazine But dont wait for us if you want to start working with the technology now go to the website download it and try it out Andrew Binstock Editor in Chief javamag_ us@ oracle com @ platypusguy The Best Resource for Modern Cloud Dev The Oracle Developer Gateway is the best place to jump start your modern cloud development skills with free trials downloads tutorials documentation and more Trials Downloads Tutorials Start here developer oracle com developer oracle com developersrule
You must have JavaScript enabled to view digital editions.