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
divide/rater.rsl
divide/rater.rsl
if, the check knows that the difference is nonzero:
guarded/rater.rsl
guarded/rater.rsl
guarded/rater.rsl
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
cycle/rater.rsl
cycle/rater.rsl
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
conservative/rater.rsl
conservative/rater.rsl
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,FactorandPctname 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.
Related
- The type system describes the types and the facts that the check tracks.
- Exact numbers explains precision and rounding.
- Check messages explains each message, with a program that gets it and the fix.