The Scaly Programming Language

Chapter 1

Introduction

Overview

Scaly is a compiled programming language. Three ideas shape it:

  • Self-scaling — A plain for loop is spread across the cores when the compiler can prove that its iterations are independent and the work pays for it; there is no syntax to ask for it. The proof rests on the difference between a function, which only reads its arguments and returns a value, and a procedure, which may change things.

  • Memory without ceremony — Memory is managed in regions the compiler infers: no garbage collector, no reference counting, no manual freeing, and in ordinary code no annotations. An escape checker proves at compile time that no reference outlives its memory.

  • A uniform grammar — Operators are ordinary identifiers rather than keywords baked into the grammar, so the language and its standard library share one small, regular syntax. An operation is read from left to right, the type of the value in hand saying what comes next; how strongly operators bind is stated by the standard library, not by the compiler.

Simple programs stay simple — a program is a file of statements, with nothing to declare and nothing to import — and the rest of the language is there when a program needs it.

A Language Still Changing

Scaly is below version 1.0, and it is still changing. Its syntax, its rules and its standard library move where something better is found — recently the assignment became :=, and the precedence table of the compiler gave way to the binding strengths the standard library declares. A version below 1.0 promises nothing about the next one.

What stays is a version that is out. A published toolchain and a published package do not change afterwards, so a program can go on using the ones it was written with: the toolchain by its number (Versions, updates, removal), a package by the version it declares (Versions, and what publishing means).