On this page:
1.1 REPL
1.2 Text File

1 Installation🔗ℹ

The Raqet language is developed with Racket and runs in the same environment.

Raqet is not distributed on its own, but as a package of Racket. Thus, to execute Raqet programs, you must have Racket environment available first. Racket environment is easy to obtain. Visit Racket official website, download the installer, and follow its instructions.

It’s recommended to use the command line to complete the remaining parts of installation. On Windows, you can use cmd or pwsh, and on Linux, you can use bash or whatever. Ensure that the Racket executable is added to the PATH environment variable. Launch a shell session. type raco, and you should see:

Usage: raco <command> <option> ... <arg> ...
 
...

Then, you may install Raqet distribution with raco pkg install raqet

There are primarily two ways to execute Raqet programs: REPL or text files.

1.1 REPL🔗ℹ

Raqet REPL is as well launched with raco command line tool:

$ raco qing

In the REPL interface, you will see a >  prompt, which indicates that the REPL is waiting to receive a line of Raqet code. We can enter some code after this prompt. Although we have not yet learned the syntax of the Raqet language, we can try entering some arithmetic operations.

> 1+2*3/4

The REPL will tell whether the code is ready to be evaluated by pairing parentheses. Since the line above has no parenthesis, it will be evaluated once “Enter” key is pressed:

> 1+2*3/4
2.5

If there is any unmatched open parenthesis, the REPL will wait until corresponding close parenthesis is found:

> (1+2
  )*3/4
9/4

1.2 Text File🔗ℹ

It is convenient to store your program in a text file so that it could be executed multiple times. Normally, a Raqet source file should have extension .q, but it’s not mandatory. But any Raqet source file should start with the following line:

#lang qing

Raqet does not have a standalone executable. Programs are executed with racket command, like this:

$ racket hello.q

It is the line #lang qing that helps racket to determine the file’s language.