How to design a replacement for C++
apenwarr.ca
How to design a replacement for C++
1–10 of 75 posts
Re: How to design a replacement for C++
#2For the second question, the article's answer is: kernels, drivers, highly performance-sensitive code like game engines, virtual machines, some kinds of networking code, and so on. And for me in particular, it also includes new plugins to existing C-based legacy systems, including Microsoft Office.
I think this is the first step to discussing "a replacement". I fear that every C++ programmer would give a different answer to each question.
The ideal replacement in the article can be summarised as most/all language features of C, plus some chosen subset of the features of C++.
Although with most of them implemented differently to how C++ has implemented them. Presumably that better implementation is to be done without compromising it's C-like qualities. Which sounds to me like the same trap that C++ itself fell in.
Re: How to design a replacement for C++
#3I personally prefer C + C libraries + the non-invasive suggestions which are mentioned which are already found in C++, Obj-C, etc.
Re: How to design a replacement for C++
#42. Hahahahahaha
3. Aside from the fact that his wording is backwards from his meaning, I agree that it should be possible to write code that doesn't ever garbage collect.
4. Ok
5. Does this guy know the function of a linker?
6. Again, he asserts something you are to avoid, when really he should be emphasizing what you need to support: code without runtime checks.
7. Wrong. This is one of the few opportunities you have to beat C at its own game. C hardcodes assumptions about the stack that prevent certain low level optimizations.
His #8 is then a summary of the entire article, and really is the only valid point he's made. C is close to a sweet spot for wrapping low level code in somewhat higher level clothing. You can't beat it at the same level of simplicity (not if you count the cost of any potential switch anyway). The way to beat C is to naturally support the high level / low level hybrid that he's doing with python+C in a single language.
Re: How to design a replacement for C++
#5Re: How to design a replacement for C++
#6 Maybe you like [lambdas], maybe you don't, maybe you think
they're God's gift to programming and any language
without them is an infidel. But adding them would be
harmless, anyway.
Well I agree on this point, it seems like a poor argument. You can't just declare a feature harmless if you ignore it. You make lambdas first-class and you end up baking them into libraries. Now you must use them.Otherwise no issues, but it does feel like the author is advocating C++0x minus heavy template metaprogramming - which is a perfectly fine language in my book. Why not just use that and get on with life?
Re: How to design a replacement for C++
#77. One-time declaration/definition of functions.
Aren't these in conflict? A C-style preprocessor is crippled without the header-file model. You'd do better to replace it with some other kind of metaprogramming.
Re: How to design a replacement for C++
#8I figure closures would be hard to do in a programmer-friendly way without GC.
Re: How to design a replacement for C++
#9I have two questions. Which qualities of C++ would one want to maintain in a replacement, and what is one using the replacement for? For the second question, the article's answer is: kernels, drivers, highly performance-sensitive code like game engines, virtual machines, some kinds of networking code, and so on. And for me in particular, it also includes new plugins to existing C-based legacy systems, including Micro…
Re: How to design a replacement for C++
#10I have two questions. Which qualities of C++ would one want to maintain in a replacement, and what is one using the replacement for? For the second question, the article's answer is: kernels, drivers, highly performance-sensitive code like game engines, virtual machines, some kinds of networking code, and so on. And for me in particular, it also includes new plugins to existing C-based legacy systems, including Micro…
The problem with C++ isn't so much that it's compatible with C or that you shouldn't pay for any features that you shouldn't use -- it's that they used the same dumb linker as C and so most advanced features are grossly limited and ended up as a twisty maze of text manipulation and includes.