Skip to content

Frequently Asked Questions

Ingo60 edited this page Jan 19, 2013 · 15 revisions

Can Frege be used to ....

If it cannot be done with Java, then it cannot be done with Frege either. Otherwise, the answer is "most likely". Remember, writing Frege code is just a more convenient way to write Java code.

Why would I need Java 7? How can I use frege with Java 6?

JDK7 is the official development platform, it is choosen because it has the fork/join packages which are used for parallelization.

However, apart from that, no Java 7 features are used. Hence, it is possible to compile and run frege programs that do not need paralellism with Java 6.

Here are the steps to follow, based on the "Re-Compiling the Compiler" section of the Getting Started page:

After clonig the frege repository, do the following adaptions:

  1. In the Makefile, we let JAVAC point to a java6 compiler and comment out the lines referring ForkJoin.fr, ForkJoin.class

  2. In the JAVA macro, the property -Dfrege.javac must also point to the java6 compiler.

  3. In frege/runtime/CompilerSupport.java, we need to remove references to the Files class and re-implement the slurp method. The following one-liner could help: return new Scanner(new File(filename), encoding).useDelimiter("\\Z").next();

  4. In frege/runtime/Runtime.java, comment out the fork method and in the runMain method, the use of fork/join needs to be removed and hence checking the 'parallel' option is unnecessary (can be removed).

  5. In frege/StandardLibrary.fr, the import Lib.ForkJoin needs to be removed.

Note that, in order to run the downloaded frege compiler, you still need at least JRE 7.

Clone this wiki locally