Live data from Hacker News

Tell HN: C Experts Panel – Ask us anything about C

news.ycombinator.com

31–40 of 978 posts

Re: Tell HN: C Experts Panel – Ask us anything about C

#31

I've been waiting for a book on C from No Starch Press, so I'm really excited for this one. This might not be too deep a question on the C language in regards to this book, but I've been wondering, why did you decide to have an eldritch horror as the book's cover?

Wait, they put Cthulhu on the cover of a programming book? I'm buying it.

Re: Tell HN: C Experts Panel – Ask us anything about C

#32
I do find that C is difficult use for large programs. It there any thoughts that introducing features like namespaces.

Another thing very cumbersome is to do in C is object creation; creating instantiable objects is possible very cumbersome. Is there some feature in the thoughy process to deal with it. To make it clear, in C we can create a data structure like a Stack or a queue easily. But if the program needs 10 stacks then presently no simple way of achieving it.

Re: Tell HN: C Experts Panel – Ask us anything about C

#33
Now that C2x plans to make two's complement the only sign representation, is there any reason why signed overflow has to continue being undefined behavior?

On a slightly more personal note: What are some undefined behaviors that you would like to turn into defined behavior, but can't change for whatever reasons that be?

Re: Tell HN: C Experts Panel – Ask us anything about C

#34
Not about the language exactly, so maybe not fair game, but: how did you all find yourselves joining ISO? And maybe more generally, what's the path for someone like a regular old software engineer to come to participate in the standardization process for something as significant and ubiquitous as the C programming language?

Re: Tell HN: C Experts Panel – Ask us anything about C

#35
Quite a few new languages generate C code for the “backend” of their compiler. For example ATS and the ZZ language.

This helps bringing these languages to embedded targets with closed toolchains (with an existing C compiler).

Will there be developments to use a subset of C as a “portable assembly” in a standard way? Like there is WebAssembly for JavaScript.

Re: Tell HN: C Experts Panel – Ask us anything about C

#36
Thank you for taking time to take questions!

Have you ever considered or will you consider deprecating char, int, long, (s)size_t, float, double and etc in favour of specific length types?

Will you ever add / have you considered adding [su]\d+ and f\d+ as synonyms for those mentioned stdint.h?

Since char is signed on most platforms, arm eabi being an exception and even there it's really just a matter of compile time flags, will you ever just drop char from being able to be either and just say it's signed, as int is also signed?

Will you ever define / have you considered defining signed overflow behaviour?

Re: Tell HN: C Experts Panel – Ask us anything about C

#37

What's up with `strlcpy` and `strlcat`? Are they getting standardized?

No one has proposed making these standard. I doubt they would gain much support as they are similar to the Annex K Bounds Checked Interface functions strcpy_s and strcat_s but not quite as good IMHO.

Re: Tell HN: C Experts Panel – Ask us anything about C

#38
I'd love your opinion on the abundance of "undefined behaviour" (as opposed to implementation-defined, or some new incantation such as "unknown result in variable but system is safe") for relatively trivial things such as signed (but not unsigned) integer overflows. I've heard that this is to allow for non-twos-complement implementations. However, in practice, you notice that most people use ugly workarounds which lead to ugly code that (because of e.g. casting to unsigned and allowing the same overflow to happen anyway) only work correctly on twos-complement anyway. Is this intended to be addressed in the future in some way?
Post reply on HN