Hacker News with Generative AI: C

Detecting if an expression is constant in C (nrk.neocities.org)
Here's a fun little language puzzle: implement a macro that takes an expression as an argument and:
Show HN: I rewrote few of the common core string.h functions (github.com/deep-vinci)
learning and re-implementing c functions
Show HN: Essentials-C – A minimal C library for string and array manipulation (github.com/oileo)
Essentials-C is a simple yet useful collection of utility functions written in C. It provides helpful string manipulation functions that can make handling C strings more intuitive. This library is open-source under the MIT license, so feel free to use and modify it. Just don't forget to credit the author! 😆
Rust to C compiler – 95.9% test pass rate, odd platforms (fractalfir.github.io)
This is an update on the progress I have made on my Rust to C compiler. I am experimenting a bit with a new article format: instead of an overarching theme, this is more of a collection of smaller bits and pieces, sewn together.
An Educational Parallel Algorithm Collection (github.com/s-hironobu)
This is a parallel algorithm collection written in C. It contains fifteen programs that are explained in the book "The Art of Multiprocessor Programming (M. Herlihy, N. Shavit)".
A compiler for the Micron programming language – the Oberon with the power of C (github.com/rochus-keller)
This project implements a compiler for the Micron programming language.
Writing C for Curl (haxx.se)
It is a somewhat common question to me: how do we write C in curl to make it safe and secure for billions of installations? Some precautions we take and decisions we make. There is no silver bullet, just guidelines. As I think you can see for yourself below they are also neither strange nor surprising.
Make C string literals const? (wordpress.com)
Martin Uecker has started a new initiative to ensure a better const contract for C2y: change the type of string literals to a const-qualified base type, much as it is already the case in C++. Compilers support this since a very long time; some of them have this as default, some provide command line switches for that model.
Understanding Memory Management, Part 4: Rust Ownership and Borrowing (educatedguesswork.org)
This is the fourth post in my planned multipart series on memory management. Part I covers the basics of memory allocation and how it works in C, and parts II and III covered the basics of C++ memory management, including RAII and smart pointers.
Why is this site built with C (marcelofern.com)
Learning from these two past mistakes, I came up with a set of requirements for my next (and hopefully final) website:
Writing a Bash builtin in C to parse INI configs (mbuki-mvuki.org)
Shell languages such as Bash excel at certain tasks, such as gluing programs together or quickly automating a set of command line steps. In contrast to those strengths, using a Shell to parse an INI config file is a bit like writing a poem in mud, you might succeed, but the result will probably be inscrutable and your swear jar will be full!
C and C++ prioritize performance over correctness (2023) (swtch.com)
The original ANSI C standard, C89, introduced the concept of “undefined behavior,” which was used both to describe the effect of outright bugs like accessing memory in a freed object and also to capture the fact that existing implementations differed about handling certain aspects of the language, including use of uninitialized values, signed integer overflow, and null pointer handling.
Show HN: I made a C program to create a vanity SHA-1 hash for a text file (github.com)
Let's Build a Simple Database (cstack.github.io)
I’m building a clone of sqlite from scratch in C in order to understand, and I’m going to document my process as I go.
The earliest versions of the first C compiler known to exist (github.com/mortdeus)
The earliest versions of the very first c compiler known to exist in the wild written by the late legend himself dmr.
Stupid Smart Pointers in C (kevinalbs.com)
Managing memory in C is difficult and error prone. C++ solves this with smart pointers like std::unique_ptr and std::shared_ptr. This article demonstrates a proof-of-concept (aka stupid) smart pointer in C with very little code. Along the way we'll look at the layout of the 32-bit x86 call stack and write assembly in a C program.
Implementing Generic Types in C (btmc.substack.com)
One of the most annoying things about programming in C is the lack of support for generic types, also known as parametric polymorphism.
The Defer Technical Specification: It Is Time (thephd.dev)
After the Graz, Austria February 2025 WG14 Meeting, I am now confident in the final status of the defer TS, and it is now time.
A Guide to Undefined Behavior in C and C++ (2010) (regehr.org)
Programming languages typically make a distinction between normal program actions and erroneous actions. For Turing-complete languages we cannot reliably decide offline whether a program has the potential to execute an error; we have to just run it and see.
Show HN: Object-Oriented Programming with ANSI-C (github.com/shichao-an)
Sources for "Object-Oriented Programming with ANSI-C" (rerelease 02-01-04 and 14-01-03) Copyright (c) 1993 Axel T. Schreiner, University of Osnabrueck, Germany
Reverse engineering OpenAI code execution to make it run C and JavaScript (twitter.com)
Something went wrong, but don’t fret — let’s give it another shot.
I stopped everything and started writing C again (kmx.io)
I've been a good student for 5 years at a French computer school. I've been a good freelance developer for 20 years. I've used Ruby on Rails exclusively however never writing my own code always for clients.
Dmap: A C hashmap that's stupid simple and surprisingly fast (github.com/jamesnolanverran)
Dmap is a flexible, lightweight, zero-friction dynamic hashmap implementation in C, designed to be user-friendly without sacrificing performance.
C-Language.org (c-language.org)
C is a general-purpose high-level programming language suitable for low-level programming, in other words: a system programming language.
Show HN: I built a JSON and JSON5 parser with MISRA C conformance (railgunlabs.com)
Rust inadequate for text compression codecs? (palaiologos.rocks)
I wrote this blog post to answer a frequent question that I receive from strangers on the internet: why do I choose to implement codecs in C? The answer is far from straightforward; if you are interested in the details, please read on.
Exploring Polymorphism in C: Lessons from Linux and FFmpeg's Code Design (2019) (leandromoreira.com)
Learn how Linux/FFmpeg C partial codebase is organized to be extensible and act as if it were meant to have “polymorphism”. Specifically, we’re going to briefly explore how Linux concept of everything is a file works at the source code level as well as how FFmpeg can add support fast and easy for new formats and codecs.
Abusing C to implement JSON parsing with struct methods (xnacly.me)
Build a JSON parser in cInstead of using by itself functions: attach functions to a struct and use these as methodsmake it C issue family free (segfaults, leaks, stack overflows, etc…)provide an ergonomic API
Imposing memory security in C [video] (fosdem.org)
They say that Rust is going to replace C. I don't believe that and I wanna share how we're doing memory-safe operations in BIRD's C code with no need to enforce this by the language paradigm. It's obviously possible to override that, yet with the right policies and processes in place, it is almost impossible.
Standard proposal for memory-Safety in C (2024) [pdf] (open-std.org)