[m-rev.] for (possibly post-commit) review: simplify the creation of .int files
Zoltan Somogyi
zoltan.somogyi at runbox.com
Mon Feb 18 18:42:49 AEDT 2019
On Mon, 18 Feb 2019 18:23:04 +1100, Peter Wang <novalazy at gmail.com> wrote:
> What will happen if the programmer forgets to add the attribute on a
> foreign type that is larger than one word? Because programmers WILL
> forget, precisely because such types are rare.
That is a valid point. Maybe we want the opposite assertion:
something that says "definitely not bigger than a word".
That way, if you forget the assertion when it would be valid,
you lose some performance, but preserve correctness.
In theory, this is still vulnerable to users adding a new platform
with a smaller word size that would make such assertions invalid.
We could guard against that by making the assertion "definitely
not bigger than an N-bit word, for N = 32 or 64. Then we
apply the assertion on platforms with N or more bits in a word,
and ignore it otherwise.
I can't think of a plausible way for a platform change to invalidate
such an assertion *without* a word size change, but then again,
I am not as familiar with the C#/Java platform scene as you guys.
What is your opinion?
> Not to mention existing
> code that is not necessarily upgraded when switching compilers
> (and you can't always force users to update to a compiler that
> recognises the new attribute, though this is not a concern for most
> Mercury programs).
This I don't understand. The proposed attribute is for Mercury,
and people *can't* switch to another Mercury compiler. Or are you
talking about people switching to an earlier version of mmc?
That is likely to be very hard as well, due to other forms of
language evolution.
Zoltan.
More information about the reviews
mailing list