Topic

C

C programming discussions covering systems programming, memory management, and embedded development. Our digest aggregates undefined behavior, compiler optimizations, and embedded systems from developer communities.

What this topic tracks

  • Language releases and proposals
  • Libraries, tooling, and ecosystem updates
  • Performance, idioms, and production lessons

C · 248 stories

Recent stories

Each story's summary, with the places it was discussed.

Summaries are written by AI from the linked sources. Open the source for full context.

20 stories

Diplomat: Multi-language FFI for Rust Libraries

manishearth.github.io · 14 Jun

C · C++ · Rust

Diplomat is a unidirectional FFI tool designed for Rust, enabling developers to expose libraries like ICU4X to multiple target languages through a single bridge layer.

It supports C, C++, JS, Dart, Kotlin, and Python, emphasizing idiomatic bindings, lifetime management, and extensive customization without requiring interface description languages.

But what about K?

tony-zorman.com · 7 Apr

C · Programming Languages · Software Architecture

The article explores the source code of ksimple, a compact K programming language interpreter.

It analyzes the C implementation, focusing on memory layout, reference counting, and the pervasive use of macros. The author highlights how the code, fitting on a single screen, uses a unique, compact design to handle array processing, verbs, and REPL functionality.

edgcpp/compiler

github.com · 30 Sept

C · C++ · Programming Languages

EDG Compiler Project is an open-source C/C++ compiler centered on a highly compatible, configurable EDG front end with extensive documentation and bug emulation across Clang, GCC, and MSVC.

It also provides C and C++ back ends, a prelinker, minimal runtime support, intermediate-language tools, a name demangler, and development utilities.

Relying on Go

antonz.org · 9 Aug

C · Go · Programming Languages

Solod is a systems programming language that functions as a subset of Go, designed for C and Go developers.

It leverages existing Go tooling and standard library code while transpiling to C11, emphasizing manual memory management without a runtime. By reusing established ecosystems instead of building a new one, Solod aims for reliability and simplicity.

Iterating Backwards in C

davidpriver.com · 26 Oct

C

In C, iterate backward through a size_t buffer with `for (size_t i = count; i--; )`, not `i >= 0` or a signed index.

Since postdecrement tests the old value, the loop body receives valid indices from count - 1 to 0 and stops when the old value is zero, including safely when count is 0. This avoids unsigned-condition bugs, signed-conversion issues, portability problems with `ssize_t`, and unnecessary loop complexity.

Solod: Go can be a better C

antonz.org · 21 Mar

C · Low-Level Programming · Programming Languages

Solod is a systems programming language that functions as a strict subset of Go, transpiling directly to readable C11 code.

It eliminates hidden memory allocations and garbage collection, favoring stack allocation and manual memory management. Designed for native C interop, it retains familiar Go syntax and tooling while providing control and performance reminiscent of C.

cloudflare/quiche

github.com · 21 Sept

C · C++ · Rust

Cloudflare’s quiche is an open-source Rust implementation of QUIC and HTTP/3, offering low-level packet, connection, timer, pacing, and stream APIs.

Applications provide I/O and event loops. It includes an HTTP/3 module, C/C++ FFI, command-line tools, and build support for Linux, Android, iOS, and Docker, with integrations across Cloudflare, Android, and curl.

Arena Allocators in C

eliasebner.com · 11 Oct

C · Low-Level Programming · Education

Arena allocators simplify and accelerate memory management in C by grouping allocations with similar lifetimes into large regions that are freed or reset together.

The implementation uses an arena containing data, size, and used fields, with aligned allocation, optional reallocation by copying, and clear/free operations. Passing an arena explicitly makes allocation visible to callers and lets them choose the memory’s lifetime, reducing individual malloc/free calls and leak risks; a string-conversion example demonstrates the pattern.

MotifCentral - All Things Motif/Xt/Xlib

motif-central.org · 29 Sept

C · Software Architecture · UI

MotifCentral is a resource hub for Motif, Xt, Xlib, and X11, explaining their layered architecture and programming model.

It offers tutorials for building C applications, widget and X resources guidance, library history, manuals, books, archives, and projects including CDE, window managers, XNEdit, XFile, and preservation initiatives.

a bunch of stuff i used to not know about K&R C

sebsite.pw · 12 Jul

C · History · Computer Science

This research analyzes early 'pre-ANSI' C, examining the language's evolution from its K&R roots to the ANSI C standard.

It details idiosyncrasies like the lack of 'void', different integer promotion rules, and the emergence of 'value-preserving' conventions. The analysis explores historical compiler limitations, including the pre-standard preprocessor, missing keywords, and the origins of modern C features.

Dependency Tracking is Hard

daniel.haxx.se · 10 Mar

C · Operating Systems · Open Source

