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:
System libraries are available to all users on the machine. User libraries are private to your account and take precedence over system libraries of the same name.
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.