4 ms·
I’d like it to just look exactly like C, but with new ideas in some incompatible syntax showing it is not part of C.
by hyperhello 3y ago
I’d like it to just look exactly like C, but with new ideas in some incompatible syntax showing it is not part of C.
- all2 3y agoZig? Or Nim? Both of those are Algol-ish. Ooh! What about [0]? Gambit Scheme has what they call `six-script` which is essentially a refactoring of Scheme grammar to fit into an Algol-esque syntax. [0] http://gambitscheme.org/latest/manual/#GSI http://gambitscheme.org/latest/manual/#GSI, see section 2.6.1
- hardwaregeek 3y agoEhh C is a pretty miserable language to parse. No function definition keyword means you have to get pretty far to realize that you're parsing a function. Pointer syntax is ambiguous with expression grouping. And let's not even get started with the preprocessor. I'd say a good model for simple syntax is Go. Rust has a nice compromise of syntax too, but there are some awkward edge cases.
- jimbob45 3y agoShame they never fixed this. Would have been nothing to add a fn keyword at the beginning of all function definitions and then use the MS EEE strategy to bring it into the standard. Of the many changes the committee could make with C, I have to believe a function keyword would be among the least contentious.
- hardwaregeek 3y agoProbably couldn’t since people could have named functions “fn”. Although idk, one keyword breaking in 50 years is probably excusable
- lelanthran 3y agoWell they didn't mind trampling all over symbols that start with 'str', which is bigger breakage in my opinion, so they could have added a function keyword.
- __d 3y agoLeast, perhaps? But certainly contentious. In my view, the job of the C committee should be to eliminate undefined behaviour and any remaining specification ambiguities (or errors) and otherwise leave the damned language alone. If you want a new language every 3 years, you can always use C++.