r/cprogramming • • Feb 16 '26 This Bravo

Can we ban AI slop on this sub?

605 Upvotes

Out of the top 6 links right now, 4 are vibe coded slop by the same person.

Not only these things clutter the subreddit, but they also seem to be astroturfed.

I mean, who would upvote this? Can we just ban AI? Are there even any active mods here?


r/cprogramming • • Aug 17 '26

C Strings: A 50-Year Mistake

Thumbnail
longtran2904.substack.com
212 Upvotes

r/cprogramming • • Mar 26 '26

Build android Apps in pure C

148 Upvotes

I built a cross-platform GUI framework in C that targets Android, Linux, Windows, and even ESP32

So after way too many late nights, I finally have something I think is worth sharing.

I built a lightweight cross-platform GUI framework in C that lets you create apps for Android, Linux, Windows, and even ESP32 using the same codebase. The goal was to have something low-level, fast, and flexible without relying on heavy frameworks, while still being able to run on both desktop and embedded devices. It currently supports Vulkan, OpenGL/GLES and TFT_eSPI rendering, a custom widget system, and modular backends, and I’m working on improving performance and adding more features. Curious if this is something people would actually use or find useful.

https://binaryinktn.github.io/AromaUI/


r/cprogramming • • Sep 26 '26

I spent 7 years building a game engine using C

143 Upvotes

I've been working on a puzzle game for the last 7 years, and over time I ended up writing almost the entire technology stack myself.

The code is written in a C style, using a C++ compiler mainly because I like operator overloading for math. Other than that, I try to keep the code close to how I would write C. I don't use the standard library, exceptions, RTTI, RAII or object-oriented abstractions.

I made my own build system, UI library, in-game editor, Vulkan renderer, asset pipeline and most of the other tools I use to make the game.

There is no SDL or Dear ImGui. Most of the code is my own, along with a few small libraries such as stb_truetype and miniaudio.

I really like having direct control over all these parts of the codebase. If the game needs something new, I can change the renderer, tools, asset pipeline, build system or engine directly instead of working around an existing framework.

The game is a rule-discovery puzzle game, and building the technology behind it has been just as interesting to me as making the game itself.

The demo is now available on Steam if you want to see what I ended up making:

https://store.steampowered.com/app/5017320/Satelital_Demo/

The full game is planned for release later this year in November.

I'd be interested to hear how other people structure larger C projects, especially around memory management, build systems, UI and tools. I'm always interested in seeing how other people approach these problems.


r/cprogramming • • Aug 18 '26

I am open-sourcing csv.h a single-header CSV parser written in pure C99

138 Upvotes

For my thesis I had to read a lot of big CSV files in C and I couldn't really find a parser I wanted to use. The main C one is LGPL and comes with a whole build system, and everything else I found was C++. So I ended up writing my own. Now that im done with the thesis i cleaned it up properly , seperated it from the rest of the thesis code, and decided to standalone push it on GitHub.

It's one file. You copy csv.h into your project and that's it, nothing to link, no dependencies. It doesn't allocate memory, the fields just point into your own buffer, and you can run through files of any size a chunk at a time.

Honestly I spent way more time testing it than writing it. It passes csv-spectrum and I compared the output against Python's csv module on a few thousand files/

Check it out here -> https://github.com/GeorgeKiritsis/Csv.h

If someone has time to look at the API and tell me what could change or be imrpoved, that would help a lot. Thanks a lot in advance


r/cprogramming • • Nov 29 '25

z-libs - tiny single-header collection to write modern C (vec, list, map, string)

Thumbnail
github.com
136 Upvotes

So, I got tired of either writing buggy hand-rolled containers every time, or dragging in heavyweight dependencies just to get a decent string or hash table.

After this, I decided to throw together https://github.com/z-libs: four zero-dependency (for now), single-header, C11 libraries that focus on a pleasant DX.

