![]() |
|
Navigation |
Synopsis Introduction to the main concepts of the Rascal language.
Details StaticTyping Datatypes ImmutableValues Comprehensions PatternMatching ControlStructures CaseDistinction Visiting Enumerators Functions SyntaxDefinitionAndParsing RewriteRules IDEConstruction CodeModels
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:
![]() |