curl and libcurl face recognition challenges in modern dependency tracking because they do not belong to common ecosystems like npm or PyPI.

This exclusion impacts PURLs and SBOM accuracy, as scanners often miss these low-level C components. Consequently, the vast scale of their global usage remains largely invisible in digital dependency graphs.

The little bool of doom

blog.svgames.pl · 9 Feb

C · Linux · Programming Languages

In this technical deep dive, the author explores a compilation failure of chocolate-doom during the Fedora Linux 42 mass rebuild.

The issue stems from the transition to the C23 standard, where 'false' and 'true' became keywords, clashing with the engine's custom boolean enum. Upon attempting to fix this by using the standard C99 _Bool type, the engine suffered a logical failure during sprite initialization. Investigation revealed that the engine relied on 'memset' to initialize memory to -1. While an enum comparison would check if the value equals 0, the _Bool optimization in GCC results in logic where a value of 255 (from -1) is treated as both true and false simultaneously. This behavior is identified as Undefined Behaviour under the C99 standard, specifically regarding invalid object representations of boolean types.

Ariel OS is a library operating system for secure, memory-safe, low-power Internet of Things, written in Rust

github.com · 28 Jan

C · Rust · Operating Systems

Ariel OS is an innovative operating system designed specifically for the secure, memory-safe, and low-power Internet of Things ecosystem.

Built from the ground up using Rust, it targets 32-bit microcontroller architectures including Cortex-M, RISC-V, and Xtensa. By integrating established crates like Embassy and esp-hal, Ariel OS bridge the gap between individual building blocks and a fully integrated development experience similar to RIOT or Zephyr. It introduces key features such as a preemptive multicore scheduler, portable peripheral APIs, and the laze meta-build system to reduce boilerplate. This 'batteries-included' framework empowers developers to create portable, high-performance embedded applications while maintaining rigorous security standards and memory safety through the Rust ecosystem.

GOTO Considered Totally Sick (for error handling in C)

thestateofinahaze.net · 28 Oct

C · Low-Level Programming

Centralized cleanup with a forward `goto` can provide C with a practical analogue to `defer`/`errdefer`.

Instead of duplicating resource-release logic across error branches, the function jumps to one cleanup label that frees all successfully allocated resources, using initialized pointers and optional multiple labels for partial cleanup. The approach improves readability and reduces maintenance bugs; it is also documented in the Linux kernel coding style guide. The author additionally notes using `calloc` when allocation-size multiplication might overflow.

Performance improvements in libffi

atgreen.github.io · 20 Jun

C · Low-Level Programming · Performance

libffi introduces a new 'plan' API to optimize function calls by pre-calculating argument placement, replacing costly runtime re-classification with a flat bytecode list.

This avoids JIT compilation, maintaining security while achieving a 6x speed increase over standard ffi_call. Notably, high-frequency call patterns like those in GNOME Shell benefit significantly from this approach.

Boot Naked Linux

nick.zoic.org · 15 Jun

C · Linux · Low-Level Programming

The author explores creating a minimalist Linux boot process by replacing the standard init system with a custom C program.

Using QEMU and a custom kernel, the project achieves near-instant boot times by stripping down the kernel and initrd, demonstrating how to interface with hardware without traditional distros.

Parse, Don’t Validate AKA Some C Safety Tips

lelanthran.com · 22 Feb

Cybersecurity · C · Software Architecture

This guide explains the 'Parse, Don't Validate' technique in C to enhance software security.

By converting untrusted input into opaque types at system boundaries, developers can leverage C's type safety to prevent logic errors, parameter swapping, and common vulnerabilities, ensuring that internal functions only process pre-verified, structured data.

Branches in branch-free code

00f.net · 8 Oct

Cybersecurity · C · Low-Level Programming

Compilers can introduce conditional branches into source code intended to be branch-free, creating side channels in constant-time arithmetic.

On RV32, clang and Zig compile 128-bit carry propagation and bit-mask selection with branches; RV64 still branches for selection, while other targets vary. GCC 16 avoids some RISC-V branches but branches when masks derive from comparisons. Register barriers can help selection, but are unreliable for addition. RISC-V’s Zicond removes these branches, though data-independent timing also requires Zkt; explicit word-level carries are safer.

Twenty-two pending curl vulnerabilities

daniel.haxx.se · 7 Oct

CLI · Cybersecurity · C

curl will release version 8.23.0 on October 14, 2026, earlier than planned, fixing 22 security vulnerabilities.

The key issue is CVE-2026-92392, curl’s second HIGH-severity CVE since 2021, whose details will remain confidential until release to protect users and infrastructure. curl will notify distros@openwall and paying support customers in advance, publish updated Rock-solid curl versions, and disclose technical details afterward.

Where it came fromLobstersHacker NewsGitHubCreate a Snapbyte.dev digest and choose C as one of your topics.Build your digest