ENIGMA Forums

General fluff => Off-Topic => Topic started by: luiscubal on September 11, 2010, 10:20:45 am

Title: Slow compile times for C++?
Post by: luiscubal on September 11, 2010, 10:20:45 am
Interesting: http://blog.mozilla.com/nnethercote/2010/09/10/another-go-at-language-design/

Quote
Compile times of Go programs are small.  This is because the compiler doesn’t need to know about transitive dependencies between packages (their name for modules). (...) He said with a completely straight face that their goal was to have a 1,000,000x speed-up over C++ for the compilation time of large programs, though they’d probably be satisfied with 100,000x.

I'd say that's a pretty ambitious goal for Go engineers...
It also makes the advantage of scripting languages(just run instead of first compile then run) much smaller.
Title: Re: Slow compile times for C++?
Post by: Rusky on September 11, 2010, 11:08:04 am
Scripting languages with JIT compilation use the same ideas. Using a JIT compiler for the bytecode of a static language would have impressive performance gains at compile time, load time and runtime.

But we all know that C++ is the best language, so that's a useless idea.
Title: Re: Slow compile times for C++?
Post by: Josh @ Dreamland on September 12, 2010, 10:22:08 am
Wow! Better compile AND load time?!
Still, they can't compete with C++'s sourceless residuum of grandeur.
Title: Re: Slow compile times for C++?
Post by: RetroX on September 12, 2010, 10:36:42 am
We should all use XML to code games.  It has a faster compile time... because you don't have to compile!  How cool is that!
Title: Re: Slow compile times for C++?
Post by: luiscubal on September 12, 2010, 11:20:10 am
@RetroX Lol.
@Josh Not sure where they claimed better load time, but it is, in theory, actually possible. C++ has lots of features and edge cases which make it hard to optimize(which is why C++ has volatile, const, mutable, alignof, novtable, nothrow, etc. - note that some of these are non-standard).
That said, it's possible to make a very efficient language, but I can not assure you that Go is that language.
Title: Re: Slow compile times for C++?
Post by: Josh @ Dreamland on September 12, 2010, 11:43:10 am
Oh, there's definitely room to be improved upon from C++. The language would be ten times better if they dumped most of the old, unneeded parts of the C spec. But to claim that a group of languages sharing on common trait is, in general, faster at compile, load, and run than languages of other groups, is asinine.
Title: Re: Slow compile times for C++?
Post by: luiscubal on September 12, 2010, 04:19:42 pm
@Josh If they dropped backwards compatibility, I have absolutely no doubt C++ designers could come up with something better. Unfortunately for newer C++ programmers, backwards compatibility is a critical part of C++'s success. Which is why I think the solution is having languages for older projects be backwards compatible and have incremental updates - like C++ - while investigating for the future.

Even if Java, C#, D, etc. fail(at this point, C# seems to be the one that's doing best, specially considering Oracle vs. Google), they meanwhile provided incredible feedback for the designers of new languages. The future of programming languages looks very interesting, and definitively more interesting than C++.

As an example of Go's simplifications, Go has pointers - but no pointer arithmetic at all! Not only this improves the safety of Go(harder to get segfaults), but it apparently simplifies other parts. On one hand, I have no doubt a C++-like language with this detail would enable the compiler to enable severe optimizations that would otherwise be unreliable. For Go this appears to simplify the GC's design, which in turn I have no doubt will allow the GC to be more efficient than it would otherwise be(and considering the problems of inefficient and buggy GC's...)
Title: Re: Slow compile times for C++?
Post by: RetroX on September 12, 2010, 05:30:20 pm
The language would be ten times better if they dumped most of the old, unneeded parts of the C spec.
I agree entirely.  And on top of that, the old functions should be coded to work with the newer spec, for example, string and iostream.
Title: Re: Slow compile times for C++?
Post by: Rusky on September 12, 2010, 05:40:32 pm
But to claim that a group of languages sharing on common trait is, in general, faster at compile, load, and run than languages of other groups, is asinine.
Of course. What I meant, more specifically, was:

Better compile time than a C/++-style system with header files,
better load time than a scripting language without pre-load processing and
better run time than a language with only static optimization.

Not better at all three than any one language or group.
Title: Re: Slow compile times for C++?
Post by: luiscubal on September 12, 2010, 05:58:53 pm
Quote
But to claim that a group of languages sharing on common trait is, in general, faster at compile, load, and run than languages of other groups, is asinine.
Do note that, when it comes to compile-time paradigm, Go is much closer to C++ than it is to Java or PHP.
It is, therefore, fully fair to compare Go to C++, while it would not be fair to compare PHP to C++ (at least when it comes to compilation speed).

Go is *NOT* a interpreted, not even JIT compiled. It is AOT, just like C++.
Title: Re: Slow compile times for C++?
Post by: RetroX on September 12, 2010, 07:19:23 pm
PHP is interpreted, though.  lol