[m-dev.] shims

Mark Brown mark at mercurylang.org
Tue Sep 16 19:01:46 AEST 2014

On Tue, Sep 16, 2014 at 1:16 PM, Zoltan Somogyi
<zoltan.somogyi at runbox.com> wrote:
> On Tue, 16 Sep 2014 12:05:25 +1000, Peter Wang <novalazy at gmail.com> wrote:
>> Hmm, it should be possible to qualify names within a branch,
>> but if "branch sub-modules" are unnamed then it's a bit hard to do.
> I suspect that "a bit hard to do" is WAY, WAY underestimating
> the difficulty of implementing the proposals in this thread.

I think Peter was talking about user difficulty, not implementation difficulty.

> The compiler's current handling of the item list is much more
> complicated than it seems. I tried to clean it up once, and failed.

I, too, have seen this particular gorgon's head. (Thanks for reminding
me of that.)

There's a few points that I hope would mitigate the difficulty of

(1) These constructs are useless without clauses, so they can only be
used in the implementation section.
(2) The contents of the branches will be in the implementation section
of the sub-module; its interface will only contain generated code,
which can be handled specially.
(3) If necessary, the items allowed in branches can be restricted,
without harming the usefulness of the feature too much. Even if
initially just clauses were allowed this would still solve the
original problem.

Between them, they should mean that, amongst other things, far fewer
import_statuses need to be understood.

> If someone wanted to implement any of these proposals
> without first cleaning up the handling of item lists, there are
> only two outcomes:
> - They fail, probably after a lot of work. This is bad.
> - They succeed, after even more work. This is even worse,
>   as it means that whoever DOES clean up that code later,
>   will have more code to clean up, and until then, subtle bugs
>   have more places to hide.
> You may think I am joking. I am not.

I don't think you're joking. I think you are describing exactly what
happened when sub-modules were added to the module system. :-(


More information about the developers mailing list