[m-rev.] for review: move char_to_doc to pretty_printer.m

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Dec 20 11:23:33 AEDT 2022


2022-12-20 11:15 GMT+11:00 "Julien Fischer" <jfischer at opturion.com>:
> So essentially what you are proposing is that to_doc predicates for builtin
> types be defined in pretty_printer.m?  That's fine by me.

Yes, that is what I am proposing.

> I would note that the only reason that pretty_printer.m seesm to import
> a lot of above modules is to initialise the default formatter map.
> Another way of addressing the problem may be to initialise that map
> in the stdlib initialisation code in library.m (which necessarily
> imports all the relevant modules anyway).

That addresses *a* problem, but not the one I and Peter are targeting,
which is the huge SCC in the .trans_opt dependency graph of the
library modules. Having e.g. int.m import pretty_printer.m means that
every library module that needs to increment an int by 1 depends on
pretty_printer.m through int.m. My diff does not fix this immediately,
but sets it up to be fixed when the forwarding functions are deleted.

By the way, I am just now moving the intN_to_doc functions
from intN.m to pretty_printer.m, and I noticed that the default
formatter map has entries for int and uint, but not intN and uintN.
I presume that is an oversight, and not a deliberate choice.

Zoltan.


More information about the reviews mailing list