πŸ–¨οΈ {fmt} β€” The C++ formatting library that should have existed from the start

Every C++ developer knows the pain.

`printf` is fast but unsafe β€” wrong format string, undefined behavior. `std::cout` is safe but verbose and slow. For decades there was no good middle ground. πŸ’€

πŸ“¦ Header-only & drop-in simple
One header, done. No build system changes, no heavy dependencies. No coincidence β€” spdlog uses {fmt} under the hood.

fmt::print("Connection from {} on port {}", ip, port);

Readable. Clean. No << chaos.

⚑ Faster than printf
Sounds too good to be true β€” but it's benchmarked. {fmt} beats printf in most cases because it knows more about types at compile time and decides less at runtime.

πŸ›‘οΈ Type-safe & compile-time checks
The real game changer:

fmt::print("{} {}", name); // ❌ Compile Error β€” argument missing

With printf that would have been silent undefined behavior. With {fmt} it breaks at compile time. Exactly where errors should be caught.

πŸ”— The red thread to C++20
{fmt} became so good it served as the blueprint for std::format in C++20. Using {fmt} today means learning the future of the C++ standard library at the same time.

🐧 printf was yesterday. cout is verbose. {fmt} is what C++ formatting should have always been.

#Cpp #Linux #SystemsProgramming #OpenSource

πŸ” Been looking into hardening Unix Domain Sockets on Linux lately – here are some takeaways.

πŸ›‘οΈ Filesystem permissions: don’t rely on chmod on the socket file alone – some systems silently ignore it (hello SELinux). Protect the directory it lives in with 0750 and watch out for umask when calling bind() – it silently masks your intended permissions. Set umask before bind(), not chmod after.

πŸ” Peer authentication: SO_PEERCRED after accept() gives you the PID, UID and GID of the connecting process, verified by the kernel. But it only captures credentials at connect() time – if the peer changes identity later, you won’t see it.

πŸ“¨ Per-message auth: SCM_CREDENTIALS via sendmsg/recvmsg solves that. The kernel verifies the credentials on every message, even if the sender tries to lie. Essential when processes switch identity during their lifetime.

⚑ SOCK_SEQPACKET instead of SOCK_STREAM is worth considering. You get atomic message boundaries from the kernel – no custom framing, no partial reads, no glued-together messages.

🚦 Rate limiting unfortunately has to happen in userspace – the kernel offers nothing useful for per-peer UDS rate limiting. A simple token bucket per connection does the job.

Anyone else spent time hardening UDS? Curious what else people do beyond the basics.

#Linux #UnixDomainSockets #Security #SystemsProgramming #IPC #Infosec

Explore the Wild West of post-POSIX IO Interfaces with Anil Madhavapeddy! A lively VMIL'25 talk about new IO abstractions, performance, and systems design - perfect for OS devs, researchers, and curious programmers. Tune in! #VMIL25 #POSIX #IO #SystemsProgramming #OperatingSystems #AnilMadhavapeddy #English #TechTalk
https://crank.recoil.org/videos/watch/323e1d45-3cf6-4554-9d96-db730c3df8a7
[VMIL'25] The Wild West of post-POSIX IO Interfaces

PeerTube

Why Rust for the runtime?

- Portable (runs anywhere)
- Strongly typed
- Predictable under concurrency
- Safe to embed
- Fast enough to sit in the middle

Basically: "I want this to run everywhere and not explode"

#rustlang #systemsprogramming

The Cost of Indirection in Rust

Why 'indirection has a cost' is usually the wrong reason to inline and what actually costs you.

Selective Creativity
Rust 1.94.0 Released with Array Windows and Cargo Improvements

Rust 1.94.0 introduces array_windows for slices, Cargo config inclusion, TOML 1.1 support in Cargo, and stabilized APIs in const contexts.

TechLife
Deep dive into k-CAS: Vesa Karvonen breaks down sweat-free techniques for concurrent, lock-free programming with clear slides and full speaker notes β€” perfect for systems engineers and PL enthusiasts. Enlightening and practical! #kCAS #Concurrency #LockFree #ParallelComputing #SystemsProgramming #ProgrammingLanguages #VesaKarvonen #Tarides #English
https://watch.ocaml.org/videos/watch/acebc363-12df-4cd6-aec0-e8239ab325e0
k-CAS for sweat-free concurrent programming by Vesa Karvonen

PeerTube

Ruby provides a powerful interface for building native extensions, allowing Ruby code to call C functions directly.

The article walks through:

β€’ the structure of a Ruby C extension
β€’ compiling with extconf.rb
β€’ argument conversion between Ruby and C
β€’ wrapping native structures
β€’ using Rust as an alternative for building extensions

Includes practical code examples for building your first native Ruby binding.

https://rubystacknews.com/2026/03/04/writing-ruby-bindings-for-c-libraries/

#ruby #systemsprogramming #opensource

Writing Ruby Bindings for C Libraries

Writing Ruby Bindings for C Libraries March 4, 2026 Building Native Extensions with C (and Rust) Ruby is known for its productivity and elegant syntax, but sometimes performance-critical tasks requ…

Linking Ruby knowledge from the most remote places in the world.

Design goals:

- Zero friction: header-only, self-compiling C scripts, one-line install
- Safety + liveness: invariants for "never" properties, goals for "eventually" properties
- Multi-path verification: `FROM`/`TO` macros to check reachability from arbitrary states
- Sanitizer support: ASan + UBSan enabled with a single flag

Ideal for protocols, state machines, synchronization logic, anything where exhaustive verification is tractable.

GPLv3. Feedback and contributions welcome.

πŸ”— codeberg.org/cdsoft/benelos

#C #ModelChecking #FormalMethods #EmbeddedSystems #OpenSource #SystemsProgramming

@cstross @alex_p_roe @timo21

Amusing aside on that score:

I looked at Lynx's vaunted 1991-patented interrupt handling for #LynxOS.

There's prior art for it in the forms of KMOS, an operating system used for teaching purposes by Milan Milenković (who published a book on operating systems in 1987 describing kernel-task-based interrupt handling), and indeed in #Minix too.

#OperatingSystems #KMOS #MessagePassing #SystemsProgramming #RTOS