|
|
Subscribe / Log in / New account

LLVM 3.0 released

LLVM 3.0 released

Posted Dec 7, 2011 3:24 UTC (Wed) by k8to (guest, #15413)
In reply to: LLVM 3.0 released by daglwn
Parent article: LLVM 3.0 released

Regardless of opinions, the statement is merely factual on the basis of complexity. No need to treat as bait.


to post comments

LLVM 3.0 released

Posted Dec 7, 2011 15:39 UTC (Wed) by daglwn (guest, #65432) [Link] (19 responses)

It is not factual at all. It is opinion. One person's "complexity" is another's "complete specification."

LLVM 3.0 released

Posted Dec 7, 2011 20:22 UTC (Wed) by k8to (guest, #15413) [Link] (18 responses)

Believe it or not, it's really quite factual that C++ has a higher level of complexity than C. From any point of view at all. Syntax tree, feature set, number of possible combined keywords, conceptual domain, application, space, ... there's really no aspect where it isn't true. Similarly a mandelbrot outline has a higher level of complexity than a circle.

You mistake something that you believe to be a debating point for something that can actually be debated.

LLVM 3.0 released

Posted Dec 7, 2011 23:08 UTC (Wed) by daglwn (guest, #65432) [Link] (15 responses)

Of course C++ is more complex than C. It's more powerful. The implication of the original message is that this complexity is bad. It's not bad. It simply is. C++ allows a kind of expressivity not achieved before nor since by any other language. That doesn't mean it's the best language for every job, but simply that it aggregates and unifies a bunch of features in novel and unique ways.

That's not bad. That's progress.

LLVM 3.0 released

Posted Dec 8, 2011 8:27 UTC (Thu) by thedevil (guest, #32913) [Link] (8 responses)

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

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

LLVM 3.0 released

Posted Dec 8, 2011 9:29 UTC (Thu) by k8to (guest, #15413) [Link]

Whether these adiditional aspects of complexity are worth it are a mattter of significant deabate, and not likely to be resolved here. I do not mean to try to resolve that matter here. I appreaciate that you have shown acceptance that the factual matter is indeeed factual. Adding the kitchen sink to C (as with C++) results in a remarklaably more complex language. It may be worth it. I don't personally believe it is, but I have preciously little objective basis for this judgement.

LLVM 3.0 released

Posted Dec 13, 2011 18:39 UTC (Tue) by dgm (subscriber, #49227) [Link] (4 responses)

> Of course C++ is more complex than C. It's more powerful.

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

LLVM 3.0 released

Posted Dec 13, 2011 20:17 UTC (Tue) by nybble41 (subscriber, #55106) [Link] (3 responses)

Both C and C++ are Turing-complete[1], but AFAIK only C++ has a built-in Turing-complete metaprogramming interface at compile time in the form of templates. That can reasonably be considered an extra measure of power. (Retaining one's sanity while attempting any complex computation with C++ templates is left as an exercise for the reader.)

[1] See also: "Turing tarpit" <http://en.wikipedia.org/wiki/Turing_tarpit>

LLVM 3.0 released

Posted Dec 13, 2011 21:27 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (1 responses)

> only C++ has a built-in Turing-complete metaprogramming interface at compile time in the form of templates

Haskell has Template Haskell[1][2] (it's an extension, but since GHC is pretty much the only compiler for Haskell, that's pretty much moot).

[1]https://en.wikipedia.org/wiki/Template_Haskell
[2]http://www.haskell.org/haskellwiki/Template_Haskell

LLVM 3.0 released

Posted Dec 13, 2011 21:49 UTC (Tue) by nybble41 (subscriber, #55106) [Link]

Sorry, I didn't mean "only C++" in that sense. I was only considering C and C++. Other languages do have decent metaprogramming facilities as well, some (IMHO) much better than C++ templates. Lisp macros, for example, or Scheme's syntax expanders. D's more flexible template system ranks highly as well, though the syntax isn't quite as consistent and it relies on parsing generated strings, rather than constructing syntax objects directly.

LLVM 3.0 released

Posted Dec 14, 2011 1:14 UTC (Wed) by dgm (subscriber, #49227) [Link]

Very interesting reading. I came to the conclusion that C++ templates could be considered a meta-Turing tarpit.

LLVM 3.0 released

Posted Dec 9, 2011 16:33 UTC (Fri) by HelloWorld (guest, #56129) [Link] (1 responses)

> Believe it or not, it's really quite factual that C++ has a higher level of complexity than C.
Yes, but does that matter? Personally, I don't care too much about language complexity, I care about the complexity of software written in a language, and C tends to make even simple things harder than they need to be.

LLVM 3.0 released

Posted Dec 10, 2011 2:46 UTC (Sat) by rgmoore (✭ supporter ✭, #75) [Link]

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 © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds