Hacker News with Generative AI: C

Julia: C codegen considered unnecessary: go directly to binary, do not pass C (arxiv.org)
Since time immemorial an old adage has always seemed to ring true: you cannot use a high-level productive programming language like Python or R for real-time control and embedded-systems programming, you must rewrite your program in C.
F8 – an 8 bit architecture designed for C and memory efficiency [video] (fosdem.org)
Even in modern devices, 8-bit processors are found, but the architectures used are often not well-suited to programming in high-level languages, such as C. E.g. MCS-51 (8051, 8052) based microcontrollers in the Realtek WiFi chipsets. The f8 is an architecture based on the experience and lessons learned from maintaining Small Device C Compiler (SDCC) and the many 8-bit architectures it supports.
Type safe variadic printf (stranger.systems)
While C can provide "convenient" string formatting by having hideously unsafe variadics, and dynamic languages, like python, can do the same, many type safe languages, such as Rust, are forced to provide such functionality through the use of a macro. Dependently typed languages, like Idris, can provide a printf like formatting interface, while maintaining both memory and type safety, without the need for macros. We will explore this by implementing a simplified version of printf in Idris from scratch.
Zig; what I think after months of using it (strongly-typed-thoughts.net)
Ah, Zig. I have a love-hate relationship with this one. A “new” (reading: appeared a couple years ago, already — yes, already), language with high ambitions. Zig was made to run at low-level, with a simple design to solve many problems C has (macros, allocators, error handling, more powerful types like baked-in tagged unions and bitsets, a better build system, no hidden control flow, etc.).
No-Panic Rust: A Nice Technique for Systems Programming (reverberate.org)
Can Rust replace C? This is a question that has been on my mind for many years, as I created and now am tech lead for upb, a C library for Protocol Buffers. There is an understandable push to bring memory safety to all parts of the software stack, and this would suggest a port of upb to Rust.
I Wrote a WebAssembly VM in C (irreducible.io)
For the last 6 months, I’ve been spending my (limited) free time on evenings and weekends writing a WebAssembly VM in C.
C is not suited to SIMD (2019) (vmchale.com)
C (C++) is used to write performant software, however it is ill-suited to SIMD. In particular, its compilation of stepped reduction with lexical scoping opposes parallel execution.
C stdlib isn't threadsafe and even safe Rust didn't save us (edgedb.com)
We’re in the process of porting a significant portion of the network I/O code in EdgeDB from Python to Rust, and we’ve been learning a lot of very interesting lessons in the process.
A Minimalist TypeScript for C (ycombinator.com)
A Minimalist TypeScript for C. Cp1, or C+1, or C plus 1 programming language adds only the bare essentials to C language that allows you to output C codes and able to use namespaces, modules, methods on enums/structs, auto variable deduction and more.
I wrote a commercial game in C in 2025 (cowleyforniastudios.com)
For the last few years we’ve been working on a train management game, Iron Roads, which we released to Early Access today. Somewhat atypically for a game releasing in 2025, Iron Roads is written in pure C, not C++, pure C99. As a choice it has had its ups and downs, which I wanted to share in this post.
An effect system proposal for C2y (open-std.org)
In this discussion proposal we suggest that C would be improved by extending the core type system into a type and effect system, that forces functions and blocks to declare which classes of effects will result from their evaluation.
Agon Light C Development (ncot.uk)
How to write code for the Agon Light (and Console8) using C instead of BASIC, under Linux. It might work with WSL2 in Windows, and it might work on a Mac.
Reading files the hard way – Part 1 (Node.js, C, rust, strace) (fasterthanli.me)
Everybody knows how to use files. You just open up File Explorer, the Finder, or a File Manager, and bam - it's chock-full of files. There's folders and files as far as the eye can see. It's a genuine filapalooza. I have never once heard someone complain there were not enough files on their computer.
Understanding Memory Management, Part 1: C (educatedguesswork.org)
I've been writing a lot of Rust recently, and as anyone who has learned Rust can tell you, a huge part of the process of learning Rust is learning to work within its restrictive memory model, which forbids many operations that would be perfectly legal in either a systems programming language like C/C++ or a more dynamic language like Python or JavaScript. That got me thinking about what was really happening and what invariants Rust was trying to enforce.
Obvious things C should do (digitalmars.com)
Standard C undergoes regular improvements, now at C23. But there are baffling things that have not been fixed at all. The Dlang community embedded a C compiler in the D programming language compiler so it could compile C. This C compiler (aka ImportC) was built from scratch. It provided the opportunity to use modern compiler technology to fix those shortcomings. Why doesn’t Standard C fix them?
C: Simple Defer, Ready to Use (wordpress.com)
With this post I will concentrate on the here and now: how to use C’s future lifesaving defer feature with existing tools and compilers.
Ask HN: Why do/don't you use C? (ycombinator.com)
I've been having a blast writing projects in C lately (emulator, raycaster) and using it extensively for a game engine I'm making.
Writing a simple pool allocator in C (8dcc.github.io)
I found out about pool allocators some time ago, and I really liked its simplicity and high performance, so I decided to write my own. This article was initially inspired by Dmitry Soshnikov’s article.
Boffins carve up C so code can be converted to Rust (theregister.com)
Computer scientists affiliated with France's Inria and Microsoft have devised a way to automatically turn a subset of C code into safe Rust code, in an effort to meet the growing demand for memory safety.
Syzygy: Dual Code-Test C to Rust Translation Using LLMs and Dynamic Analysis (arxiv.org)
Despite extensive usage in high-performance, low-level systems programming applications, C is susceptible to vulnerabilities due to manual memory management and unsafe pointer operations.
Write a Shell in C (2015) (brennan.io)
It’s easy to view yourself as “not a real programmer.” There are programs out there that everyone uses, and it’s easy to put their developers on a pedestal. Although developing large software projects isn’t easy, many times the basic idea of that software is quite simple. Implementing it yourself is a fun way to show that you have what it takes to be a real programmer.
Train a Mnist VAE with C and CUDA (github.com/ggerganov)
Hi, I just want to share what I have been working on recently. This is an example of training a MNIST VAE. The goal is to use only ggml pipeline and its implementation of ADAM optimizer.
Compiling C to Safe Rust, Formalized (arxiv.org)
The popularity of the Rust language continues to explode; yet, many critical codebases remain authored in C, and cannot be realistically rewritten by hand. Automatically translating C to Rust is thus an appealing course of action.
Fixing C Strings (thasso.xyz)
It’s well-known that null-terminated C strings are bug-prone and unsafe to use. They’re the stereotypical footgun. I’ve been tinkering in a bare-metal environment recently, writing all code myself, including the common types and routines you find in libc or similar. In all the code I wrote, there is not at single null-terminated string, and I have yet to encounter a bug related to bounds checking on strings or buffers.
Show HN: Non-backtracking, Unicode aware regular expression library in C89 (github.com/mnurzia)
Compact, non-backtracking, unicode aware regular expressions in C89
Show HN: I built an embeddable Unicode library with MISRA C conformance (railgunlabs.com)
Embeddable Unicode® algorithms.
C has its limits. If you know where to look (subethasoftware.com)
Thank you, Bing Copilot (ChatGPT), for giving me another “thing I just learned” to blog about.
Is this the weirdest thing in C? (wordpress.com)
There are many weird things in C. So many that it is one of the reasons why C can be a challenging language for novice programmers. But what is the weirdest? Well in my experience, the weirdest things in C all have to do with pointers, but the weirdest one may be x[i] == i[x].
Show HN: A portable hash map in C (github.com/e-dant)
A small, portable, linear-probing hash map in C.
Ask HN: Best dev environment for C in 2024? (ycombinator.com)
Accepting suggestions about anything: IDEs, compilers, editors, editor extensions, etc.