The current libraries offer:

  • zvec.h -> growable vector (contiguous, swap-remove, built-in sort/search).
  • zstr.h -> proper UTF-8 string with 22-byte SSO, views, fmt, split, etc.
  • zlist.h -> doubly-linked list (non-intrusive, O(1) splice, safe iteration).
  • zmap.h -> open-addressing hash table (linear probing, cache-friendly).

Everything is type-safe, allocator-aware (you can use your own), MIT-licensed, works on GCC/Clang/MSVC and requires no build system.

The collection is still in process. Each week there will be updates. But I think the core suite is already mature enough.

I would love to hear some feedback!


r/cprogramming • • 28d ago

A lot of you guys are chill

128 Upvotes

You guys are like the equivalent to the debian subreddit where a lot of the answers are either mature or funny.

There still some newbie posts out there I see or like the generic question yet Im amaze you guys still reply maturely.

Keep it up. No I'm not a programmer btw , I work in a hospital. I was browsing and I saw a lot of you where posting about making games outnof C and got curious.

I think games usually are made in C++ or C# I think.

Anyway, Im not a bot and keep up the kindness.


r/cprogramming • • 18d ago

C isn't that scary or bad, it just neat

119 Upvotes

(First time using reddit so tell me if i'm doing something wrong :D)

I'm a new and honestly, a bad programmer, and ive always seen everywhere + i have been told that c is a "Scary" language and that it complex and all, it is very buggy, you have to manage everything by yourself etc...

But i wanted to try it, so i started building a SDL2 game with it, and i haven't encountered any big issues, it's the most powerful yet simplest (in some way) language ive used until now, it does what i want it to do, without black magic doing everything for me.

Legit i prefer using c to python, maybe i'm weird ? Gcc gives clever error messages, the syntax is fine, and it clicks well for me.

Does anyone know why c has this reputation of being a hard and scary language ? Maybe the fact you have to deal with pointers and memory ?


r/cprogramming • • Apr 27 '26

Been studying the original C compiler from 1972 by Ritchie.

115 Upvotes

Researching early Unix and low-level systems, and I ended up spending a good amount of time with this: the actual source of the first C compiler, written by Dennis Ritchie in 1972.
Everything we write today traces back to this. Worth reading if you haven't...
source: https://github.com/jserv/unix-v1/tree/master/src/c


r/cprogramming • • 9d ago

Reading "Write a Shell in C" (lsh) got me down a rabbit hole: how did the OG UNIX devs actually design shells from scratch?

103 Upvotes

Hey folks,

I'm currently halfway through Stephen Brennan's classic "Write a Shell in C" (lsh) tutorial. It's a fun read so far, though it feels a bit too hand-wavy—it shows how to glue fork(), exec(), and wait() together, and leaves me itching for the actual official specs and deeper design docs.

It got me thinking about two things:

First, how did the OG legends like Ken Thompson or Stephen Bourne actually architect the early UNIX shells from a blank slate? I want to read the real foundational papers, POSIX docs, or historical design breakdowns instead of just toy tutorials.

Second—linking the classic Read -> Parse -> Execute loop to modern AI Agents—it feels remarkably similar to how agents parse context and dispatch tools.

Looking for recommendations on historical specs, papers, or minimal shell source repos. Drop them below!


r/cprogramming • • Dec 12 '25

Does anyone use their own text editor that they wrote themself?

97 Upvotes

Not a C question, per se, but I am writing a text editor in C right now, and looking around for ideas, it seems like this is a pretty common intermediate project. So, if people are writing these to learn C, or any other language, I suppose, do they actually use them for serious work? I was just wondering. I know text editors are a controversial subject, but I thought it might be interesting to ask.


r/cprogramming • • Sep 11 '26

I just understood pointers on a deep level and it feels like an orgasm

89 Upvotes

I fucking love C and assembly


r/cprogramming • • Oct 07 '26

Using -fsanitize=address feels illegal.

82 Upvotes

Just saying. The -fsanitize=address compiler flag is absolute cheating and should be prohibited by governments of all countries.

Plus there are also other useful runtime sanitizers, such as integer overflow, but... Integer overflow is much easier to notice, usually.

Of course, this is by no means assuming that -fsanitize=address guarantees that the code it inspects is completely safe and correct and won't ever fail on any input data. You still have to test tricky edge cases. But this sanitizer has improved and sped up the bug discovery process disgustingly much for me.

I'm wondering, how often, if ever, do you need tools such as -fsanitize=address or valgrind? Or are you a real man who stores everything in static memory only?

P.S. Forgive my terrible English.


r/cprogramming • • May 25 '26

Why doesnt C have something like rust crates or python pip?

78 Upvotes

Its more of a curiosity than anything. I'm not very experienced in C, before finally deciding ti switch to C programming journey I tried looking at rust, and found the crates very easy to setup and use. Why doesnt C have something similiar? Is there an actual reason, or simply nobody has already invented something like that?


r/cprogramming • • Apr 10 '26

tip - do not name variables like libc functions

73 Upvotes

Today I spent three hours debugging why ncurses jumped to address 0x55d9f367b4c0 out of the wild and crashing when calling stat...

I had a variable named stat holding the status of the program, and it was doing some really shitty and incorrect pointer arit on stat or something.

so yeah, just a quick tip :)


