Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for December 5, 2013
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
LLVM 3.0 released
Posted Dec 7, 2011 20:22 UTC (Wed) by k8to (subscriber, #15413)
You mistake something that you believe to be a debating point for something that can actually be debated.
Posted Dec 7, 2011 23:08 UTC (Wed) by daglwn (subscriber, #65432)
That's not bad. That's progress.
Posted Dec 8, 2011 8:27 UTC (Thu) by thedevil (subscriber, #32913)
Extremely dubious. I am sure you can come up with examples (both before and after) yourself.
To make it even close you'd need to add a qualifier like "... that is mostly compatible with C". Even then it is not a closed case.
Posted Dec 9, 2011 16:48 UTC (Fri) by daglwn (subscriber, #65432)
None that I know of. Not even without the "compatible with C" qualifier. Perhaps there is an esoteric project somewhere that does this but certainly no other mainstream language. C++ doesn't have every language feature possible but it does have a unique combination of them.
Posted Dec 10, 2011 3:33 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
Alas, no real manual memory management.
Posted Dec 12, 2011 4:20 UTC (Mon) by daglwn (subscriber, #65432)
Posted Dec 10, 2011 9:33 UTC (Sat) by paulj (subscriber, #341)
Posted Dec 12, 2011 4:18 UTC (Mon) by daglwn (subscriber, #65432)
Vala is cool. I definitely see the value in it. But it isn't a replacement for C++.
Posted Dec 12, 2011 7:17 UTC (Mon) by paulj (subscriber, #341)
Vala has generics. I'm not sure what aspect of C++ templates you miss, but I sure don't miss the multiple-pages or more of incomprehensible error messages that are inherent to even minor mistakes with C++ templates. ;)
Vala is statically typed, not sure why you'd think otherwise (it allows type inference of LHS in assignments with "var x = y;" - a handy convenience, and still statically typed).
Posted Dec 12, 2011 10:11 UTC (Mon) by mpr22 (subscriber, #60784)
As that page describes it, Vala allows you to inherit at most one class and any number of interfaces (and the page explicitly says that it's a restricted form of multiple inheritance). C++ allows you to inherit multiple concrete classes. (It happens to be the case that I've never encountered a case where I thought I had a reason to use this capability, but I am not every C++ programmer.)
Posted Dec 12, 2011 10:38 UTC (Mon) by paulj (subscriber, #341)
Posted Dec 8, 2011 9:29 UTC (Thu) by k8to (subscriber, #15413)
Posted Dec 13, 2011 18:39 UTC (Tue) by dgm (subscriber, #49227)
Both are Turing-complete, and thus are equivalent in power (as in what you can write with them). Maybe you wanted to use the term "expressive", but that's not very well defined (http://en.wikipedia.org/wiki/Comparison_of_programming_la...). In fact, according to that article, Python, Smalltalk and Perl are more expressive than C++ (and much more than C).
Posted Dec 13, 2011 20:17 UTC (Tue) by nybble41 (subscriber, #55106)
 See also: "Turing tarpit" <http://en.wikipedia.org/wiki/Turing_tarpit>
Posted Dec 13, 2011 21:27 UTC (Tue) by mathstuf (subscriber, #69389)
Haskell has Template Haskell (it's an extension, but since GHC is pretty much the only compiler for Haskell, that's pretty much moot).
Posted Dec 13, 2011 21:49 UTC (Tue) by nybble41 (subscriber, #55106)
Posted Dec 14, 2011 1:14 UTC (Wed) by dgm (subscriber, #49227)
Posted Dec 9, 2011 16:33 UTC (Fri) by HelloWorld (subscriber, #56129)
Posted Dec 10, 2011 2:46 UTC (Sat) by rgmoore (subscriber, #75)
To some extent, simplicity is in the eye of the beholder. Code that uses the extra expressiveness of a more feature rich language can be shorter and easier to read and write, but only within limits. It may be easier to read or write one fancy function instead of three simple ones, but only if you remember what the fancy function does. As soon as you expand your vocabulary beyond what people can remember, you waste more time looking through documentation than you save by making things more compact. Of course "what people can remember" varies from person to person, but the rare function call that sends people scurrying to figure out what it does is a real danger of a big language.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds