HNHacker News
TopNewBestAskShowJobs

brightprogramer

80 karma · joined May 18, 2023

submissionscomments
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
I just tested this, and it works flawlessly! This is amazing! Thanks for the suggestion.
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
It is a bit crazy but forcing this kinda makes a habit. That way, a habitual user will tend to initialize other variable types as well.

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.

brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
That sounds like a better idea. I'll test it. Debugging with my existing macros is a PITA, but if your suggestion works then it'll work well with debuggers as well! Thanks :)
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
Ok I'm saying this for the last time so I'll over-explain so everyone can follow the idea properly.

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.

brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
It also compilers way faster than C++ code if that interests you :-)
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
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%...

brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
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.

brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
Because I just don't like it as much and I wanted to see how much farther can we go by just using macro tricks.
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
It's an honor to have you comment here .
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
Std is short for standard :-) It's pretty std.
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
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.
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
because it's my personal standard. I use it more than I use standard C utils.
brightprogramer··on Yet Another TypeSafe and Generic Programming Candidate for C
been working on this for some time. has some usable features. i keep adding as i feel the need. try to well document everything and maintain it.
brightprogramer··on Fixing left and mutual recursions in grammars
I see, I'd like to give it a try then. I'll try adding some precedence here. I don't know how, though.

This calls for some reading...

brightprogramer··on Fixing left and mutual recursions in grammars
Use mermaid js : https://mermaid.js.org/syntax/stateDiagram.html
brightprogramer··on Fixing left and mutual recursions in grammars
Precedence is more of a way to remove ambiguity from grammar. Grammars are just hard to figure out in one go.