
The Grand C++ Error Explosion Competition - rahimiali
https://tgceec.tumblr.com/post/74534916370/results-of-the-grand-c-error-explosion/
======
DoofusOfDeath
One of my main complaints about C++ metaprogramming is that its evaluation can
be as complex as the runtime behavior of a normal program, but AFAIK no
compiler provides metaprogram _debugging tools_. E.g., execution tracing or
single-step debugging of metaprogram execution.

Anyone know of good tools of this nature for gcc and/or clang?

~~~
dymk
Yes, Templite and Templar: [https://baptiste-wicht.com/posts/2016/02/use-
templight-and-t...](https://baptiste-wicht.com/posts/2016/02/use-templight-
and-templar-to-debug-cpp-templates.html)

------
shakna
> We also tested this with Clang, which detects correctly the missing
> semicolon, after which it anyway tries to evaluate the infinite template
> recursion and eventually segfaults

When you break the compiler with a list of errors, you've successfully hung
the programmer out to dry.

------
rwmj
I really hope the first thing Automattic do when they acquire Tumblr is to
kill that ridiculous OAuth splash screen.

~~~
froh42
So if it annoys you, why do you still surf their site? I shift my attenton to
sites which treat me fairly (and so I do with them. tit for tat).

~~~
rwmj
I don't - and it seems millions more people have turned away too, given the
precipitous drop in their audience and valuation. It was just in this case I
didn't notice the link was to tumblr before I clicked on it.

------
trollied
If you like this sort of thing, you'll probably enjoy The International
Obfuscated C Code Contest. [https://www.ioccc.org](https://www.ioccc.org)

Winning entries:
[https://www.ioccc.org/years.html](https://www.ioccc.org/years.html)

I quite like self-generating progs, eg:
[https://www.ioccc.org/1990/scjones.c](https://www.ioccc.org/1990/scjones.c)
[https://www.ioccc.org/2000/dhyang.c](https://www.ioccc.org/2000/dhyang.c)

------
notacoward
Worth noting that the preprocessor made this so easy that they had to create a
separate division, and templates made it easy for most of the rest. Future
language designers, take note.

------
ajross
Sort of hilarious here, given the premise of the competition (that C++ has
outrageously long error messages), that the winner is exploiting the
preprocessor and not C++ at all.

------
martincmartin
_Extra credit for using Perl, which is the only language less readable than
C++ templates._

~~~
Ballas
I almost burst into laughter reading that!

------
jedisct1
Rust Futures: hold my beer.

------
WesternStar
I suppose the fact they stopped doing this 4 years ago says something good
about current c++.

~~~
persistent
Color template errors are the greatest leap in the history of computer
science. No longer do I need to scan megabytes of output to find the
unexpected |unsigned| in the fifth level of a template expansion.

[https://clang.llvm.org/diagnostics.html](https://clang.llvm.org/diagnostics.html)

------
kazinator
_Creative Computing_ magazine had a competition like this in the 1970's:
provoke the most compiler diagnostics with the least code type of thing.

------
watt
(2014)

Fascinating stuff!

------
Ididntdothis
When I did more C++ i found it weirdly satisfying to get a few hundred or
thousands of errors during build and then fixing all of them with only a few
changes.

~~~
noncoml
When I was in college people would come to me to help them with their C++
compilation errors. My secret? Most of them would start trying to fix the
reported errors bottom up. I would start top down and be done with probably
one missing semicolon or something simple as that.

~~~
mikelward
I wish tools defaulted to only showing the first error.

~~~
cmroanirgo
In my experience, having a list to work through is much faster to remedy than
fixing one bug at a time, and then recompiling for the next bug. VB drove me
nuts for this simple reason.

~~~
Ididntdothis
Agreed. Maybe errors should get displayed in reverse order so you can work
your way up through the console window.

