I want a language where I can "zoom in" on any expression and provide a custom implementation using a lower-level language (and zoom in on expressions in that language, and so on, all the way down to asm). Practical? Perhaps not. But it sounds super fun.
An inescapable downside of such a language would be that it would severely limit the compiler's ability to do whole-program optimization. E.g. you might think you're helping by writing inline asm, but actually the compiler could have proven that that block was unreachable anyway.
-
-
So it's certainly possible that such a language would typically result in slower programs. Compilers work best when given full reign with total context, and this language deprives them of that.
Show this thread -
However, compilers fail in one important respect: they can't read the programmer's mind and discern their *intent*, which often leads to "fighting the compiler." Ideally this language would have none of that. The compiler would be like your lab assistant, not your boss.
Show this thread -
Here's a fun thought: junior programmer writes a high-level version of a function, which works fine but runs slowly. Then they pass it on to the senior programmer, who compiles it to a lower-level language and hand-optimizes the generated code.
Show this thread -
(Then, they pass it to the greybeard, who compiles the low-level language to asm and hand-optimizes it into some Story-of-Mel-esque monstrosity.
)Show this thread -
But the cool thing is that all of these versions are interchangeable. If the greybeard introduced a bug, you can "rollback" to the senior version while you debug. Good tooling could make this painless.
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.