plstd is the official standard library for C△. Unlike C and C++ where you juggle .h headers, preprocessor guards, and separate implementation files, every plstd library lives in a single .plib file written entirely in C△ — the same language you write your own code in. A .plib file is complete and self-contained: no header-implementation split, no separate preprocessor pass, just C△ code that can use every language feature including dynam arrays, typed struct inheritance, and asm blocks for low-level operations.
What’s in plstd
Output
printd and printfs — type-aware single-value printing and formatted output with f-string interpolation and %-style specifiers.Strings
strcmp, strcpy, strcat, strlen, strdup, strchr, strstr, strncpy, strncat, strncmp — a full suite of string operations built on top of C△‘s first-class string type.File I/O
The
streamer library provides file read/write operations for portable I/O across supported platforms.Architecture-Aware
plstd uses conditional compilation to ship optimized implementations for x86_64 Linux and ARM64 macOS. The compiler picks the right path automatically — you never need to think about it.
Importing plstd
You can import plstd at any level of granularity — pull in everything, cherry-pick individual functions, or skip imports entirely and let the compiler sort it out.Library Locations
When the Hypotenuse Compiler resolves a.plib import, it searches two locations in order:
| Location | Path | Purpose |
|---|---|---|
| System | /usr/lib/PLIBS/ | libraries, installed by make full-install |
| User | ~/.local/lib/PLIBS/ | libraries, fallback search path if privileges aren’t given |
Managing Libraries
Use thehypotenuse compiler driver to install or remove .plib files from your local library path.
hypotenuse -i installs into your user library path (~/.local/lib/PLIBS/) or /usr/lib/PLIBS/ if present.Writing Your Own Library
Creating a.plib library is no different from writing any other C△ code. Use the same .ctri syntax, leverage every C△ feature you need, and wrap your exports in a space (namespace) block to avoid name collisions with user code.
yourlib.plib
Can I use asm blocks in my library?
Can I use asm blocks in my library?
Yes. C△
asm blocks work inside .plib files just as they do in regular .ctri source files. Use #ifdef __x86_64__ and #ifdef __aarch64__ guards if you need architecture-specific paths.