[m-dev.] making .trans_opt files in parallel

Peter Wang novalazy at gmail.com
Mon Dec 12 16:04:31 AEDT 2022


Hi,

I would like to fix the problem of .trans_opt files for the standard
library largely being made sequentially, instead of in parallel.

As a reminder, the standard library has a large cycle of modules that
import each other. The compiler imposes an arbitrary ordering on the
modules in the cycle so that "earlier" modules will not try to read from
the .trans_opt files of "later" modules before they have been made.
Thus the .trans_opt files can be made one by one, but not in parallel.

My idea is to introduce a mechanism to manually drop edges from the
.trans_opt dependency graph. For example, a pragma in module M of the
form:

    :- pragma no_trans_opt(foo).

would tell the compiler that it cannot read from foo.trans_opt
when making the M.trans_opt file.

A module's .d file contains a rule for the .trans_opt_date file
that both tells mmake when the .trans_opt needs to be regenerated,
*and* is read back by the Mercury compiler to tell it which
.trans_opt files it is allowed to read when making a .trans_opt file.

The pragmas would remove entries from the .trans_opt_date rule
(and perhaps that is enough?)

Zoltan, in reply to my previous message on this topic on 2019-08-05,
you wrote:

> What I have long wanted was the ability to *visualise* the cyclic (and other)
> dependencies graphically, with the info about *what* module A needs from
> module B being available if you click on the arrow between them.
> The compiler can now be asked to generate the info for the links;
> the visualization part is still missing.

Do you remember what information you were referring to?

Peter


More information about the developers mailing list