Tell HN: C Experts Panel – Ask us anything about C
131–140 of 978 posts
Re: Tell HN: C Experts Panel – Ask us anything about C
#132How and why will C combat Rust?
Re: Tell HN: C Experts Panel – Ask us anything about C
#133Re: Tell HN: C Experts Panel – Ask us anything about C
#134Are there any plans to "clean up C"? A lot of effort has been put into alternative languages, which are great, but there is still a lot of momentum with C, and it seems that a lot of improvements that could be done in a backwards compatible way and without introducing much in the way of complexity. For example: - Locking down some categories of "undefined behaviour" to be "implementation defined" instead. - Proper ar…
I second this one. One of the best things from Rust is its "fat pointers", which combine a (pointer, length) or a (pointer, vtable) pair as a single unit. When you pass an array or string slice to a function, under the covers the Rust compiler passes a pair of arguments, but to the programmer they act as if they were a single thing (so there's no risk of mixing up lengths from different slices).
Re: Tell HN: C Experts Panel – Ask us anything about C
#135Re: Tell HN: C Experts Panel – Ask us anything about C
#136Is there a possibility there will be introduced a new rule saying "if the compiler detects an UB it should abort the compilation instead of breaking the code in the most incomprehensible way possible"? Right now it's just scary to start a new project in C. It would be really great if there was more emphasis on correctness of the produced code instead of the insane optimizations.
If you are concerned about safety there are ways to achieve that, like using MISRA C, formally verifying your C, or by writing another language like Rust.
Re: Tell HN: C Experts Panel – Ask us anything about C
#137What's the plan for C over the next 5 - 10 years?
Re: Tell HN: C Experts Panel – Ask us anything about C
#138What has been the rationale or hinderance for not adding locale-independent versions of various stdlib functions? Practically every second C codebase on earth has their own implementations of these at some point, and it remains a huge problem for e.g. writers of libraries, where you don't know how/where your library will be used.
Re: Tell HN: C Experts Panel – Ask us anything about C
#139Not a question, a request: Please make __attribute__((cleanup)) or the equivalent feature part of the next C standard. It's used by a lot of current software in Linux, notably systemd and glib2. It solves a major headache with C error handling elegantly. Most compilers already support it internally (since it's required by C++). It has predictable effects, and no impact on performance when not used. It cannot be imple…
FWIW, I don't think it would wind up being spelled with attribute syntax because we would likely want programmers to have a guarantee that the cleanup will happen (and attributes can be ignored by the implementation).
Re: Tell HN: C Experts Panel – Ask us anything about C
#140Big question, how to start programming in C on a high professional level for somebody self schooled in it? Is there a way to cut the corner, without having to go through 10+ years trial and error to gain experience?
Anything for somebody ready to sit, study, and practice for a few hours a day?