Description
One issue that I've begun to run into recently is the fact that the default dhall
command (i.e. no subcommand) reserves stderr
for printing the inferred type of the expression. This prevents the executable from emitting useful information to stderr
for successful runs.
For example, the next release of the standard will say:
An implementation SHOULD warn the user if the interpreter is unable to cache the expression due to the environment variables being unset or the filesystem paths not being readable or writeable.
The natural place to put that warning would be stderr
but that would cause issues for people expecting stderr
to contain the type.
Similarly, at some point we might want to provide download progress indicators for remote imports and the natural place for that would also be stderr
.
Currently, users can use the dhall type
subcommand to programmatically retrieve the inferred type of an expression, so there is less of a need to include the inferred type in the default command's output.
So I'm going to propose a few solutions to this problem so that we can include useful diagnostic information in stderr
:
- Omit the inferred type from
stderr
entirely for the default command (i.e. reservestderr
exclusively for debug output and reservedhall type
as the exclusive way to infer the type) - Keep the inferred type, but comment out other debug output sent to
stderr
so that one can still capturestderr
as a valid Dhall type - Keep the inferred type, but don't guarantee that
stderr
still reflects a valid type if there is debug output
My inclination is for the second option (comment out debug output), but I'm open to other ideas