Skip to main content

Running Rascal

rascal-0.34.0

Running Rascal: starting a terminal with a read-eval-print-loop

  1. On the Unix or Windows Commandline, start a Rascal Shell by: java -jar rascal-<version>.jar
  2. In VScode, in the command palette type Rascal and select Create Rascal Terminal
  3. In Eclipse, from the button bar select the button with the Rascal logo.
  4. With Maven, Create New Project first and then type: mvn rascal:console

You will be prompted for input right after the version is printed and a lot of information about the current searchpath configuration.

Exit the terminal REPL

Here we show how to quit the terminal:

:quit

Similarly you could type CTRL+D which indicates end-of-file to terminate the process.

Now what?

More information about the features of the shell can be found here. At the prompt you can type Expressions, Statements and Declarations.

rascal>1 + 1
int: 2
rascal>myList = [ i | i <- [1..11], i % 2 == 0];
list[int]: [2,4,6,8,10]
rascal>import Prelude;
ok
rascal>println("Hello <myList> is <size(myList)> long");
Hello [2,4,6,8,10] is 5 long
ok

Next you could create a new Rascal project to start writing Rascal code.