The most obvious use of laziness in everyday language is the if statement, where only one branch of a conditional expression is executed.
The opposite of a purely non-strict (lazy) language will be a purely strict language.
There is at least one case where “purely strict” is useful, namely, branch prediction .
Rough paraphrase of the related product:
Once upon a time in the world of processors, instructions for execution were loaded when checking the status of a branch. At some point, pipelines were added to reduce load times. The downside was that the CPU did not know which branch it needed to load, so by default it would load one. If the branch went the other way, the pipeline will stop while the code for the other branch is loaded.
The solution is to load both branches, execute both branches, then the result of the conditional expression indicates which branch result to save and which should be discarded. Then you do not get the conveyor.
This is my favorite (only?) Example of the benefits of strict language.
shapr
source share