Skip to content
forked from oracle/graal

The Truffle Language Implementation Framework

License

GPL-2.0, UPL-1.0 licenses found

Licenses found

GPL-2.0
LICENSE
UPL-1.0
LICENCE.UPL
Notifications You must be signed in to change notification settings

mbrantner/truffle

 
 

Repository files navigation

The Truffle Language Implementation Framework

Introduction

Truffle is a framework for implementing languages as simple interpreters. Together with the Graal compiler, Truffle interpreters are automatically just-in-time compiled and programs running on top of them can reach performance of normal Java.

The Truffle framework provides the basic foundation for building abstract-syntax-tree (AST) interpreters that perform self-optimizations at runtime. The included TruffleDSL provides a convenient way to express such optimizations.

Truffle is developed and maintained by Oracle Labs and the Institute for System Software of the Johannes Kepler University Linz.

Using Truffle

Truffle official documentation is part of Truffle javadoc. It includes description of common use-cases, references to various tutorials, code snippets and more. In case you want to embedded Truffle into your application or write your own high speed language interpreter, start here.

Our typicial sample language is called the SimpleLanguage. A good entry point for exploring SimpleLanguage is the SLLanguage class. In addition to that here are links to presentations, FAQs and papers about Graal and Truffle:

Hacking Truffle

Truffle and Graal use the MX build tool, which needs to be installed before using this repository. To do so execute in a clean directory:

$ hg clone https://bitbucket.org/allr/mx
$ mx/mx

the mx/mx command is a wrapper around Python script that serves as our build tool. Make sure you put it onto your ''PATH'' and then you can work with Truffle sources from a command line:

$ mx clean
$ mx build
$ mx unittest

The created ./build directory contains all necessary jars and source bundles.

  • truffle-api.jar contains the framework
  • truffle-dsl-processor.jar contains the TruffleDSL annotation processor

You can open Truffle sources in your favorite Java IDE by invoking:

$ mx ideinit

the necessary IDE metadata will then be generated into truffle subdirectory and its folders.

mx supports Maven integration. To register prebuilt binaries into local Maven repository you can invoke:

$ mx build
$ mx maven-install

and then it is possible to include the artifacts as dependencies to a pom.xml:

<dependency>
  <groupId>com.oracle</groupId>
  <artifactId>truffle</artifactId>
  <version>0.8</version>
</dependency>
<dependency>
  <groupId>com.oracle</groupId>
  <artifactId>truffle-dsl-processor</artifactId>
  <version>0.8</version>
  <scope>provided</scope>
</dependency>

Contributing

You can contact the Truffle developers at [email protected] mailing list.

License

The Truffle framework is licensed under the GPL 2 with Classpath exception. The SimpleLanguage is licensed under the Universal Permissive License (UPL).

About

The Truffle Language Implementation Framework

Resources

License

GPL-2.0, UPL-1.0 licenses found

Licenses found

GPL-2.0
LICENSE
UPL-1.0
LICENCE.UPL

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.3%
  • Other 0.7%