What a spec is
You will learn
What goes into a .t27 file and what the compiler gives back for it.
A spec is a plain text file that ends in .t27. It opens with a module line, declares values and functions, and carries test blocks that check them. The compiler, t27c, reads the file and answers with a verdict and code for 7 backends. The spec under this lesson has 2 constants and 1 test, and the site compiles it in your browser.
Try it
Open the lesson spec in the player and find its three parts: the module line, the constants, the test.

A table of the parts of a .t27 file and a diagram of what t27c gives back for it. Lesson 1 of the t27 basics course.
specs/basics/01_what_a_spec_is.t27
// SPDX-License-Identifier: Apache-2.0
; t27 basics, lesson 1: What a spec is.
; A spec is one .t27 file: a module line, named values, and tests that check them.
module basics_01_what_a_spec_is;
pub const SIDES : u8 = 3;
pub const CORNERS : u8 = 3;
test a_triangle_has_as_many_corners_as_sides {
assert SIDES == 3;
assert CORNERS == SIDES;
}
All lessons
Module 1 · A spec file
What a .t27 file holds: a module line, prose lines and comments.
Module 2 · Values and types
Constants, the width of a whole number, and true, false and text.
Module 3 · Arrays, trits and expressions
Lists of values, the three values of a trit, and what operators compute.
Module 4 · Tests and functions
A test block, several small tests in one spec, and a function with typed inputs.
Module 5 · Inside a function
Names with let and var, choices with if and switch, and loops.
Module 6 · Visibility and your own types
What pub shares with other modules, and the structs and enums you declare.
Module 7 · Modules, rules and gen-ts
Reading another module, stating a rule that always holds, and a spec turned into TypeScript.
Module 8 · The compiler and tri
The backends t27c writes, the stages it reads a spec in, and the tri command.
Module 9 · Errors, a program, what next
Reading a compiler error, one small complete program, and the course to take next.