r/C_Programming • u/Jinren • Feb 23 '24
Latest working draft N3220
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf
Update y'all's bookmarks if you're still referring to N3096!
C23 is done, and there are no more public drafts: it will only be available for purchase. However, although this is teeeeechnically therefore a draft of whatever the next Standard C2Y ends up being, this "draft" contains no changes from C23 except to remove the 2023 branding and add a bullet at the beginning about all the C2Y content that ... doesn't exist yet.
Since over 500 edits (some small, many large, some quite sweeping) were applied to C23 after the final draft N3096 was released, this is in practice as close as you will get to a free edition of C23.
So this one is the number for the community to remember, and the de-facto successor to old beloved N1570.
Happy coding! 💜
View all comments
Show parent comment
2
u/Jinren Jun 06 '24 edited Jun 06 '24
Ah OK -
Martin Uecker is working on a feature enhancement that I think would fit with that model, with some new
_Typeand_Varkeywords that allow manipulation of types as values in a dynamic way: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3212.pdfTBH I don't know how I feel about this as a solution for polymorphism as it doesn't make a strong distinction between runtime and compile time (or rather, it's a runtime feature, that Martin thinks can still be useful with constant operands). I think we have a bit of work to do solving problems with dependent types in C before this will actually work as advertised, and that it basically generalizes the existing issues with knowing the static type of VLAs - not un-solvable, but needs significant "language infrastructure" improvement to be buildable. It definitely has other applications though.
My own preference is for completely statically-typed polymorphism: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2853.pdf (ignore the old name, that's still me)
I will be bringing this one back in September with a rewrite/extension. I belong to the school of thought that needing dynamic type information inside the function that uses the polymorphic behaviour means it wasn't strongly-typed properly in the first place, as this can always be passed in as a concrete operation rather than passing in an instruction for selecting an operation (which is what a type id is). See also https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3204.htm which is not really about overloading at all but has that title for... reasons, for an extended walk through my lunatic takes on the subject :P