Developer preview v1.1.2 — installation, packaging, and some platform support are still in progress. Read the status
Skip to content

Standard library ​

The standard library is embedded in the compiler. It ships as .clo sources under stdlib/, so the generated C includes only the modules the program uses.

There are 43 modules: six core modules and 37 Amiga modules.

Core modules ​

ModulePurpose
std.ioConsole output, files, and byte streams
std.memBuffers, byte views, Array<T>, Box<T>, and allocation
std.textString, string views, conversion, and NUL-terminated views
std.fmtHex and numeric formatting
std.mathInteger and floating-point helpers, trigonometry
std.iffIFF parsing and writing

Amiga modules ​

Core OS surface ​

ModulePurpose
std.amiga.customCustom chip registers and per-chip wrappers
std.amiga.dosFiles, directories, paths, delays, and volume information
std.amiga.execTasks, ports, messages, libraries, and worker tasks
std.amiga.graphicsScreens, drawing, colours, and rastports
std.amiga.inputMouse, keyboard, and joystick input
std.amiga.interruptInterrupt handlers and servers
std.amiga.intuitionScreens, windows, gadgets, menus, and requesters
std.amiga.layersLayers and clipping
std.amiga.spriteHardware sprites and collision
std.amiga.textTopaz fonts and text rendering
std.amiga.timerTimer devices and delays
std.amiga.videoChip memory, bitmaps, blitter, copper, and displays

Advanced and optional services ​

ModulePurpose
std.amiga.workbenchAppIcons, AppMessages, and Workbench startup
std.amiga.iconIcon and disk-object handling
std.amiga.expansionExpansion board information
std.amiga.argsArgument parsing
std.amiga.aslASL file and font requesters
std.amiga.audioAudio channels and sample playback
std.amiga.boopsiBOOPSI classes and objects
std.amiga.bsdsocketTCP/IP sockets through a third-party stack
std.amiga.clipboardClipboard device access
std.amiga.commoditiesCommodities broker and hotkeys
std.amiga.datatypesDatatypes library
std.amiga.devicesDevice opening and I/O
std.amiga.eclockElapsed-time clock
std.amiga.gadtoolsGadTools gadgets
std.amiga.amigaguideAmigaGuide documents
std.amiga.arexxARexx message ports
std.amiga.ilbmILBM image loading
std.amiga.localeLocale and language information
std.amiga.lowlevelLow-level library access
std.amiga.nonvolatileNonvolatile storage
std.amiga.picasso96Picasso96 RTG surfaces
std.amiga.poolMemory pools
std.amiga.regionsRegions and clipping
std.amiga.semaphoreSemaphores and mutual exclusion
std.amiga.utilityUtility library helpers

Profile availability ​

Module grouphosthosted-amiga-13hosted-amigafreestanding
std.io, std.mem, std.text, std.fmt, std.math, std.iffYesYes, except heap-dependent APIsYesConsole subset; no heap
Core Amiga modulesNoYesYesNo
workbench, icon, expansionNoNo (E11200)YesNo
Optional servicesNoSelectivelyYes, where the tracked gate proves the surfaceNo

The exact API surface is in spec/appendix-stdlib.md. The source of each module is under stdlib/.

Importing ​

clorraine
import { println } from std.io;
import { String, stringOf } from std.text;
import { setColor } from std.amiga.custom;

Imports are explicit. The compiler resolves the module from the embedded library, and the generated C includes only what the program reaches.

Generating API documentation ​

clorraine --doc renders /// comments from Clorraine sources as linked Markdown. It works on your sources as well as the standard library:

sh
clorraine --doc -o build/api examples/hello/hello.clo

The output directory contains one Markdown page per module plus an index.

Clorraine is an independent project. Amiga, AmigaOS, Kickstart, and Workbench are trademarks of Amiga Corporation. Not affiliated with or endorsed by Amiga Corporation or Hyperion Entertainment.