r/cprogramming • • Jun 01 '26

memory safe C

69 Upvotes

https://github.com/sadvadan/memstruct

C is powerful enough to have the best performing memory safety suite for itself!

memstruct is a single header file C library (<400 LoC) that provides complete spatial & temporal safety to the caller program. performance: near native speed.

memory checks are compile time / hoisted / elided / pipelined. checks are opt-in and can be switched off in production if needed. its macro based API extends the language a bit to position C as the leading option for large scale projects.

memstruct is currently in advanced stages of testing. contributions and comments are welcome. have an early look!

P.S.: the project is 100% human crafted and contributions are also reqd to comply

edit; end note: memstruct has now become even better (at 320 LoC) by incorporating MCU programming & de/allocator indirection, thanks to some valuable feedback on here. if you've more to add you may respond here or participate on git.


r/cprogramming • • Oct 17 '26

Mucc: a self hosting C compiler in one static binary, with its own assembler, linker and musl (x86-64 and ARM64 Linux)

58 Upvotes

Mucc is a small C compiler for Linux that ships as a single 8.5 MB static file. The preprocessor, assembler, linker, archiver, headers and C library (musl, like zig cc does) are all built in, so you can drop it into an empty container, an old distro or a Raspberry Pi and build C with nothing else installed: no gcc, no binutils, no system headers. 

Programs it builds are static, so they run on any x86-64 Linux. There's a native ARM64 build too, and it can cross-compile between the two.

The whole project actually started as a fork of Rui Ueyama's chibicc. I felt more could be done on this design. So now Mucc adds its own assembler and linker, an ARM64 backend, register allocation, the bundled musl, DWARF debug info, C23 support and a reproducible bootstrap chain.

What’s actually working so far 

- C17 by default, C23 with `-std=c23`, plus the GNU extensions real code uses

- Self-hosting: each release is built by the one before it, and a Mucc-built Mucc produces byte-identical output

- Real projects build and pass their own test suites: SQLite, Lua, zlib, jq, Redis and Tcl with the bundled musl; CPython and Git with the system glibc

- Same ABI as gcc, so objects from either link together

- Compiles its own 33k lines in 0.46 s (gcc -O0: 1.22 s, gcc -O2: 5.35 s)

What’s currently not working, it does no optimization beyond register allocation and constant folding, so programs run about as fast as gcc -O0. No C++, Linux only. For performance-critical code, use gcc or clang.

If you've got C code it chokes on, or a use for it I haven't thought of, I'd like to hear it.

GitHub: https://github.com/Dom-Yan/Mucc

Website: https://dom-yan.github.io/Mucc/

Thanks to Rui Ueyama for chibicc, and to Fabrice Bellard, whose TinyCC showed how much a small compiler can do.


r/cprogramming • • Jun 07 '26

This joke has probably been done to death here!

