Skip to content

Commit

Permalink
Added more details about interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
mmhelloworld committed Nov 14, 2013
1 parent 66429f1 commit 0529861
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
#Frege Scripting#

This project aims to interpret Frege code snippets and it is the base for Frege REPL.
This project aims to interpret Frege code snippets with on-the-fly in-memory compilation.

The interpretation comprises of two step process as with normal Frege programs:
Compilation and Execution. The compilation step, unlike in a normal process, does not produce any class files on the
file system; instead it keeps them in memory. The interpreter just loads those class files from memory and executes that
class. Just like normal Frege compilation, it also involves Java compilation which is acheived by
using Eclipse JDT compiler so JDK is not required, just JRE is enough.
The interpreter reuses most of the Frege compiler - lexer, parser, type checker and Java code generation.
Just after the code generation, instead of generating Java class files on the file system
using an external Javac process, the interpreter compiles the Java code into memory and then
through a special classloader, it loads the byte codes from memory. The actual result is then obtained through reflection
on the dynamically generated class.

Unlike normal Frege compilation, the interpreter does not produce any class files on the
file system; instead it keeps them in memory. Eclipse compiler is used for Java compilation on-the-fly which
eliminates the JDK dependency so to use the interpreter, only JRE is necessary.

Frege REPL and [Online REPL](http://try.frege-lang.org/) make use of frege-scripting to provide an interactive
environment on terminal as well as on the browser.

####JSR 223 Scripting support####

This project also implements JSR 223, a scripting engine for Frege.
Frege Script Engine is available under releases page [here](https://github.com/Frege/frege-scripting/releases).
This project also implements JSR 223, a scripting engine for Frege. This enables nice interface to Java and other systems
which support other JVM languages through JSR 223 scripting engines.


###How to get frege-scripting?###

Frege REPL and [Online REPL](http://try.frege-lang.org/) make use of frege-scripting and
the frege-scripting binaries can be obtained from frege-repl releases page [here](https://github.com/Frege/frege-repl/releases).
**Build from sources**: Checkout into some directory and then ```mvn install```

**Binary**: Under releases page [here](https://github.com/Frege/frege-scripting/releases).

0 comments on commit 0529861

Please sign in to comment.