operations that are commutative but exhibit radically different performance characteristics if the arguments are swapped
I feel like a recurring issue in programming is:
- From a correctness and flexible-execution perspective, it’s preferable if you can specify things “declaratively”, i.e., in a way that very minimally communicates the constraints and properties, rather than just providing instructions to the computer.
- From a real fucking life perspective, you almost always want control over execution details, otherwise you will be shadowboxing with an evil compiler or query planner that is constantly doing things in unexpected ways, with no escape hatch.
Very very difficult to achieve both simultaneously. Halide at least tries this idea, splitting the correctness-specification from the optimization-specification, but I don’t have any experience with how easy or successful it is at this.
when we solve this we destroy programming as a discipline, so bit of a cursed quest item really.