0
\$\begingroup\$

Hello guys (and girls).

I wanted to ask a question which looks like this:

"Write the shortest program which prints 'Hello World', which compiling time exceeds one second."

Problem is that compilation time depends on the machine, so my question is how to make it fair for everyone? I feel like this question is still interesting (compiler understanding), but I don't know if this is the true goal of PP&CG, so please tell me if it is as cool as I think it is, and if so how can we make it fair for everyone?

\$\endgroup\$
6
\$\begingroup\$

It seems a bit pointless to me. Printing Hello, world! is trivial, so the answers you get will consist of a function which does the actual behaviour and a not-really-used function with pathological compilation issues. E.g. I would approach this using an exponential type but probably not actually calling the exponentially typed function.

Alternatively, I could write a Java entry which uses compile-time annotation processing and simply make the annotation processor busy-wait for a second.

There may be some interesting answers, but most of them will probably be as boring as those two suggestions.

\$\endgroup\$
  • \$\begingroup\$ Yes I was interested in those "pathological compilation issues", not into the actual output of the program. I'll look into what you just said, and try to do it myself. \$\endgroup\$ – Fabinout Aug 8 '13 at 11:37
  • 1
    \$\begingroup\$ The exists a question where someone challenged us to get long compile times in c, but there was little interest and the the answers were only modestly interesting. Now, c doesn't allow most of tricks Peter is talking about, but there are other issues: c++ templates are Turing complete so you can build arbitrarily long compile times with them. \$\endgroup\$ – dmckee --- ex-moderator kitten Aug 8 '13 at 18:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .