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

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

iczelia.net · 11 Jan

C · Programming Languages · Operating Systems

This project demonstrates a technical feat by creating a single 13 KiB polyglot binary that runs natively on Windows, Linux, and web browsers.

Inspired by cosmopolitan libc, the developer implemented a Snake game three times: in C using WinAPI for Windows, in C with X11 for Linux, and in JavaScript with HTML5 Canvas for the browser. The execution relies on clever file header manipulation; the Windows version uses a shell script stub within a PE header, Linux utilizes an lzma-compressed ELF dropper, and the browser version leverages HTML's tolerance for leading binary data. By concatenating these specialized payloads, the author produced a cross-platform executable that maintains a small footprint while providing consistent gameplay across diverse environments.

DOS Game "F-15 Strike Eagle II" reversing project needs DOS test pilots

neuviemeporte.github.io · 20 Jun

C · Software Architecture · Open Source

A hobbyist project to reverse engineer the 1989 game F-15 Strike Eagle II into C code has reached a major milestone.

With the core reconstruction completed, the developer is seeking community 'test pilots' to play the v0.9.1 release and report bugs, ensuring the port remains a functional, bug-for-bug recreation of the original classic software.

Fixing a 20-year-old bug in Enlightenment E16

iczelia.net · 15 Apr

C · Linux · Software Architecture

A developer fixed a long-standing infinite loop bug in the Enlightenment E16 window manager, which caused desktop freezes by incorrectly implementing Newton's method for text truncation.

The fix involved adding iteration limits and safety bounds to prevent oscillations, highlighting the resilience of maintaining mature, legacy software compared to modern supply chain risks.

3x speedup of DFlash2 for Inkling2m on llama.cpp (50 -> 150 on code tps)

github.com · 25 Nov

Artificial Intelligence · C · C++ · Large Language Models · Performance

A llama.cpp patch increases Inkling2m DFlash2 code speed from 51 to 158 tok/s by fixing drafter target activations and vocabulary handling.

It adds target visit metadata, supports selector soft-cap ordering, applies Inkling’s target RMS normalization when borrowing embeddings, and handles GGUF compatibility defaults. These changes raise acceptance from about 5 of 5,615 proposals and improve prose speed from 51.2 to 85.7 tok/s.

ClawDOS – An AI coding agent for DOS

ricapar.net · 21 Nov

Artificial Intelligence · CLI · C · Software Architecture · AI Agents

ClawDOS is an AI coding agent that runs on an IBM PC XT’s 8088 at 4.77 MHz with 640K RAM and CGA.

Its 176 KB HARNESS.EXE uses the Claude Messages API to read and edit files, compile and run Turbo C programs, inspect screenshots, and retain conversations and notes. The PC handles the agent loop and tools; a bridge machine provides TLS. The 13,000-line Open Watcom project includes 18 tools, safe mode, model switching, and DOS tests.

137B A6.8B model from Microsoft?

github.com · 15 Oct

Artificial Intelligence · C · C++ · Large Language Models · Machine Learning

llama.cpp adds native support for Microsoft’s Maion-Coder architecture (`general.architecture = maion-coder`).

The integration introduces model hyperparameters, tensors, graphs, architecture registration, NEOX rope, GGUF metadata, model saving for per-layer expert FFN sizes and MoE latent size, and a four-layer test covering dense/MoE layers, sliding-window/full attention, GQA, and non-uniform expert sizes. Loading fails early when required MoE or attention configuration is missing.

some C habits I employ for the modern day

unix.dog · 17 Jan

C · Programming Languages · Software Architecture

The author outlines modern development habits for C, highlighting that the language's lack of formal style standards often leads to error-prone code.

To improve robustness, the author recommends using C23 and defining explicit fixed-length types. Key practices include adopting a length-plus-data string structure to avoid null-terminator issues, applying the 'parse, don't validate' philosophy via opaque types for better API safety, and utilizing macro-based tuples for returning multiple values. The author also suggests implementing custom sum types using unions and booleans to handle errors more effectively, ultimately prioritizing type-system safety over common standard library patterns.

Building a Tiny 3D Renderer for a Tiny Handheld

saffroncr.itch.io · 22 Jul

C · Performance · Software Architecture

Developing a custom 3D software renderer for the Playdate handheld requires overcoming significant hardware limitations.

By leveraging BSP trees for visibility, custom dithering for 1-bit display, and aggressive CPU-level optimizations, the project successfully achieves playable real-time performance. This journey demonstrates that achieving functional results through incremental optimization is more effective than pursuing perfection.

llama.cpp support for Cohere models

github.com · 19 Oct

Artificial Intelligence · Computer Vision · C · C++ · Large Language Models

llama.cpp adds support for Cohere2 vision models, currently targeting CohereLabs/command-a-plus-05-2026-bf16.

The implementation includes Cohere2VisionModel and a Cohere2 vision image_preprocessor. Users convert the text model and multimodal projector to GGUF, then run llama-mtmd-cli with an image prompt; the example correctly describes a newspaper article about the Apollo 11 moon landing. The contribution reports AI use for code cleanup, testing, and review.

SDL Now Supports DOS

github.com · 24 Apr

C · Programming Languages · Software Architecture

SDL3 has added support for the DOS platform via DJGPP, enabling development for modern hardware and vintage systems.

The implementation includes VESA video, Sound Blaster audio, keyboard and mouse input, cooperative threading, and filesystem access. This comprehensive port enhances SDL3’s cross-platform capabilities, allowing applications to run in DOSBox or on legacy hardware.

llama.cpp: Add FP8 KV-cache

github.com · 11 Nov

Artificial Intelligence · C · C++ · Large Language Models · Machine Learning

llama.cpp adds support for OCP-FP8 KV-caches with optional runtime static per-tensor scales.

The implementation uses graph-level scaling and multiplication rather than modifying ggml_flash_attn_ext, aligning ownership with NVFP4/FP8 and enabling shared FP8 logic across flash attention and standard attention. End-to-end tests cover conversion, loading, context shifts, and correctness of scaled caches, including non-unit-scaled usage in NVIDIA’s Mistral-Medium-3.5-128B-NVFP4 model.

Epoll vs. io_uring in Linux

sibexi.co · 20 Jun

C · Linux · Programming Languages

This overview compares the Linux epoll and io_uring systems for asynchronous I/O.

While epoll relies on many syscalls for readiness notifications, io_uring uses shared memory ring buffers for completions, significantly reducing syscall overhead. For modern Linux kernels, io_uring is now the preferred standard for high-performance I/O, offering advanced features like zero-copy and batch processing.

I write games in C (yes, C)

jonathanwhiting.com · 7 Feb

C · C++ · Programming Languages

In this personal reflection on software development, the author explains their unconventional choice of using vanilla C for independent game development.

Despite the dominance of C++, C#, and modern engines, the author prioritizes reliability, long-term availability, and extreme simplicity. They argue that C offers unmatched portability across operating systems and consoles while maintaining high performance and exceptionally fast compilation speeds, which is crucial for maintaining developer focus. The author critiques C++ for its overwhelming complexity and slow build times, and rejects OOP-heavy languages like Java and C# due to their rigid data-code coupling. While acknowledging that C is 'a sharp knife' that requires careful handling, the author concludes that its stability and extensive tooling make it the most sustainable choice for their creative workflow, ensuring their games remain playable and maintainable for decades to come without being tethered to fleeting technologies like Flash.

antirez/c64-hw-simulator

github.com · 15 Oct

C · Hardware · Low-Level Programming

c64-hw-sim is a pin-level simulator of the Commodore 64 ASSY 250407 motherboard, modeling 216 parts and 249 nets so users can remove chips, lift pins, short signals, or open components and observe computed hardware behavior.

It supports graphical and headless operation, .prg loading, fault timing, probing, and oscilloscope views. Cycle-accurate chip cores and real PLA equations improve fidelity, but full-board simulation runs at roughly 31–48% of real speed and omits several analog effects and internal chip faults.

Zig's Io.Threaded is Neat

matklad.github.io · 6 Aug

C · Distributed Systems · Programming Languages

Zig's std.Io.Threaded offers a unique approach to concurrency by enabling reliable cancellation of blocking syscalls using signals on POSIX and NtCancelSynchronousIoFile on Windows.

By integrating cancellation directly into the language's error management, Zig overcomes limitations found in traditional thread-based models, providing a cleaner alternative to complex IO interfaces like io_uring while maintaining efficient thread pooling.

WriteUp: 16 Bytes of x86 that turn Matrix rain into sound

hellmood.111mb.de · 17 May

C · Low-Level Programming · Programming Languages

Presented at the 2026 Outline Demoparty, this 16-byte x86 assembly routine performs algorithmic art in DOS.

By XORing video memory to generate a Sierpinski fractal, the code simultaneously renders visual patterns and produces audio via the PC speaker. The project demonstrates extreme memory efficiency and the interplay between mathematical sequences, display hardware, and low-level system design.

Introduction to Nintendo DS Programming

patater.com · 8 Apr

C · C++ · Open Source

This manual provides a comprehensive introduction to Nintendo DS homebrew game development.

It covers essential programming topics including hardware architecture, graphics engines, sprite management, input handling, and sound integration using C and C++ with the libnds library. It also explores the legal context and evolution of homebrew hardware development.

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