2 ms·
This is almost assuredly out of my league, but shouldn't it be fundamentally simple to have the compiler explain the optimizations and why it made them on the c
by DannoHung 18y ago
This is almost assuredly out of my league, but shouldn't it be fundamentally simple to have the compiler explain the optimizations and why it made them on the code, regardless of the deepness of the magic?
I mean, I suppose the onus then lies on the programmer to understand the why or how the optimizations work but (and again, going out of my league here) don't compilers fundamentally just perform state transformations once they're gotten the AST ready? Is it really that hard to have them, as an artifact of the compilation process, produce a plan showing the source and generated byte code or intermediate representation and the steps taken in getting from one to the other?
Not that any of this makes the SSC easier to build. But maybe some of the concern in relying on one could be relieved.
- jamii 18y agoThat would be helpful, but the problem is not so much that you don't know when an optimisation will happen but that its often a fragile condition. Seemingly trivial changes can wreak havoc on your performance. When using GHC I often end up with code that I just can't change without turning a 1MB process into a swap eating monster. The best thing about haskell is that encourages really clear, high-level code. Having to tiptoe around hard-to-predict performance bombs is definitely against the spirit of declarative code.