What extension would you like to see in the next C standard?
There are some interesting new proposals for what will likely become c23. Some I like:
- true and false as first-class language features: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2655.pdf
- a fundamental type for N-bit integers: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2646.pdf
- auto, closures and lambdas: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2638.pdf
- preprocessor embed to include binary files: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2592.htm
- typeof: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2593.htm
- defer: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2542.pdf
What else would you like to see in the next revision of the C programming language?
I would prefer if the committee devoted their efforts to making C easier to use correctly - defining undefined or implementation defined behavior, requiring stronger diagnostics, and forbidding optimizations that regularly cause issues.
I would like to see some of the features that GNU C has, such as zero-length arrays, typeof (which you mentioned there already), fopencookie, etc. A preprocessor command to include binary files is also a feature I thought of wanting in C, so it is good if they will add that too.
Actually, I can think of some more:
- "goto case" and "goto default"
- Using ?: with nothing in between, like GNU C does. This is a feature I often use.
A “defer” statement like in Go. Would remove the need for a bunch of goto.
I want to ask this question here because I feel like many of the viewers will be proponents of C and I want to hear your perspective. Why would someone choose C as a language of choice for a new project over Rust (or some other comparable language with memory safety guarantees)? Will/can C ever address the memory safety issues?
(I’m looking for honest dialogue and not trying to be combative)
Multiple returns. I've always thought just adding pointer params was kind of an ugly hack.
Function overloading and default parameters. They're just too nice not to have.
Closures and lambdas (mentioned)