A modern, type-safe replacement for C's standard library — no format strings, no buffer overflows, no undefined behavior. Ships with safe I/O, native string types, and terminal colors. HTTP, process control, and CLI utilities coming soon.
Open-source engineers bringing memory safety to C.
stdio.h vs ns.hWhy modern C deserves a better standard library.
| Feature | <stdio.h> / <string.h> |
ns.h |
|---|---|---|
| Type Safety | ✗ None Relies entirely on developer memory. |
✓ Compile-Time
Automatic routing via C11 _Generic.
|
| Format Specifiers |
✗ Required
%d, %s, %f — segfaults if mismatched.
|
✓ Not Needed Just pass the variable directly. |
| String Memory |
✗ Unsafe
Null-terminated char*. O(N) length, overflow risk.
|
✓ SSO Small String Optimization. Zero heap fragmentation. |
| Input Handling |
✗ Dangerous
scanf leaves dangling newlines, crashes on bad types.
|
✓ Safe
ns_read safely defaults to 0 on invalid input.
|
| Backend | Legacy C code. | ✓ Rust Mathematically memory-safe. |
Questions, contributions, or ideas? We'd love to hear from you.