Yet Another Typesafe and Generic Programming Candidate for C
Posted4 months agoActive3 months ago
github.comTechstory
skepticalmixed
Debate
60/100
C Programming LanguageType SafetyGeneric Programming
Key topics
C Programming Language
Type Safety
Generic Programming
A developer shares a C library for type-safe and generic programming, sparking discussion about its design choices and potential usefulness.
Snapshot generated from the HN discussion
Discussion Activity
Active discussionFirst comment
N/A
Peak period
19
Day 5
Avg / period
6.8
Comment distribution34 data points
Loading chart...
Based on 34 loaded comments
Key moments
- 01Story posted
Sep 5, 2025 at 8:06 PM EDT
4 months ago
Step 01 - 02First comment
Sep 5, 2025 at 8:06 PM EDT
0s after posting
Step 02 - 03Peak activity
19 comments in Day 5
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 20, 2025 at 1:54 PM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45145176Type: storyLast synced: 11/20/2025, 1:08:48 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
There can be only one.
Why include the letters Std then? This seems like a purposeful typo-squatting effort and definitely makes me suspicious.
Not all people can pronounce names correctly. In a language some names are easier to pronounce if you take away a few letters. Some may find using Sid as short form for Siddharth, because it's just easier.
Now from my childhood, some friends used to pronounce my name differently. I noticed that they don't use the 'h' in Mishra, so I started using 'Misra' instead. They found it easier to pronounce and I felt connected more. Those who could pronounce it correctly, still used Misra because it's just easier and sounds more personal. Friends and loved ones do that. It's also sometimes called as a nickname, where you give other names to a loved one.
Now, it also just happens that my native language has the same root word for Misra and Mishra aaaand they mean the same! It essentially means a mixture of different things.
Now even if all this this reason does not sound good to you, just ignore it. It is my project, my name. I can pronounce however I want, with whatever spelling I want. A project is named by it's maintainer. I can name it exactly MISRA and still be happy with it because it's my project, I'm the maintainer.
I did mention that this is not related to the MISRA standard because I felt like users should know and not confuse it with my library.
I tried to ignore this matter but people over internet just keep poking you saying you're dishonest. Please don't bother yourself with the name of things, just use it if you need it otherwise ignore it. It's an advice for life. Name of things does not matter, it's what they do and achieve. I've put honest work into this library and I won't accept someone sitting behind a screen just say that I'm dishonest, I'm purposefully choosing this name. It is my name, I chose it, names clash in this world at least. Two entities can have same name but of different origin and use case.
Thanks for reading this if you read it till here.
Did you really think naming something MisraStdC, then posting it to the internet, then rationalizing it wouldn't be noticed?
It's not even your name or a standard.
It really looks like you are trying to name it something that people would find from searches then somehow walk it back and come with a story after.
Misra and not Mishra? You randomly drop the h? And it just so happens dropping the H makes it a typo squat basically.
Siddharth has a T after the D. So std should be sdt.. at best.
Just be honest lol
Because it seems like you're being purposefully obtuse at this point.
For me personally compilation slowdown is just a price, which I am ready to pay for more language features, including better abstractions and type safety.
I'd say "mostly C11": it uses __VA_OPT__ that's been standardized only in C23.
The "foreach" macros need a lot of refinement: passing the body in the parameters is asking for troubles, for example. And using a non-unique default name for the index prevents nested loops.
To overcome the issues with generic and qualified types, have you considered using typeof_unqual?
I do kinda like how foreach is implemented right now. This allows me to perform some strict checking for easy loop iteration based bugs and also it kinda looks cool.
This is the first time I came across typeof_unqual. I'll look into it, thanks .
I spent a lot of time making this work across all three compilers (especially MSVC). I'm glad MSVC has VA_OPT support.
Yes but the body in the parameters really is a show stopper. What if the body has a unprotected comma? Like
Better to expand the macro into one or two "for" and let the body follow. For example: Please note that I haven't tested it.That's why I call it a standard, because the library has its own coding style. Take the ownership semantics explained in concepts section of README for example. I provide a way to very clearly specify ownership.
Also the init() instantly detects bugs related to uninitialized struts. When they do happen, sometimes very deep in the code they take a lot of time.
This is also one of the reasons why there are so many ValidateX checks in implementation code. Try to catch bugs faster.
One example is me parsing HTTP headers: https://github.com/brightprogrammer/beam/blob/master/Source%...