Questions tagged [compile-time]

For challenges involving doing something at compile-time, rather than run-time. This means that only compiled languages can compete.

-3
votes
8answers
449 views

“Hello, World”, Even before it runs

Warning: This challenge is only valid for languages with a compiler. Make a program (which is perfectly valid code) that outputs Hello, World, even before runtime. ...
146
votes
25answers
18k views

Shortest Code to Legitimately Slack Off

I'm a developer, and I don't feel like doing my work. I know from XKCD that the best excuse for slacking off is that your code's compiling. Because of this, I think I need some code that will compile ...
0
votes
4answers
704 views

Enhanced Builder Pattern, verified at compile time [closed]

Question: can you design a Builder Pattern API which verifies at compile time that every field is set exactly once? To be eligible, the size of the compiler output should not be exponential in the ...
367
votes
17answers
79k views

Build a Compiler Bomb

Introduction You're probably familiar with zip bombs, XML bombs, etc. Put simply, they are (relatively) small files which produce enormous output when interpreted by naïve software. The challenge ...
49
votes
7answers
6k views

1 character typo generating most error messages from C++ compilation

It seems that simple changes to a C++ file, especially with templates, can generate pages of errors. This contest is to see what the largest "bang of the buck" is, that is the more verbose error ...
22
votes
6answers
1k views

Bloatware contest: producing 100+ MiB executable [closed]

Create short source code in your favourite compiled language that compiles into a big (not less than 104857600 bytes) executable file. The program must be runnable (assuming 1GB of free memory) and ...
1
vote
1answer
450 views

Generate numerical permutations with conditions and template metaprogramming

This, but via template metaprogramming: template <int n> struct insanity { int[][n] permutations; } Generate all numbers with n digits (0-9) such that each ...
43
votes
26answers
6k views

Crash your favorite compiler [closed]

Write a perfectly legal code in a decent language of your choice whose compiling will either crash the compiler or send it into an infinite loop (infinite compile time). Restrictions: Use a standard ...
16
votes
8answers
9k views

Compute the CRC32 table at compile-time [closed]

The reference implementation of CRC32 computes a lookup table at runtime: ...
39
votes
5answers
6k views

Solve the eight queens problem at compile-time [closed]

Can you solve the eight queens puzzle at compile-time? Pick any suitable output format. I'm particularly interested in a C++ template metaprogramming solution, but you can use languages that have ...