57 Upvotes

But I'm new to coding ...

In a job interview they asked me how to receive input in c.

I said I'm sorry I fgets the answer 😔


r/cprogramming • • Nov 30 '25

I’m 12 and built my own operating system: COS

Thumbnail
github.com
56 Upvotes

r/cprogramming • • Oct 10 '26

I'm building a game in C

55 Upvotes

I've been working on a game since about August 2020 but only recently published my Steam page.

For the Common Wealth on Steam

The game is entirely written in C, with one third party dependency, SDL3.

I chose C because I wanted to leave my options open to build for retro platforms like RISC OS and Amiga, but as the game grew, I wanted GPU acceleration and that meant leaving behind some of the retros. I'm not ruling out any ports though, if SDL3 is available on the platform.

The engine beyond SDL3 is my own, it's a 2.5D game, with levels edited in my own level editor (not in C, that's C# and Avalonia). The level editor exports levels into just plain memory dumps that are easy to read in C.

I'm trying to keep on top of a devlog here too:

Podule · Independent game studio

Writing this game in C has been enormous fun, and I have no plans to change my choice of C for future games.


r/cprogramming • • Jan 22 '26

Why some famous open source projects rewrite some C standard function from zero?

55 Upvotes

Hello,

I was watching NGINX and libuv source code and noticed that both the projects (at different ratios) rewrite standard functions (such as string manipulation functions) or rewrite existing macro including their prefix (es.
UV__INET6_ADDRSTRLEN in inet.c).

Is it due to performance or maybe to create a common wrapper between OS?

Thanks!


r/cprogramming • • Sep 21 '26

I have 4dumb questions about C

54 Upvotes
  1. I have read the "C bible" (k &R book) and admittedly understood about 80 to 85 percent of it and did almost all of its exercises without AI , not all but very few were undone, why do I feel like idk Jack shit about C? I have coded projects and I'm not "beginner" but it still feels like idk anything about how to make it productive
  2. What are the most essential parts you'd think someone learning should focus on? I'm not saying basic stuff like the syntax , I'm talking about building stuff
  3. Why the hell is it so hard to read opensource code? Admittedly I am new to that one, but I can't even fathom contributing to open source when I look at the code it feels like I'm reading Chinese... the hell am I supposed to do?
  4. Are there even any actual job markets related to C besides embedded? Don't get me wrong I really enjoy the language and do like to work with it as a hobby but I'm a mid 20 adult and need a good job sooner sooo... kinda need yo focus on more important stuff than just hobbies

Edit: sorry I forgot to say hi, thanks for reading

Edit2:

For the people who say I should build stuff, I understand and appreciate your advice but I should have mentioned I have done some stuff like that I'll reference a couple things I built

  1. Text editor in the terminal
  2. Http server with semi advanced way of handling requests
  3. Shell and basic mallow
  4. Dumb I know but hash maps in c just to practice
  5. Basic database (admittedly I got too busy with other things and didn't finish it fully)

r/cprogramming • • Dec 27 '25

How do I approach C so I can do low level stuff?

54 Upvotes

Hey everyone! I'm currently a 5th-semester Computer Science student, and lately I've been getting really interested in Computer Architecture, Operating Systems, and low-level concepts. The problem is, my problem-solving skills have dropped ever since I shifted to C# and web development for university. The higher-level abstraction feels like it skips the parts I actually want to understand, and I get confused even when tasks are “supposed to be easy”. Because of that, I’m thinking about getting back to fundamentals with Linux, Vim, and C to strengthen my foundation and actually understand what’s happening under the hood. But I don’t want to stay stuck on basic loops and if-else problems forever — I want to work on fun, challenging projects that build real skill and can eventually help me land a job. If you’ve been down this path, I’d love advice on: How to balance low-level learning with practical skills Project ideas in C/Linux/OS/Systems that are both fun and resume-worthy Whether this direction is smart for job prospects

Also please forgive me if I said anything wrong I'm just curious and want to try to change myself and get into something like low level system engineer.

Thanks!