Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some of my "obvious things c should do" for me would include things like

- add support for a slice type that encodes a pointer and length

- make re-entrant and ideally threadsafe APIs for things that currently use global state (including environment variables).

- standardize something like defer in go and zig, or gcc's cleanup attribute

- Maybe some portable support for unicode and utf-8.



Aren’t most of these things you want in the standard library, and not things that the language itself should do?


Only half of them. The first and third are language things.

The first could almost be done with macros. Except that separate declarations of an equivalent struct are considered different, so the best you cand do is a macro you can use define your owne typedef for a specific slice type. It could be done in the library if c supported something like a struct that had structural instead of nominal typing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: