Coder Social home page Coder Social logo

approximate-enerj's Introduction

EnerJ

The type checker and simulation framework used in the evaluation of EnerJ are available for download. The system is very much a work in progress and is available under the terms of Matt Might's CRAPL.

I unfortunately can't promise support with using this code. But if you have a bug report or other inquiry, send me email.

Compiling EnerJ

To use the system, first download and install the Checker Framework, which adds JSR 308 type annotations to Java. Be sure to get version 1.3.1. Set the JSR308 environment variable to point to the directory containing the CF's checkers directory; the EnerJ build files will look for this variable.

Then get the EnerJ source (this package) and the CF runtime library. You can also clone the source as Mercurial repositories from BitBucket. Look for the "enerj" and "checker-runtime" repositories on my page.

Expand both packages into a common directory. Make sure the directories are named "enerj" and "checker-runtime" and are siblings in the directory tree. First, build the checker-runtime library against the Checker Framework by typing ant in its directory. Then build EnerJ the same way.

If you have trouble with the build—for example, if ant complains about a missing tools.jar or compiler-related classes, be sure to set your $JAVA_HOME environment variable to point at the appropriate place. (Exactly where depends on your OS and JDK installation.)

Using the Compiler

The enerjc and enerj tools (in bin) can be used to compile and run EnerJ programs in place of javac and java.

Pass the flag -Alint=simulation to enerjc to compile source files with the simulation source-to-source translation enabled. Then pass -noisy to enerj to enable error injection in a simulated approximate program.

Known Bugs

The type checker has no known bugs, but the simulator translation does. (It's based on a pile of hacks on top of the internal, undocumented javac API, so some things don't work as they should.)

  • Inner classes that reference final variables in the scope of their containing method don't work. To use EnerJ, you'll need to turn these classes into outer classes and pass state explicitly.
  • Name conflicts between classes and packages can cause problems. This is because the simulation translation uses fully-qualified names to refer to classes but this can break if a package name is shadowed by a class name. To avoid this, follow the Java convention of naming your classes with CamelCase and your packages in lower case.

approximate-enerj's People

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.