racket Getting started with racket Hello, World!


Example

The following example declares a piece of code to be written in Racket, and then prints the string Hello, world.

#lang racket
"Hello, world!"

Racket code can either be run directly from the command line or on the DrRacket IDE. Typing racket on the command line will start a REPL, and typing racket followed by a file name will evaluate the contents of the file. For example, suppose the file hello.rkt contains the above code. Here is an example of running Racket on the command line.

$ racket
Welcome to Racket v6.5.
> "Hello, world!"
"Hello, world!"
> (exit)
$ racket hello.rkt
"Hello, world!"