Skip to main content
RSL is a total, pure, statically typed language. It leaves out loops, recursion and side effects. In exchange, every program that passes rslc check has the properties on this page.

The guarantees at a glance

A failure becomes a compile error

In most languages, a division by zero shows up when the program runs. In RSL, the check finds it in the source. This calculation divides by the difference of two inputs, each from 1 to 10:
divide/rater.rsl
The check works out the range of the divisor from the ranges of its inputs, and that range holds 0. A guard removes the case. Inside the if, the check knows that the difference is nonzero:
guarded/rater.rsl
The same rule covers each operation that can fail:

Every program finishes

RSL has zero loops and zero recursion. A calculation reads other calculations, and a chain of reads that returns to its start is an error:
cycle/rater.rsl
A list function such as sum visits each item of an input list once. So the work of one run has a bound in the sizes of those lists, and a passing check prints it on its cost line.

The checker is conservative

The check accepts a program only when it can show each operation safe. It refuses some programs that are safe:
conservative/rater.rsl
For a whole number b, the divisor is always nonzero. The check tracks one range for each value, and the range from -1 to 98 holds 0. A guard on the divisor, or a narrower input, gives the check the fact it needs. The check keeps these facts about a value: its range, its decimal precision, a finite set of values, nonzero, non-empty, and present. It runs in one pass, so the same source always gets the same messages.

How each guarantee is established

A failure that the checker misses stops that one rating with an error, in place of a premium.

What RSL leaves out

  • General computation. RSL has zero loops, recursion or user-defined functions. A program is records, tables, rules and calculations.
  • Text. A value is a number, a date, a Bool, an enumeration member or a code with a pattern. Free text is outside the language.
  • Input and output. A program reads its request and its own tables.
  • Unit checking. Premium, Rate, Factor and Pct name the role of a number. A premium plus a factor compiles.
  • Proof that a program matches its source documents. The check requires a citation for each filed number, and a reviewer reads the cited page. Checks and guarantees lists what a review still covers.
  • A stable 1.0. A file names its language version, and this compiler reads versions 0.4 and 0.4.1. Versions explains each number.