Book Image

Learn Red ? Fundamentals of Red

By : Ivo Balbaert
Book Image

Learn Red ? Fundamentals of Red

By: Ivo Balbaert

Overview of this book

A key problem of software development today is software bloat, where huge toolchains and development environments are needed in software coding and deployment. Red significantly reduces this bloat by offering a minimalist but complete toolchain. This is the first introductory book about it, and it will get you up and running with Red as quickly as possible. This book shows you how to write effective functions, reduce code redundancies, and improve code reuse. It will be helpful for new programmers who are starting out with Red to explore its wide and ever-growing package ecosystem and also for experienced developers who want to add Red to their skill set. The book presents the fundamentals of programming in Red and in-depth informative examples using a step-by-step approach. You will be taken through concepts and examples such as doing simple metaprogramming, functions, collections, GUI applications, and more. By the end of the book, you will be fully equipped to start your own projects in Red.
Table of Contents (13 chapters)


  1. Draw a 10 x 10 sized base face, and make it draggable with the loose facet. Add a text field that displays the offset of the box by using react, so that the text changes when the base is dragged.
  2. A color of a face can be specified as face/color: as-color r g b, where r, g, and b are respectively the red, green, and blue content of the color (they are integers between 0 and 255). Alternatively, you can use face/color/1 for red, and /2 and /3 for green and blue.
    Write a program that adjusts the color of a white base face, changing each of the r, g, b values by changing three sliders. If this works, then write a reactive version. Note how the reactive code is much simpler.
  3. Examine the Red/System code in the ch10/hello.reds source file. Compile and execute it.
  4. Write a Red/System function that prints in Red/System. Call this from a Red script that says in Red before and...