Navigation
Name Recipes/Basic
Synopsis Some basic, hello world-like, examples of Rascal programs.
Description We discuss the following examples:
  • Hello: Variations on the ubiquitous Hello World example.
  • Factorial: Compute the factorial function.
  • Squares: Print a list of squares
  • BottlesOfBeer: A Rascal version of a generator for the 99 Bottles of Beer song.
  • Bubble: Variout styles to write bubble sort.
  • Even: Produce a list of even numbers.
  • FizzBuzz: We solve a well-known job interview puzzle.
  • Quine: A self-reproducing program.
Pitfalls These programs illustrate various features of Rascal; they are not representative as use cases of the language.
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.