February 19, 2026
Mahler.c, hot takes in C major
Show HN: A small, simple music theory library in C99
Tiny C music tool drops — old C vs new C fight breaks out
TLDR: A tiny C library for music theory dropped with neat features like unlimited sharps/flats and full tests. The comment section instantly split between “why use older C99 in 2026—go C23” and meticulous type-name nitpicks, proving even music code can spark a standards skirmish and pedant parade.
A bite-sized C library for music theory just hit Hacker News, promising tiny code with big music brains: intervals, chords, scales, and key signatures — even wild stuff like “theoretical” keys (hello, Fb+) and no limit on sharps or flats. It’s enharmonically correct (music folks, rejoice), boasts 100% test coverage, and shows off a blues scale example that prints like a charm. The author even named it after composer Gustav Mahler and gushes about Symphony No.5. Cute, right? Enter the comments.
Within minutes, the vibe flipped from “nice tune” to standards showdown. One reader asked the question that lit the fuse: why ship this in 2026 using C99 (the older C standard) instead of C23 (the newer, nicer one)? Translation: old-school reliability vs. new-school creature comforts. The thread’s energy? “Keep it portable and simple” colliding with “give us the new toys.” Meanwhile, another commenter went full code detective, poking at a type name: should that be mah_acci instead of int? And does mah_acci even get used? Receipts were linked.
So yes, a wholesome music lib became classic HN: standards bickering and surgical nitpicks, with a side of giggles at “G 20th sharp.” The code sings; the comments brought the drama.
Key Points
- •mahler.c is a C99 library for Western music theory operations (intervals, chords, scales, key signatures).
- •It avoids internal memory allocation and claims 100% test coverage.
- •The library supports theoretical keys and unlimited accidentals with enharmonic correctness.
- •An example shows constructing and printing an ascending C4 Blues Scale using provided APIs.
- •Documentation, unit tests, and CMake-based build instructions are provided for integration.