'. '

Truffle

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(Get It for Free)
Line 18: Line 18:
Designing your own [[language]]? Do you want to spend time writing a [[debugger]]? If not, use [[Truffle]] and you'll get your [[debugger]] for free!
Designing your own [[language]]? Do you want to spend time writing a [[debugger]]? If not, use [[Truffle]] and you'll get your [[debugger]] for free!
 +
 +
== Debugger in [[NetBeans]] 8.1 ==
 +
 +
[[NetBeans]] 8.1 will ship with support for debugging of [[Truffle]] languages. Here is a promotional video demonstrating how to use such feature:
 +
 +
So download the latest version of [[NetBeans]] and just

Revision as of 10:52, 11 September 2015

A set of APIs to build own language interpreter that gets special treatment by Graal (alternative version of HotSpot VM). As a result a well written interpreter can run faster than generated native code at the end.

Truffle is using sort of AsmJs approach: rather than complicating the JVM (like it was done with invokeDynamic instruction), it creates additional Java APIs that dynamic language vendors may use. The API patterns are then recognized by the enhanced HotSpot compiler to emit more effective code. All of that without modification to the JVM spec.

Truffle Ruby implementation is ten times faster than pure JRuby (which was based on invokeDynamic).

Get It for Free

When designing new language, one usually starts with an AST interpreter. When the language is ready for use, users find out it is great, but slow. So one starts to design a bytecode to speed things up. That helps, but still the execution is slow.

Truffle vision is different: write your AST interpreter using Truffle nodes API and we make it fast!

In addition to that we also give you a debugger for free! The following picture shows a debugger stopped in middle of simple language (an artificial language used for demo purposes) method. The IDE knows nothing about simple language (that is why syntax coloring is missing), but as it is easy to understand the general Truffle AST, the IDE can still provide enough valuable information in the debugger.

Image:TruffleDebugger.png

Please note that the name of the method is properly recognized and shown on top of the stack. Variables a and b and their values are properly shown as well.

Designing your own language? Do you want to spend time writing a debugger? If not, use Truffle and you'll get your debugger for free!

Debugger in NetBeans 8.1

NetBeans 8.1 will ship with support for debugging of Truffle languages. Here is a promotional video demonstrating how to use such feature:

So download the latest version of NetBeans and just

Personal tools
buy