3 ms·
Anyone who tries building a better C (for example Go) seems to end up going "too far", and as well as fixing the things you mention, ends up adding garbage coll
by CJefferson 15y ago
Anyone who tries building a better C (for example Go) seems to end up going "too far", and as well as fixing the things you mention, ends up adding garbage collection, and various other things which are not suitable for very low level systems programming.
I teach C, and I would love a "cleaner C" mode, which just got rid of lots of the bizareeness of C, several of which you mention. The fact that many compilers will warn with '-Wall' about code which is clearly incorrect, but due to the rules of C they cannot simply reject, is irritating.
- queensnake 15y ago(add -Werror - your students will never know.)
- pjmlp 15y agoFact is there are many examples of operating systems implemented with GC enabled systems languages. Spin, Oberon, Singularity, Home are just a few of them. The main problem is that for a systems programing language to be used a such, there much exist a successful operating system that uses it as its main language. In Windows 8, the main systems language is C++/CX (C++ with reference counting extensions), so the time will come.
- cygx 15y agoThe fact that many compilers will warn with '-Wall' about code which is clearly incorrect, but due to the rules of C they cannot simply reject, is irritating. The rules of C are actually stricter than many reople realize (add -std=c99 -pedantic-errors to gcc and you can get an idea about that -- this, however, still won't catch semantic errors like aliasing violations). Personally, I'm using clang with -Weverything and remove warnings as necessary. On gcc, there are a lot of useful warnings which are not included in -Wall. My current warning levels look like this: -std=c99 -pedantic -Werror -Wall -Wextra \ -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wpointer-arith \ -Wcast-align -Wwrite-strings -Wredundant-decls -Wcast-qual \ -Wnested-externs -Winline -Wno-long-long -Wconversion -Wstrict-prototypes