sparkles:base is the shared foundation for Sparkles libraries: small
allocation-conscious buffers, recycled Error storage for @nogc code,
text readers/writers, terminal styling, styled Interpolated Expression
Sequences, and the core logging interface.
Use it when a package needs low-level building blocks without depending on
the higher-level sparkles:core-cli UI and argument-parsing modules.
import sparkles.base.buffer : UniqueBuffer;
import sparkles.base.text.writers : writeIntegerPadded;
UniqueBuffer!(char, 16) buf;
writeIntegerPadded(buf, 7, 3);
assert(buf[] == "007");These docs follow the Diátaxis framework.
Learning-oriented. Build one small program using the buffer, text writer, styled text, and logger primitives.
Task-oriented. Short recipes for common jobs.
- Log through
CoreLogger - Write
@nogctext - Style templates with IES
- Pretty-print values
- Parse text with readers
- Analyze Unicode text without allocation
- Own a heap value without the collector
- Test
@nogccode with check helpers
Information-oriented. Lookup material for modules and symbols.
Understanding-oriented. Why base exists as a separate package.