Hacker News new | past | comments | ask | show | jobs | submit login
The Grand C++ Error Explosion Competition (tgceec.tumblr.com)
106 points by rahimiali 63 days ago | hide | past | web | favorite | 32 comments

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?

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

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

Just a detail: it is Oath (the company, https://www.oath.com), not OAuth (the open standard, https://en.wikipedia.org/wiki/OAuth).

They're probably the current champions in how to make opting out of tracking cookies maximally inconvenient. Although to their credit they at least seem to remember my choices instead of sneakily reverting back to "accept everything" after a while.

I can't find the opt out on mobile, so I just open incognito, accept and then close after reading. Truly garbage implementation.

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

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.

How else would I read this particular post?

Also it's not like Tumblr was like this when this post was, er, posted. It was pretty nice to browse.

It's poorly implemented too -- even if you're requesting a blog's RSS feed, Tumblr sends you that Oath screen unless your user-agent is on their list of approved RSS readers.

Im in the EU and I NEVER accept those GDPR message things.

Luckily this time outline worked and allowed me to read the article.

It’s for GDPR compliance.

They may claim that, but I don’t think it makes them GDPR-compliant. IMO, it’s in conflict with https://gdpr-info.eu/recitals/no-32/:

”If the data subject’s consent is to be given following a request by electronic means, the request must be clear, concise and not unnecessarily disruptive to the use of the service for which it is provided.”

and https://gdpr-info.eu/issues/consent/:

”The withdrawal must be as easy as giving consent.”

Well, it might not be compliant, but the splash screen is their attempt at compliance. It doesn’t show in the US.

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

Winning entries: https://www.ioccc.org/years.html

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

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.

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.

Extra credit for using Perl, which is the only language less readable than C++ templates.

I almost burst into laughter reading that!

Rust Futures: hold my beer.

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

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.


Creative Computing magazine had a competition like this in the 1970's: provoke the most compiler diagnostics with the least code type of thing.


Fascinating stuff!

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.

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.

Going top down seems to be the secret. I do mainly C# now but even there a lot of people get confused by looking at the last error on the screen. I always only look at the first error and deal with that before looking at anything else.

I wish tools defaulted to only showing the first error.

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.

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

If you have thousands of errors it is likely you simply misplaced a comma or semicolon. If you have just one error you are in deep trouble.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact