Re: Please read before Thursday's meeting...
On 2005-07-13 23:09:59 -0700, r754@xxxxxxxxxxxxxx wrote:
Next: static-modes.htm (2-5). To apply modes (rounding, et al)
statically. Mike objected on the grounds that an interpretive
language can be purely dynamic in its scoping rules. This
'meta' problem can be used by sufficiently malicious programmers
to conceal a change of modes that defeats any reasonable notion
of 'static'. We ended up discussing that rather than a static
mode what we really have in mind that the programmer should have
the expressive power to say (a) I would like this operation/
expression/block to be evaluated in this precision/rounding/
exception mode, or (b) I would like it to be evaluated as if
some mode change (external to me) would apply to this code, or
The programmer may have this power, e.g. by using a "case" statement
(or similar) to emulate dynamic modes, or by changing/restoring the
current mode to emulate static modes. Would this be sufficient in an
implementation? Or you should say "directly in the target language".
(c) I don't care. Also this should be a requirement & therefore
a SHALL. Making it a SHOULD would defeat the purpose. We also
discussed just how 'paranoid' a compiler should be about the
convention that function calls don't change some global mode.
The reckless level would be to not know & not care. The truely
paranoid level would be to save & restore all modes on the
procedure call. Jim argued that an adequate level of paranoia
was to not move code around function calls. While that seems
practical is seems barely more than reckless to me.
All this is part of the language specification.
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA