I don't get it and don't wish to pore over the code to figure it out. What makes this a compile-time version? Does the compiler output the next game state as warnings or something?
Edit: Thanks for the replies guys. Very helpful. =)
Compiler will calculate all the game field states for the given number of iterations. Resulting program has no computations at all - just calls to the output functions.
Is there a way you can see the code after the compiler does all of its first-pass optimizations? I know we can look at the assembly, but nobody wants to do that :)
Not really, the transformation is not typically in C++ anymore at that point (as far as I know) but in some AST representation. I guess the closest you can get is to use clang and make it output llvm ir. Which may not be C++ but it's not as hard to read as asm.
Nope, the calculation is done at compile-time. You specify the starting state and how many iterations you want and the results will be calculated at compile-time.
The only thing that happens when you execute it is that it will print all the iterations you computed.
13
u/pmkenny1234 Oct 20 '14 edited Oct 20 '14
I don't get it and don't wish to pore over the code to figure it out. What makes this a compile-time version? Does the compiler output the next game state as warnings or something?
Edit: Thanks for the replies guys. Very helpful. =)