|
|
Subscribe / Log in / New account

LLVM 3.0 released

LLVM 3.0 released

Posted Dec 8, 2011 8:27 UTC (Thu) by thedevil (guest, #32913)
In reply to: LLVM 3.0 released by daglwn
Parent article: LLVM 3.0 released

"C++ allows a kind of expressivity not achieved before nor since by any other language"

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.


to post comments

LLVM 3.0 released

Posted Dec 9, 2011 16:48 UTC (Fri) by daglwn (guest, #65432) [Link] (7 responses)

What other language aggregates inheritance, exceptions, fully generic programming and pattern matching AND specifies their interactions completely?

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.

LLVM 3.0 released

Posted Dec 10, 2011 3:33 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link] (1 responses)

"D" does this and has much more powerful metaprogramming system.

Alas, no real manual memory management.

LLVM 3.0 released

Posted Dec 12, 2011 4:20 UTC (Mon) by daglwn (guest, #65432) [Link]

D isn't exactly mainstream, but I'll grant that it has some great ideas. Forced garbage collection is a huge drawback as you point out.

LLVM 3.0 released

Posted Dec 10, 2011 9:33 UTC (Sat) by paulj (subscriber, #341) [Link] (4 responses)

Vala does everything that I like from C++, without C++s innumerable odd cornercases or legacy cruft/baggage.

LLVM 3.0 released

Posted Dec 12, 2011 4:18 UTC (Mon) by daglwn (guest, #65432) [Link] (3 responses)

Vala is certainly interesting, but it doesn't do everything C++ does, even ignoring the legacy stuff. I know it may not be stuff that you need but it is stuff I use a lot. For example, there is no true multiple inheritance in Vala. There's no pattern matching of generic classes, hence no metaprogramming. There's not complete static typing, which IMHO is a huge loss when trying to use a language for very large projects.

Vala is cool. I definitely see the value in it. But it isn't a replacement for C++.

LLVM 3.0 released

Posted Dec 12, 2011 7:17 UTC (Mon) by paulj (subscriber, #341) [Link] (2 responses)

Vala does have multiple inheritance, or at least I don't see how its mixins are fundamentally any different:

http://live.gnome.org/Vala/Tutorial#Interfaces_.2BAC8_Mixins

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).

LLVM 3.0 released

Posted Dec 12, 2011 10:11 UTC (Mon) by mpr22 (subscriber, #60784) [Link] (1 responses)

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.)

LLVM 3.0 released

Posted Dec 12, 2011 10:38 UTC (Mon) by paulj (subscriber, #341) [Link]

So, it's perhaps a little hidden away in one sentence of the last paragraph of that interface/mixin section, but Vala interfaces may contain concrete implementations. I.e. Vala has multiple inheritance - the only difference in Vala is that the classes being inherited from must mark themselves as being comfortable with that (not a fundamental difference).


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds