Skip to main content
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.
// Import everything from plstd
using <plstd>;

// Import a specific function — this rewrites the library name in the
// current file from `plstd` to `printd`. Only `printd` is in scope.
using printd from <plstd>;

// Globalize symbols so you can call them unqualified (e.g. `printd(...)`).
// `expose` takes the current library name. After `using <plstd>` that's
// `plstd`; after `using printd from <plstd>` it's `printd`.
expose plstd;       // after `using <plstd>;`
expose printd;      // after `using printd from <plstd>;`

// Explicit namespace access without exposing — use this when you haven't
// run `expose`. The namespace is whatever the current library name is.
printd@plstd("value: %d\n", 42);   // after `using <plstd>;`
printd@printd("value: %d\n", 42);  // after `using printd from <plstd>;`
The compiler automatically imports any plstd symbol you use in your code. You still must reference a function properly, either by exposing it or by utilizing ’@’.

Library Locations

When the Hypotenuse Compiler resolves a .plib import, it searches two locations in order:
LocationPathPurpose
System/usr/lib/PLIBS/libraries, installed by make full-install
User~/.local/lib/PLIBS/libraries, fallback search path if privileges aren’t given
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 the hypotenuse compiler driver to install or remove .plib files from your local library path.
# Install a library to PLIBS
hypotenuse -i mylib.plib

# Remove a library from PLIBS
hypotenuse -r mylib
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
space mylib {
    int add(int a, int b) {
        return a + b;
    }
}
Once you’ve written your library, install it and import it like any other plstd module:
// After running: hypotenuse -i yourlib.plib

// Import the whole library
using <yourlib>;

// Or import a single symbol
using add from "yourlib";

// Or access explicitly with the namespace operator
int result = add@mylib(3, 4);
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.