Here's a link of the output image: https://imgur.com/cUdForu
It's 64x64.
$ pbpaste | time clang -x c -
99.35 real 82.72 user 9.94 sys
If you're using iTerm, you can pipe the output of the program to imgcat to see the result without leaving your terminal.thought it was just my notebook :) think it is the longest my machine spent on just 41 lines of code to compile
That said I absolutely don't disagree with you at all. It's really a bit silly C doesn't have it at this point. `gcc` will happily do all of this math for you at compile time even if you do as much of the math as you can in `static` functions. But to make it compile you have to declare `pixels` in `main` because you can't call the functions in the initializer for file-scoped variables - even though the compiler can already optimize them out.
yes, some people have written entire constexpr raytracers for instance : https://github.com/tcbrindle/raytracer.hpp
More to the point, constexpr would be a heck of a lot more efficient - changing M4 to M5 increases the preprocesed size from 80 MB to 240 MB. This is an exponential increase, despite that a Mandlebrot pixel can be computed in linear time. (Linear to the maximum number of steps.)
I suspect that this is because if you write a macro and use your macro argument twice, this doubles the length of whatever your macro argument was.
The pre-processor outputs 76,385,728 chars on 546 lines
"virtual memory exhausted: Cannot allocate memory"
when trying to compile :/