Git Product home page Git Product logo

truffle's Introduction

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. To contribute a change, verify it using

$ mx gate

and start a pull request. Detailed info can be found in the contributing document.

License

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

truffle's People

Contributors

ansalond avatar chrisseaton avatar christianwimmer avatar chumer avatar dougxc avatar eregon avatar gilles-duboscq avatar grimmerm avatar jtulach avatar lewurm avatar lukasstadler avatar mbrantner avatar mlvdv avatar nirvdrum avatar olpaw avatar rschatz avatar smarr avatar thomaswue avatar tkrodriguez avatar vjovanov avatar wirthi avatar woess avatar zapster avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.