2 ms·
Haskell isn't really faster than C - that is, once you know the problem I could write a C program faster[1] than yours and it wouldn't be "carefully handwritten
by astrange 10y ago
Haskell isn't really faster than C - that is, once you know the problem I could write a C program faster[1] than yours and it wouldn't be "carefully handwritten optimized C" as much as "kind of casually handwritten C".
(If this is an object-manipulating program and not a numeric one, substitute another language so I don't have do memory management.)
The issue is that magic high-level-compiling compilers can't be developed because nobody has time to wait for their compile to finish. This is also why JIT never really optimizes very hard.
[1] or more importantly, less memory-using and live profiling tools and gdb will work.
- joosters 10y agoPlenty of people would love to give their compiler time to optimise, in fact they already do, with hours-long build times of some projects. I don't think compile time is the thing holding back compiler development, after all, every time-consuming optimisation can be put behind a command-line switch to allow those who want it to use it, and those who want a fast compile can go without.
- astrange 10y agoI think you'll run into a problem where your optimizations are time-consuming but not actually productive. When you're going low-level like in C, optimizations are famously useless on x86 - you can barely tell if most programs are running at O0 or O3. Going higher level, they should help, but it's really an interactive process so a fast compile/run cycle is still important. You want to know how well the optimizer understands your program and which idioms are safe to use.