3 ms·
Except it is easier to introduce a new programming language than having a committee driven language to adopt a new standard library. Neither ISO nor OpenGroup
by pjmlp 2y ago
Except it is easier to introduce a new programming language than having a committee driven language to adopt a new standard library.
Neither ISO nor OpenGroup would care about it.
Remember that since 1989, no actions were taken to improve its security.
Even the few functions that have been added still use pointer/length pairs without any means to validate they are the correct pair.
- Someone 2y ago> Remember that since 1989, no actions were taken to improve its security. Not much, but not nothing, either. gets was deprecated in C99 and removed in C11 (https://en.wikipedia.org/wiki/C_file_input/output#gets https://en.wikipedia.org/wiki/C_file_input/output#gets)
- pjmlp 2y agoYet the scanf and fgets possible exploits are still there.
- rdpintqogeogsaa 2y ago> Remember that since 1989, no actions were taken to improve its security. Technically, gets() was removed from the standard library in C11[0]. However, that is far from a semantically meaningful overhaul of the standard library. I nonetheless felt the need to point out that there was a very specific effort for the sake of completeness. [0] https://en.cppreference.com/w/c/io/gets https://en.cppreference.com/w/c/io/gets
- pjmlp 2y agoWhich is great, except for all those stubborn folks not using anything beyond C99, and scanf and fgets are still possible attack vectors, when getting sizes wrong.
- ctoshiningc 2y agoHave you tried talking to them?
- nine_k 2y agoCreate a language with semantics exactly like C, but the standard library completely replaced. Call it in a way that avoids trademark disputes (e.g. CWSL, C With Sane Library). Get GCC and LLVM support it, which should be reasonably easy, because both support compiling code that does not rely on libc (though OS entry point code, etc should be wired in). Would it be easy enough to port important C code to it, given that most of the libc-supplied functions, and functions transitively depending on these, would have to be rewritten? Would it be worthwhile, compared to rewriting such code it in Zig, Rust, or Ada?
- pjmlp 2y agoThere have been multiple attempts at this, how many folks heard of Safe-C, C3,... ? Only bothering to list two examples, there are many others, even Cyclone is partially C compatible, guess what came out of Cyclone.
- oguz-ismail 2y ago>Safe-C import statements are a deal breaker >C3 shit syntax >Cyclone vaporware
- MyOutfitIsVague 2y agoWhy in the world would import statements be a deal breaker?
- oguz-ismail 2y ago> The .h and .c files of a component must always be stored in the same folder so that the compiler can find them
- pjmlp 2y agoLearn to use your compiler switches.
- 2y ago
- chrsig 2y agoeh, i think i disagree. a new stdlib on its own wouldn't come with a lot of abi/linking baggage that tends to hold up tooling and migrations when you start introducing a different language. (see recent rust/linux drama). i mean, if the committee members can make it happen or not, i don't know. but it's still a worthy thing to explore, I think. there's going to be a lot of C code that will need a very gradual migration path to safer apis for a very very long time.