Live data from Hacker News

Yet Another TypeSafe and Generic Programming Candidate for C

github.com

11–20 of 37 posts

Re: Yet Another TypeSafe and Generic Programming Candidate for C

#11

Earlier quoted context omitted.

yep, glad you pointed that out. To explain a bit more : MisraStdC is 3 parts : Misra + Std + C - Misra is derived from my name. That's why I needed to specify that the repo is not related to the MISRA standard.

How does MisraStdC = Siddharth Mishra? 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

Std is short for standard :-) It's pretty std.

Re: Yet Another TypeSafe and Generic Programming Candidate for C

#12

Earlier quoted context omitted.

How does MisraStdC = Siddharth Mishra? 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

Std is short for standard :-) It's pretty std.

That doesn't explain the worst part though. Why drop a random H?

Re: Yet Another TypeSafe and Generic Programming Candidate for C

#13

Earlier quoted context omitted.

How does MisraStdC = Siddharth Mishra? 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

Std is short for standard :-) It's pretty std.

You do understand people's concern here though right?

Because it seems like you're being purposefully obtuse at this point.

Re: Yet Another TypeSafe and Generic Programming Candidate for C

#16
> A modern C11 library

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?

  _Generic(*(typeof_unqual(x)*)0, ...)

Re: Yet Another TypeSafe and Generic Programming Candidate for C

#19

> A modern C11 library 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? _Generic(*(typeof_unqual(x)*…

Yea the FMT trick uses VA_OPT. I consider myself a noob with C official specification, so you're probably right about that.

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.

Re: Yet Another TypeSafe and Generic Programming Candidate for C

#20
I especially am in love with how my formatted printer works. It's not a completely new solution and I think people have already done that. I'll also say that it's not very mature but it makes life a lot easier in some cases.

One example is me parsing HTTP headers: https://github.com/brightprogrammer/beam/blob/master/Source%...

Post reply on HN