Running and compiling your first script

Experimenting in the REPL is fine for small code fragments and you should definitely use it, but soon you will want to keep your code in a file. Use your preferred code editor (or look at the last Development environments for writing Red section of this chapter for editors and IDEs with support for Red development) and type in the following text:

;-- see Chapter02/hello-world.red:Red [    Title: "Simple hello world script"]print "Hello Red World!"

Save the file as hello-world.red; .red is the extension for Red source code files.

The Red [ ] header block is mandatory; we'll see its purpose in the next chapter.

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.