Show HN: Type-C – variants, options, generics and pattern matching for C
discuss
- Points48
- Comments23
discuss
I love C, but often using it for parsing, tree walking or complex error handling leads to spaghetti code. Of course there is Swift, Ocaml or Rust for situations like that, but then you are either forced to convert the entire codebase, or add a runtime library or go through the pain of bridging C to the new language. Sometimes there are no compilers for the target architecture too when you are working on embedded stuff. This is where Type-C comes in. It works as a preprocessor like TypeScript…
Story details from Hacker News ↗ · linked article on github.com.
Show HN: Type-C – variants, options, generics and pattern matching for C was first seen on Hacker News · Front page on Nov 23, 2026. Since then it has appeared in 77 checks on 3 different days, across 3 lists (Hacker News · Front page, Hacker News · Show HN, Hacker News · Show HN · this week). Its best position was #15 of 30, reached on Nov 23, 22:29 UTC. It dropped off the list after Nov 25, 13:51 UTC.
Position on Hacker News · Front page at every check (lower is better).
Best rank per day (UTC).
Platform metric as reported by Hacker News.
| List | Best | Days | Checks | Last seen |
|---|---|---|---|---|
| Hacker News · Front page | #15 | 2 | 20 | |
| Hacker News · Show HN | #15 | 1 | 19 | |
| Hacker News · Show HN · this week | #15 | 2 | 38 |
A few top-level comments from Hacker News, shortened. Read the full thread on Hacker News.
I like it, but I have a couple of questions. Why C11? We're in 2026, we should target C23 at least, with a forward look at C2y. Why the keyword "type"? Can't the same functionality be added within a typedef statement? Is there a reason why "|" can't be recognized wherever a type is expected? And finally, the name…
Nice that dropping a `result` is a compile error unless you explicitly cast it to void, unlike C's default of silently ignoring return codes.
> Of course there is Swift, Ocaml or Rust Presumably C++ is the first thing you should mention.
Archived daily, weekly and monthly lists that include this entry.
Not at the moment. It was last on the list on Nov 25, 13:51 UTC, after 3 days of trending.
#15 on Hacker News · Front page, on Nov 23, 22:29 UTC. Trendoday checks this list every 15 minutes.
It was first seen on Nov 23, 2026 and has been on the list on 3 days (77 checks) since.
48 points and 23 comments; submitted by stass on Nov 22, 2026.