Re:Ask HN: What would a better C look like?
by krapp on Saturday November 10, 2018 @07:48AM
(#18421117)
A better C would be C with a few features of C++: function and operator overloading and references. Also metaprogramming... maybe not exactly C++ templates but some sort of macros. Also lambdas.
I would also remove the distinction between 'class' and 'struct' and just have 'struct'.
I would add the bracket shorthand [] for arrays and {} for maps (and add a map type, maybe.)
And honestly, the more I think about it, the more a "better C" starts to look like a "better Lua," with the ability to return multiple values from a function.
I would also remove the distinction between 'class' and 'struct' and just have 'struct'.
I would add the bracket shorthand [] for arrays and {} for maps (and add a map type, maybe.)
And honestly, the more I think about it, the more a "better C" starts to look like a "better Lua," with the ability to return multiple values from a function.