<div dir="ltr"><div dir="ltr">Hi Marc,</div><div dir="ltr"><br></div><div>I meant except for nondeterministic behavior caused by macros, so your example below is excluded from the definition.</div><div><br></div><div>The compiler uses gensym a lot, this would be a primary cause of nondeterminism wouldn't it, so for instance if thread-safe determinism would be desired, the Gambit user would need to implement a thread-local gensym, correct?</div><div><br></div><div>(This would exclude thread preemption interrupts and GC as sources of nondeterminism - thread preemption and GC would only effect |compile-file| in the way that it could affect the order of gensym calls, right?)</div><div><br></div><div>Oh hashtables as a source of |compile-file| nondeterminism, interesting - what does |compile-file| use hashtables for?</div><div><br></div><div>Thanks!!</div><div>Adam</div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 15 Mar 2019 at 12:55, Marc Feeley <<a href="mailto:feeley@iro.umontreal.ca">feeley@iro.umontreal.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">You’ll have to define what it means for the compiler to be deterministic.  Do you expect the compilation of the following program to yield the same executable every time it is compiled?<br><br>(define-macro (stamp)<br>  (read-line (open-tcp-client "<a href="http://time-a.timefreq.bldrdoc.gov:37/" rel="noreferrer" target="_blank">time-a.timefreq.bldrdoc.gov:37</a>")))<br><br>(pp (string-append "hello! " (stamp)))<br><br>Macros open a big can of worms…<br><br>If you avoid macros the compiler is probably mostly deterministic… but I do not have a proof handy!  Hash tables, GC, thread preemption interrupts, etc can introduce nondeterminism that may be observable in some situations.<br><br>Marc<br></blockquote><div> </div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 26 Feb 2019 at 09:18, Adam <<a href="mailto:adam.mlmb@gmail.com">adam.mlmb@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Marc,<div><br></div><div>Gambit's compiler is deterministic right?</div><div><br></div><div>(As in Scheme to GVM, GVM to C or binary. Underlying C compiler's determinism is a separate matter altogether.)</div><div><br></div><div>A consideration could be that compilation output is a function of |gensym| and therefore its counter must be managed for deterministic compilation.</div><div><br></div><div>Another consideration that if running more instances of the compiler in one Gambit process concurrently, the |gensym| calls could have arbitrary order and therefore determinism break.</div><div><br></div><div>Adam</div></div>
</blockquote></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
        <tr>
        <td style="width:55px;padding-top:13px"><a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avg.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>