3 ms·
The lesson here is that if you're designing an operating system, you should also be designing/evolving the programming language to go alongside it. The origina
by rwmj 9y ago
The lesson here is that if you're designing an operating system, you should also be designing/evolving the programming language to go alongside it. The original authors of Unix did this (developing C in parallel), and so have many more obscure OSes. This could have been written simply as 'max()' with appropriate modifications to the compiler to make it do the right thing.
- brianon99 9y agoThings have changed over the years. Even if the developers have patched gcc, or "own" gcc, linux still have to be built with gcc 4.4 otherwise many distro will have problems, so it does not solve the problem. Moreover, change the semantics of C as you have suggested will break other non-linux-kernele existing programs. There may exists programs depending on the K&R version of max with side effect. Who nows?
- mjw1007 9y agoI think asking the GCC developers for a builtin form of __is_constant would be a sensible step, so that the worst of those macros can eventually be retired.
- psyc 9y agoI'm 100% on board with this. I think big low-level projects, including AAA games (my field) would benefit by treating the compiler exactly like a dependency they have the source for. We might stumble on very good language evolutions as a side effect.
- kzrdude 9y agoDon't we risk losing something if everyone is using their own dialect of the language?
- psyc 9y agoI don't think so. But you're safe, nobody will do this.
- paulddraper 9y agoYes. IDE support, debugging, instrumentation, profiling, portability, community libraries.