Skip to main content

The repository

Everything about SG is kept in the open in one repository: the design, the code, the measurements and the background reading behind them.

The folders​

FolderWhat it holds
designThe language itself, on paper, and every choice made while building it, slice by slice
interpreterThe code, in Rust: checker, interpreter, C back end, tests, and the programs measured against C; its documents
benchmarksThe measurements: SG against C, Rust and Zig, where it is still slower, and how it is measured
trialsPrograms people write (grep, wc, ...) and the modules of the library in SG, Rust and Zig, measured against each other
topicsBackground: essays on C, Rust, Zig and Go, and on the problem SG sets out to solve
sourcesReading list: books, Hylo, Vale, Rust writings, tools
websiteThis site, built with Docusaurus
editorsThe extension for VS Code, which runs sg lsp
brandThe logo, its icons and how they are made; Pasha, the mascot, and Pasha's badge

The design documents​

If you read one, read decisions and open questions: the idea of the language, the principle every decision follows, and the way to the rest, every decision by topic with its reason and its cost, what is still open, and what comes next. The others:

DocumentWhat it holds
Decisions by topicThe rules of the language, each with its reason, one page for each part
Example programsTwelve programs written before there was a compiler, and the questions they raised
From Rust to SGWhat a Rust programmer writes and what SG writes for it, with how far each line is built
Syntax draftThe ownership notation, and the earlier drafts that were dropped
Memory modelThe first model (generation-checked pointers), kept for the record; it was dropped
RoadmapWhere to start when designing a language, the steps and the traps

The background essays​

Best read in order:

EssayWhat it holds
C and manual memoryWhy memory management was left to the developer
History of Rust ownershipThe roots of the idea, why it took 40 years, why C++ could not do it
ZigWhere it stands on safety, how long the move from C takes
Rust syntax and C#Where the noise comes from, the "second C++?" question
GoIts philosophy, its weak sides
Safe C attemptsFrom Cyclone to C3, the layers of pointer safety
Use-after-freeThe explicit error idea, why a simple table is not enough