4 ms·
Things like this make compiler or jit optimizations a little scary to me. It might not matter to a CSS preprocessor, but if you write performance critical code,
by adrianN 11y ago
Things like this make compiler or jit optimizations a little scary to me. It might not matter to a CSS preprocessor, but if you write performance critical code, optimizations become a leaky abstraction. Suddenly you have to understand exactly which circumstances allow your compiler to, for example, use autovectorization and be wary of updating your compiler, lest these criteria change.
I think there is some opportunity here to improve compiler output. I know that GCC can already explain why it doesn't vectorize loops (-ftree-vectorizer-verbose=2), but many other optimizations without such output can still make or break the performance of your program.
- hvidgaard 11y agoI pretty sure halting problem reduces to figuring out code reordering and optimization like that. We cannot solve it exhaustively, so instead we do the next best thing, approximate and provide a common case. I agree that it's not optimal, but it's the best we can do.
- adrianN 11y agoObviously it's impossible to perfectly optimize every time. I would just like some more diagnostics from the compiler that help me debug issues with wrong of missing optimizations.
- semi-extrinsic 11y agogcc has a flag "-Wuninitialized" that warns about possible use of an uninitialised variable. It frequently yields false positives, because it's an approximation; a general "detect all uninitialized variables" algorithm can solve the halting problem. http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
- lmm 11y agoI think what we'll end up with is languages that make it easier to be explicit about what you need. We're already seeing this happening with computer graphics, where the likes of Vulkan are in some sense lower level than OpenGL, but make it easier to understand when you're using the fast path or not. I see similar aspects to Rust, and even Haskell's recent introduction of a strict pragma.