C
Everything I wish I knew when learning C is nice read.
Zig & Rust are nice safer alternatives.
Notes
- Notes on learning/using C.
- C models an assembly wildly different from modern x86, often informs you of errors by just setting shared globals you have to know to check, and has huge amounts of magic wrapped up in libc. There's so many ways that C does things behind your back.
Links
- Principles for C programming
- Understanding pointers
- c4 - C in four functions. (HN)
- Project Based Tutorials in C
- One year of C (2018)https://floooh.github.io/2018/06/02/one-year-of-c.html
- Building C programs
- Tiny Garbage Collector - Tiny Garbage Collector for C.
- Awesome C - Curated list of awesome C frameworks, libraries, resources and other shiny things.
- Awesome C 2
- 9cc small C compiler
- picol, a Tcl interpreter in 550 lines of C code (2007)
- Boehm-Demers-Weiser conservative C/C++ Garbage Collector (libgc, bdwgc, boehm-gc)
- Clang documentation
- libaco - Blazing fast and lightweight C asymmetric coroutine library.
- C-Reduce - Tool that takes a large C or C++ program that has a property of interest (such as triggering a compiler bug) and automatically produces a much smaller C/C++ program that has the same property.
- bic - C interpreter and API explorer. (HN)
- clang - Compiler front-end for the C family of languages (C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM compiler infrastructure project.
- rcc - C compiler written in Rust, with a focus on good error messages.
- Post modern C tooling (2019)
- Small C Compilers (HN)
- Learn C and C++ Programming
- Small C Compiler - Intended to support all C11 language features while keeping the code as small and simple as possible.
- All Algorithms implemented in C
- CodeChecker - Analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy.
- Writing a Simple Garbage Collector in C (2014) (HN) (HN)
- gc - Simple, zero-dependency garbage collection for C. (HN)
- To become a good C programmer (HN)
- Development of the C Language (1993) (Lobsters) (PDF)
- Ask HN: How do I learn C properly? (2020)
- HN: Static Analysis in GCC 10 (2020)
- “C is not how the computer works” can lead to inefficient code (2019) (HN)
- Write a C interpreter - Write a simple interpreter of C. Inspired by c4 and largely based on it..
- tree-sitter-c - C grammar for tree-sitter. Adapted from this C99 grammar.
- Awesome Clang
- Tell HN: C Experts Panel – Ask us anything about C (2020)
- Embedding Binary Objects in C (HN)
- Implementing a LLVM Micro C compiler in Haskell (HN)
- Why should I have written ZeroMQ in C, not C++ (2012)
- Awesome C
- Verified sequential malloc/free (HN)
- Fat pointers in C using libcello (HN)
- Embracing modularity with Meson (2020)
- Some Were Meant for C - The Endurance of an Unmanageable Language (2017) (Lobsters) (HN)
- Developing a programming language in C (2020)
- Mass (Meta Assembly) Language - Compiler for a new language focusing on compile-time execution and no LLVM dependency.
- Implementing simple cooperative threads in C (2020) (HN)
- c2go - Tool for transpiling C to Go.
- cpkg - Build tool for C with a particular emphasis on cross compilation. It is configured using Dhall.
- C Internals (HN)
- C-Reduce - Tool that takes a large C or C++ program that has a property of interest (such as triggering a compiler bug) and automatically produces a much smaller C/C++ program that has the same property. (Web)
- C-Vise - Super-parallel Python port of the C-Reduce.
- C implementation of Tic-Tac-Toe in a single call to printf (HN) (Reddit)
- How the most upvoted C question was another question (2020) (Lobsters)
- LLDB Debugger - Next generation, high-performance debugger.
- Dumbindent: When 93% of the Time was Spent in Clang-Format (2020) (Lobsters)
- C is archaic (2019)
- Linux kernel coding style in C
- Constantine - Toy project to learn how to write Clang plugin.
- Tiny C Compiler (HN)
- C performance mystery: delete unused string constant (2020)
- C's main() is one of the places where Unix's user and kernel APIs differ (Lobsters)
- Standard C loop idioms (2020)
- Why the C Language Will Never Stop You from Making Mistakes (2020)
- Can we do better than our C compiler? (HN)
- Cyclone - Safe dialect of C.
- C Code Archive Network (Code)
- do {...} while (0) in macros (2014) (Lobsters)
- Simple C Compiler
- Verifiable C (2020)
- Rust-style futures in C (2020)
- The problem with C compatibility in C++ (2020) (Lobsters) (HN)
- Essential C (2003) (HN) (HN)
- Modern C (HN) (Lobsters)
- C FAQ
- Massacring C Pointers (2018) (HN) (Lobsters)
- C’s Biggest Mistake (2009) (Lobsters)
- Defer Reference Implementation for C (HN)
- Chibicc - Small C Compiler. (HN)
- Loading CSV File at the Speed Limit of the NVMe Storage (2020) (Lobsters)
- What Makes C Hard to Compile (2020)
- malloc as a service (2020)
- The Lemon Parser Generator - LALR parser generator for C.
- How Does a C Debugger Work? (2014) (HN)
- SheLLVM - Collection of LLVM transform and analysis passes to write shellcode in regular C.
- Defining C macros the right way (2020) (Lobsters)
- Hundred year mistakes (2020) (Lobsters)
- MazuCC - Minimalist C compiler with x86_64 code generation.
- shecc - Self-hosting and educational C compiler.
- AMaCC - Small C Compiler generating ELF executable Arm architecture, supporting JIT execution.
- How to C (as of 2016)
- Demystifying malloc (2020)
- Past, Present and Future of Effective C (2020)
- C compiler written in Go
- ZetZ - Formally Verified Dialect of C. (Article)
- Editing the C Standard (2020) (HN)
- C Is Not Dependency Free (2020)
- Best aspects of C language (2020) (HN) (Lobsters)
- C3 Language Compiler - C3 is a C-like language trying to be "an incremental improvement over C" rather than a whole new language. (HN)
- Coccinelle - Allows programmers to easily write some complex style-preserving source-to-source transformations on C source code, like for instance to perform some refactorings.
- rcc - Basic c compiler written in rust.
- Writing a C Compiler (2017) (Code)
- What is your favorite C programming trick? (HN)
- Linus Torvalds' good taste argument for linked lists, explained (HN)
- DragonFFI - C Foreign Function Interface (FFI) library written in C++ and based on Clang/LLV.
- PureCTypes - Pure-python package to describe portable C structures.
- Now you C me, now you don't, part two: exploiting the in-between (2020)
- Data Structures and Algorithms in C (implementations and notes)
- Getting started with C programming a lightning-fast start for absolute beginners (2020) (HN)
- C-Toy - Interactive C coding environment.
- cproc - C11 compiler using QBE as a backend. (HN)
- Cosmopolitan Libc - Build-once run-anywhere C library. (Code) (HN) (HN 2) (HN 3) (Actually Portable Executable) (Lobsters) (Lobsters) (Awesome)
- Learn C - Free Interactive C Tutorial.
- Why mmap is faster than system calls (2019) (HN)
- CxGo - Tool for translating C source code to Go.
- Wanager - Package manager and project manager for the C & C++ programming languages.
- B. Harvey's Intro to C (2007)
- lcc - Retargetable Compiler for ANSI C. (Web)
- C Compiler/Parser written in Rust
- c2goasm - C to Go Assembly.
- List of C static analysis tools
- Q3VM - Single file (vm.c) bytecode virtual machine/interpreter for C-language input.
- How does Clang 2.7 hold up in 2021? (HN)
- Developing mathematical software in C (2021)
- POSIX Threads Programming (HN)
- Beej's Guide to C Programming (Code) (PDF) (HN) (HN)
- Obfuscated Tiny C Compiler (HN)
- Angelix - Semantics-based test-driven automated program repair tool for C programs. (Code)
- Inline and Sideline Approaches for Low-Cost Memory Safety in C (2021)
- Checked C - Adds static and dynamic checking to C to detect or prevent common programming errors such as buffer overruns and out-of-bounds memory accesses. (HN) (HN)
- ELF: symbol lookup via DT_HASH (2017)
- Actually Portable Executables (2021) (HN)
- Rust, Zig, and the Futility of "Replacing" C (2021) (Lobsters)
- Git's list of banned C functions (HN)
- Microsoft's list of banned C functions (HN)
- Aro - C compiler written in Zig. (HN)
- Half of curl’s vulnerabilities are C mistakes (2021) (Lobsters) (HN)
- C's removal of
gets
could have been done better (2021) - Compile times, and why "the obvious" might not be so (2021) (Lobsters)
- CBMC - Bounded Model Checker for C and C++ programs. (Web)
- Type-safe generic data structures in C (2020)
- Modern C and What We Can Learn from It (2021) (HN)
- The price of dynamic memory: Allocation (2020)
- The Byte Order Fiasco (2021) (Lobsters)
- snmalloc - High-performance allocator.
- Practical Design Patterns: Opaque Pointers and Objects in C (2021) (Lobsters)
- Movfuscator - Compile C into only mov instructions. (HN) (HN)
- Undefined behavior in C is a reading error (2021) (Lobsters)
- lacc - Simple, self-hosting C compiler.
- RefinedC: Automating the Foundational Verification of C Code with Refined Ownership Types (2021) (HN)
- Modern C for C++ Peeps (2019) (HN)
- Libdill: Structured Concurrency for C (2016) (HN)
- Goodbye C++, Hello C (2021) (HN)
- CompCert - Formally-verified C compiler. (Web) (HN)
- When static makes your C code 10 times faster (2021) (HN) (Lobsters)
- Goodbye C developers: The future of programming with certified program synthesis (2021) (Lobsters)
- Macros on Steroids, Or: How Can Pure C Benefit From Metaprogramming (2021)
- CGuard: Efficient Spatial Safety for C (2021)
- IOCCC - The International Obfuscated C Code Contest. (Winners)
- Performance vs Programming Effort between Rust and C on Multicore Architectures: Case Study in N-Body (2021)
- Strict memcpy() bounds checking for the kernel (2021) (HN)
- strcpy: a niche function you don't need (2021) (Lobsters)
- #ifdef Considered Harmful, or Portability Experience with C News (1992)
- Ocean - Programming language lik C that compiles into a x86 ELF executable. (HN)
- The (too) many pitfalls of VLA in C (2021)
- The Descent to C (2013) (HN)
- Progress on C23 (2021) (HN) (Lobsters)
- pycparser - Complete C99 parser in pure Python.
- PackCC - Parser generator for C.
- Why is C Faster Than My Language? (2021)
- Elements of C Style
- pcpp - C99 preprocessor written in pure Python.
- Fast character case conversion (or how to compress sparse arrays) (HN)
- Proposal to add constexpr to C (2021) (HN)
- rust-cexpr - C expression parser and evaluator.
- When to Use Goto (HN)
- There is no 'printf' (2021) (HN)
- Comparing the c ffi overhead on various programming languages
- 55GiB/s FizzBuzz (HN) (Lobsters)
- In C, how do you know if the dynamic allocation succeeded? (HN)
- cc65 - Freeware C compiler for 6502 based systems. (Docs)
- Beware of fast-math (2021) (HN)
- A Simple, Possibly Correct LR Parser for C11 (2017)
- Pointers in C / C++ [Full Course] (2020)
- Smaller C - Simple and small single-pass C compiler.
- Comprehensive guide to 50 years of evolution of strict C programming (HN)
- Some obscure C features (2019) (Lobsters)
- Writing a register based VM in less than 125 lines of C code (2021) (HN)
- Ogma - Tool to facilitate the integration of safe runtime monitors into other systems. Extends Copilot, a high-level runtime verification framework that generates hard real-time C99 code.
- Type-Safe Printf For C (HN)
- Lang-C - Lightweight C parser for Rust.
- Why Is C Faster Than Java (2009) (HN)
- Almost Always Unsigned (2022) (HN)
- C Runtime Overhead (2015) (HN)
- Ridiculously fast feature flags (2021) (Lobsters)
- CIL - C Intermediate Language.
- C structures and padding and sizeof (2022) (Lobsters)
- Centralizing Resource Cleanup Paths in C (Lobsters)
- Finding the average of two unsigned integers without overflow (2022) (HN)
- PyClibrary - C parser and bindings automation for Python.
- Running C unit tests with pytest (2022)
- A Formal Model of Checked C (2022) (HN)
- C meeting is over. C23 added the following (2022) (HN)
- I wrote the least-C C program I could (2022) (HN)
- C Portability Lessons from Weird Machines (2018) (HN)
- Moving the Linux Kernel to Modern C (2022) (HN) (Lobsters) (Reddit)
- Debugging with GDB (2022) (HN)
- Debugging with GDB (HN)
- CMOC - 6809 cross-compiler for a C-like language.
- C Arrays Are Not Pointers (2021)
- To Save C, We Must Save ABI (2022) (HN)
- A flexible, lightweight, spin-lock barrier (2022)
- C Isn't A Programming Language Anymore (2022) (Lobsters) (Reddit) (Tweet) (Reddit)
- Mildly Interesting Quirks of C (HN)
- SubC - Simple subset of C originally written by Nils Holms for teaching newcomers how to write a compiler.
- c2go - Convert C to Go.
- Implementing cosine in C from scratch (2020) (HN)
- Writing a C Compiler Book (Article)
- Kate's C AMA (2022)
- Haskell C Compiler - Learning Haskell for the first time and using it to write a simple C compiler.
- I wrote a peephole optimizer for QBE (2022) (Lobsters)
- When FFI Function Calls Beat Native C (2018) (HN)
- Advanced Optimization and New Capabilities of GCC 11
- Tiny C Projects - Collection of small C projects - usually a minimal example of something interesting.
- Old C code – how to upgrade it? (2022)
- Minipeg - Parser generator for C.
- C72 - Port of the earliest C compiler to x86 (2021). (HN)
- C17 compiler written from scratch in C
- Neatcc - Small arm/x86(-64) C compiler.
- C-implemented C compiler
- A blog that is a single executable binary (2022) (HN)
- Tiny C Compiler - Smallest ANSI C compiler.
- Awesome tooling for Bazel users of the C language family
- The Lost Art of Structure Packing (2014) (HN)
- Self-hosting C compiler
- Minimal C compiler in x86 assembly (HN)
- Set of minimal dependency bootstrap binaries - Goal of creating a bootstrapping path to a C compiler capable of compiling GCC, with only the explicit requirement of a single 1 KByte binary or less.
- A game for learning C operator precedence (Lobsters)
- 4 integers are enough to write a Snake Game (2022) (Lobsters)
- A lock-free, concurrent, generic queue in 32 bits (2022) (HN)
- Logging C Functions (2022) (Lobsters)
- Linux and Tiny C Compiler in the browser (2022)
- All About Libpas, Phil's Super Fast Malloc (HN)
- Pretty-Printable Enumerations in Pure C (2022)
- Psyche-C - Compiler frontend for the C programming language.
- Testing and building C projects with Zig (2022)
- ClangIR (CIR) - New high-level IR for clang.
- Assertions should be more debugger-oriented (2022)
- Adding Modules to C in 10 Lines of Code (HN)
- OpenBSD has two new C compilers: chibicc and kefir (2022) (HN)
- Goblint - Static analysis framework for C.
- Kefir C compiler - Implementation of C17 language compiler from scratch.
- Polymorphism through Typeclasses / Interface / Traits in C
- Practical design patterns in C
- little - Small, fast, easily embeddable language implemented in C.
- Embed is in C23 (2022) (HN) (Lobsters)
- What's the most portable way to include binary blobs in an executable? (2022) (HN)
- The different ways to handle errors in C (2022) (Lobsters)
- ClangIR (CIR) - New high-level IR for clang.
- C99 doesn't need function bodies, or 'VLAs are Turing complete' (2022) (HN)
- C23 is Finished: Here is What is on the Menu (2022) (HN)
- The pervasive effects of C's malloc() and free() on C APIs (2022) (HN)
- sexpc - C as S-expressions. (Lobsters)
- The case against an alternative to C (2022) (Lobsters)
- The quick and practical "MSI" hash table (2022)
- Advanced Metaprogramming in C: A select statement (2022) (HN)
- TruffleC: C implementation on top of JVM (2014)
- Why should I have written ZeroMQ in C, not C++ (2012) (HN)
- Fexl - Function EXpression Language.
- C Integer Quiz (HN)
- Tips to Get Started with Cosmopolitan Libc (2022)
- Prototyping in C (2022)
- Teaching C (2016) (HN)
- Cake - C23 compiler frond end written from scratch in C.
- C Project Based Tutorials
- C Programming for Everybody (Code)
- Illuminating synchronization edges for ThreadSanitizer (2022)
- What does the ??!??! operator do in C? (HN)
- Lambda-8cc - x86 C Compiler Written in Untyped Lambda Calculus. (HN)
- Ask HN: Best book to learn C in 2022?
- Bare Metal C (2022)
- Learn enough C to survive (2022) (HN)
- Debugging C with Cosmopolitan Libc (2022) (HN)
- Bringing a dynamic environment to C: My linker project (2022) (Lobsters) (HN)
- FluenC - Modern, functional-first, C inspired language, with a focus on simplicity.
- Come - C like language and its compiler.
- C Programming Language 2nd Edition - Solutions
- clex - Simple lexer generator for C. (Lobsters)
- C Isn't a Programming Language Anymore (2022) (HN)
- What tool do you use to document your code in C language? (2022)
- cparse - LR parser generator for C.
- Considering C99 for curl (2022) (HN)
- C compiler written in Swift
- GCC undefined behaviors are getting wild (2022)
- Everything I wish I knew when learning C (2022) (HN)
- XCC - Toy C compiler for x86-64/aarch64/wasm.
- Simple semi-space collector (2022)
- Conformance Should Mean Something - fputc, and Freestanding (2022)
- Ask HN: Learn C in 2023?
- 50 years of C, the good, the bad and the ugly (2022)
- SOCC - Simple C Compiler in OCaml.
- Explicit sequencing of C programs
- Safe memory reclamation for BIND (2023)
- From Zero to main(): Bare metal C (2019) (HN)
- Bounded Flexible Arrays in C (2023)
- C was not created as an abstract machine (2023) (HN) (Lobsters)
- C Programming Lab: Assessing Your C Programming Skills
- Why I Use C When I Believe in Memory Safety (2023) (HN)
- Let's write a setjmp (2023) (Lobsters) (HN)
- CBMC: The C Bounded Model Checker (2023)
- Few lesser known tricks, quirks and features of C (Lobsters) (HN)
- Lessons learnt while trying to modernize some C code (2022)
- GOTOphobia considered harmful (in C) (2023) (Lobsters) (HN)
- Why the “volatile” type class should not be used
- Demystifying bitwise operations, a gentle C tutorial (2023) (HN)
- Cosine Implementation in C (HN)
- Ask HN: If Unix is written in C, how did they run C before Unix? (2023)
- Using mmap to make LLaMA load faster (2023) (Lobsters) (HN)
- C Strings and my slow descent to madness (2023) (HN)
- Hero C Compiler - C Compiler to SPIR-V.
- My favorite C compiler flags during development (2023) (HN)
- How to make smaller C and C++ binaries (2013) (HN)
- SectorC: A C Compiler in 512 bytes (HN) (Code)
- A simple hash table in C (2023) (Lobsters)
- Few lesser known tricks, quirks and features of C
- Sandcrust - Sandboxing C in Rust.
- Six times faster than C (2023) (HN)
- Christopher Wellons's scratch code in C
- The C Programming Language: Myths and Reality (HN)
- Simply Parse in C (2023) (HN)
- Weird Parts of C you probably never heard of (2023)
- Workarounds for C11 _Generic (2023)
- "Once" one-time concurrent initialization with an integer (2023)
- TinyCC - Tiny C Compiler.
- A Modern C Development Environment (2023) (HN)
- Can you use a class in C? (2023) (HN)
- Parsing C in 2023
- Writing a C compiler in 500 lines of Python (2023) (HN)
- ts-c-compiler - Multipass C Compiler, Assembler and X86 emulator written in TypeScript.