<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>I quite like the idea that all heap and stack is initialized by zeroing. This is I believe stronger/safer than Modula-3, at least for stack. Anyone want to measure the change? I'd also like to see stack zeroed upon function return, so GC is easier to implement/understand...<br><br><hr>From: dmuysers@hotmail.com<br>To: dabenavidesd@yahoo.es; m3devel@elegosoft.com; rodney_bates@lcwb.coop<br>Date: Fri, 6 Jul 2012 21:54:54 +0200<br>Subject: Re: [M3devel] A question for our language lawyers<br><br>
<div><font face=Arial>Daniel, with my apologies, sometimes I wonder if you do it
on purpose.</font></div>
<div style="font:10pt Tahoma">
<div><br></div>
<div style="background:#f5f5f5">
<div style="font-color:black"><b>From:</b> <a title="mailto:dabenavidesd@yahoo.es
CTRL + Click to follow link" href="mailto:dabenavidesd@yahoo.es">Daniel Alejandro Benavides D.</a> </div>
<div><b>Sent:</b> Friday, July 06, 2012 9:17 PM</div>
<div><b>To:</b> <a title="m3devel@elegosoft.com" href="mailto:m3devel@elegosoft.com">m3devel@elegosoft.com</a> ; <a title="mailto:rodney_bates@lcwb.coop
CTRL + Click to follow link" href="mailto:rodney_bates@lcwb.coop">Rodney M. Bates</a> </div>
<div><b>Subject:</b> Re: [M3devel] A question for our language
lawyers</div></div></div>
<div><br></div>
<table border=0 cellspacing=0 cellpadding=0>
<tbody>
<tr>
<td valign=top>Hi all:<br>English men say array is a sequence of elements
(of a common type), and a BOOLEAN is an enumeration so you might attack
that distinction to define what is an initialized boolean or array of
boolean in common compilers, gcc javac, etc, which if is java-like is
really undefined:<br><br><a title="http://www.drdobbs.com/architecture-and-design/the-humble-boolean-deserves-help/232900836?cid=DDJ_nl_upd_2012-05-02_h&elq=cef656ee4d6c4bca996b337620b98f85
CTRL + Click to follow link" href="http://www.drdobbs.com/architecture-and-design/the-humble-boolean-deserves-help/232900836?cid=DDJ_nl_upd_2012-05-02_h&elq=cef656ee4d6c4bca996b337620b98f85" target="_blank">http://www.drdobbs.com/architecture-and-design/the-humble-boolean-deserves-help/232900836?cid=DDJ_nl_upd_2012-05-02_h&elq=cef656ee4d6c4bca996b337620b98f85</a><br><br>So
I prefer non-uniform rules for records different of Sets, Arrays, and
records as that, note that NEW expression doesn't allow constructors to be
used, so the only thing you can use is array of uninitialized variables
(but current gcc or javac, etc are really wrong in that)<br><br>This means
we need to address this by either a native backend (NT386) or by another
language for that matter.<br><br>Thanks in advance for any comments you
may have<br><br>--- El <b>vie, 6/7/12, Rodney M. Bates
<i><rodney_bates@lcwb.coop></i></b> escribió:<br>
<blockquote style="border-left:rgb(16,16,255) 2px solid;padding-left:5px;margin-left:5px"><br>De:
Rodney M. Bates <rodney_bates@lcwb.coop><br>Asunto: Re: [M3devel]
A question for our language lawyers<br>Para:
m3devel@elegosoft.com<br>Fecha: viernes, 6 de julio, 2012 13:27<br><br>
<div class=ecxplainMail><br><br>On 07/06/2012 04:23 AM, Dirk Muysers
wrote:<br>> The report says (2.6.9)<br>> "The values in the array
will be arbitrary values of their type."<br><br>> Now, ParseParams in
its "init" method allocates an array of BOOLEANs<br>> and relies on
the fact that it is supposedly initialised with FALSE
values.<br><br>> At the other hand the report says (2.2.4)<br>>
"The constant |default| is a default value used when a record is
constructed or allocated"<br><br>> If I allocate an array of records,
which statement is stronger:<br>> - the array contains arbitray
record values ?<br>> - the array record fields will be initialised to
their default values?<br><br>Admittedly unclearly if not misleadingly
worded. Better wording might be<br>to say each element is
initialized as it would if it were a scalar variable<br>of its
type.<br><br>I think the way to interpret this is that the array itself
does not impose<br>any initialization, but this fact will not eliminate
initialization<br>imposed by other rules, specifically, the type of the
array's elements.<br><br>This is a language quirk that I have always
been deeply ambivalent about.<br>The type safety would go down the drain
if variables were not initialized<br>to a bit pattern that represents
some value of the type, so we have to pay<br>the performance penalty of
executing initialization code. So why not define<br>which value of
the type is initialized-to and get behavioral predictability<br>for
free? And further save redundant initialization in the likely
event<br>that the compiler's chosen arbitrary value happens to match
what the<br>programmer wants?<br><br>(OK, a smart enough optimizer might
figure this out, but we could have<br>had it even with a naive
compiler.)<br><br>The contrary case is a type whose compiler-chosen
representation happens<br>to use every bit pattern in the allocated
space for a value of the type.<br>Here, no compiler-generated runtime
initialization is needed.<br><br>Also, the rule we have might sometimes
encourage programmers to at least give a<br>millisecond's thought to
whether they need to do some explicit initialization.<br><br><br>>
The ParseParams "init" method is obviously erroneous and works
only<br>> by virtue of a happy combination of circumstances.<br>>
But how is the report to be interpreted in the second
case?<br></div></blockquote></td></tr></tbody></table>
</div></body>
</html>