@@ -24,27 +24,26 @@ The Benign library is an attempt to address this gap. A difficulty is
2424laziness. With laziness, things have a beginning (when the thunk is
2525being forced), but not a well-defined end. So what do we measure the
2626time of? The solution of the Benign library is to be less lazy. We
27- keep laziness for algorithms, but use strict (or at least stricter)
28- types to assemble bigger steps. It's fine to log or trace in pure
29- code, since we don't consider that these observations are part of the
30- semantics of the program.
27+ keep laziness for algorithms, but use evaluate more strictly when
28+ assembling bigger steps. It's fine to log or trace in pure code, since
29+ we don't consider that these observations are part of the semantics of
30+ the program.
3131
3232The Benign library provides facilities to create benign effects,
33- including to use strict types to assemble these large steps.
33+ including evaluation strategies to express precisely how strict we
34+ want to be.
3435
3536The premise underlying all this, as well as the implementation of the
3637library, is that logging or tracing is not very fast. So we don't want
3738to log or trace in places where performance is really essential. This
3839is why at the most inner level, where tight loops and algorithms live,
3940laziness is not a problem: we are not going to log there, this would
40- cost too much performance. At a more outer level, we can use
41- strictness to make steps with a beginning and an end. It's ok if there
42- is a cost in terms of conversion, this is not where we need to
43- optimise too much. The library can, and does, prevent optimisation
44- through its functions (note that cost-centre profiling also prevents
45- optimisation through cost centres; it isn't surprising that we are
46- having a similar problem). With the optimisation not working at that
47- level, strictness is much less of a problem.
41+ cost too much performance. The library can, and does, prevent
42+ optimisation through its functions anyway (note that cost-centre
43+ profiling also prevents optimisation through cost centres; it isn't
44+ surprising that we are having a similar problem). So benign effects
45+ all must happen at rather macro steps, where we don't have to worry
46+ too much about the impact of evaluation.
4847
4948## Backends
5049
0 commit comments