4 ms·
But now we're timing an optimizing compiler, and not an interpreted program of 1 million lines. I understand that you couldn't generate a program of 1 million l
by jvanderbot 7y ago
But now we're timing an optimizing compiler, and not an interpreted program of 1 million lines. I understand that you couldn't generate a program of 1 million lines, but still, I would expect compilation to take longer than execution for just about any non-looping program. Again, I am missing the direction of this discussion.
Compilation is technically NP-Hard, meaning it scales very poorly, as you described, whereas interpretation is not (no register allocation, etc).
https://cs.stackexchange.com/questions/22435/time-complexity-of-a-compiler https://cs.stackexchange.com/questions/22435/time-complexity...
- glofish 7y agothe main purpose of the exercise was to explore what happens when you throw 1M lines of code to a language, our estimates to what happens could be wildly inaccurate, I was pleased with Python finishing in 5 seconds because I thought it might not even work at all due to some internal implementation detail that I was not aware of - like the ruby example that fails with a stack error. I am pleased to see that Python can handle it. As for the GCC compilation I find it quite unexpected that it compiles 10K lines in just 0.3 seconds, but then seems to hang on 100K lines. Not so easy to explain.