This is another area where the functional logic language family is more powerful. There, we can loop over multi-valued choices (like little forks whose scope is limited to the enclosing loop) and gather all of their results in sequence through backtracking.
If the operational semantics of the language are documented, then a performance-focused programmer can learn the rules and understand (at least combinatorially) the expected performance of a block of code.
-
-
Knowing the operational semantics of such a language, we can optimize a function by adjusting the arrangement of its specification. This isn’t applicable to all kinds of functions, of course!
-
Right. And so the art is to balance clarity of the problem statement with the optimality of the implicit solution. It's a fine art, but I often reverse to decoupling those aspects: state the problem in a comment or a function name, and write an optimal solution in the body:)
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.