Navigation
Synopsis Introduction to the main concepts of the Rascal language.
Description Rascal has a statically checked type system that prevents type errors and uninitialized variables at runtime. There are no runtime type casts as in Java and there are therefore less opportunities for run-time errors. The language provides higher-order, parametric polymorphism. A type aliasing mechanism allows documenting specific uses of a type. Built-in operators are heavily overloaded. For instance, the operator + is used for addition on integers and reals but also for list concatenation, set union and the like.

The flow of Rascal program execution is completely explicit. Boolean expressions determine choices that drive the control structures. Rewrite rules form the only exception to the explicit control flow principle. Only local backtracking is provided in the context of boolean expressions and pattern matching; side effects are undone in case of backtracking.

Most language concepts are described separately but some features we just mention here:
  • Rascal programs consist of modules that are organized in packages.
  • Modules can import other modules.
  • The visibility of entities declared in modules can be controlled using public/private modifiers.
  • Data structures may have annotations that can be explicitly used and modified.
  • There is an extensive library for built-in datatypes, input/output, fact extraction from Java source code, visualization, and more.
Here is a brief summary of the concepts to be discussed:
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.