XProc execution model

Hi.

There is something in the XProc specification that I hadn't noticed before
and that was kind of surprising to me. I apologize in advance if this has
been discussed many times before.

The spec says:

Unless otherwise indicated, implementations must not assume that steps are
> functional (that is, that their outputs depend only on their inputs,
> options, and parameters) or side-effect free.
>

Without ever having actually checked it in the spec, I was in the belief
that engines had the choice to omit parts of a pipeline that are not needed
to compute the requested outputs. I just assumed.

This would give you a nice way to do optional stuff in a pipeline, based on
whether a certain output port is connected. If you are not interested in an
output, don't connect the port and it will also not be computed. This is a
feature I would use extensively. Has this ever been considered or discussed?

Would it be a good idea to add an attribute (e.g. pure=true|false) on steps
to control the behavior (to indicate whether it is a pure function)? Or are
there maybe already extension attributes for it? Would it be easy to do?

Thanks,
Bert

Received on Thursday, 28 May 2020 18:49:11 UTC