This is a small numeric language for the course. Programs are sequences of statements; blocks and control flow can nest.
x = expression;, print(expression);, and { statements }.
if (condition) { statements }, with an optional else { statements }.
while (condition) { statements }. Braces are required for every control-flow body, making nested else clauses unambiguous.
- Arithmetic:
+ - * / %, unary minus, and parentheses. Conditions: comparisons < <= > >= == !=, true, false, and short-circuit ! && ||.
- Comments:
// to end of line and /* block comment */.
Variables have one program-wide scope and numeric values. Assign before use, or provide initial values before running. Division is real-valued; % is remainder. Conditions are separate from numeric expressions, so write x != 0 rather than if (x). There are no declarations, arrays, functions, strings, or break/continue. Numbers use JavaScript’s finite floating-point arithmetic.
Build translates the whole program immediately. Select an IR instruction to find its source line and semantic equation. Use “Replay translation” to revisit attribute evaluation, then “Run IR” to execute and inspect the runtime trace. Generated labels and copies are deliberately left unoptimized so the SDD remains visible.
Limits: 500 tokens, 8,000 source characters, and 10,000 executed instructions. A runtime error retains the trace up to the failing instruction.