Upon changing the 3 occurrences of make-hash in lang-core.rkt to make-hasheq, the demos/ animations begin to animate. At this moment, and after rolling back an earlier commit to lang-core.rkt, all of the demos in the demos folder are now working! Thank you for this fix Gregory! <br>
<br>My goal was to perform a basic migration here-use Racket lang everywhere, excise as many mzlib dependencies as possible while still maintaining functionality. At this point, I consider this goal met-all of the demos are functioning, the language now extends racket vs. scheme or mzscheme. The scribble is updated to reflect this change.<br>
<br>I am interested in having these changes incorporated into a future Racket release. How can I go about having these changes reviewed and merged into some development branch? I'm of course willing to work with someone to ensure that any blockers are resolved. <br>
<br>Thank you all, <br>-Patrick<br><br><div class="gmail_quote">On 18 August 2012 01:57, Gregory Cooper <span dir="ltr"><<a href="mailto:ghcooper@gmail.com" target="_blank">ghcooper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you change the 3 occurrences of make-hash in lang-core.rkt to<br>
make-hasheq, does that not fix things? That seems to work for me,<br>
though it's possible my setup is not quite the same...<br>
<br>
Greg<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Aug 17, 2012 at 10:29 PM, Gregory Cooper <<a href="mailto:ghcooper@gmail.com">ghcooper@gmail.com</a>> wrote:<br>
> Hi Patrick,<br>
><br>
> Thanks for taking on this endeavor, and apologies for the suffering<br>
> you must have endured in dealing with this code.<br>
><br>
> If I followed your instructions correctly, it looks like things are<br>
> very close to working. One feature that seems to be broken is the<br>
> storing of references to special top-level signals (which perform<br>
> actions like redrawing animations or updating snips) to protect them<br>
> from the garbage collector. It's been a while since I've looked at<br>
> this code, but I'll try to investigate a bit more and see what might<br>
> be going wrong.<br>
><br>
> Cheers,<br>
> Greg<br>
><br>
> On Fri, Aug 17, 2012 at 12:51 PM, Patrick Mahoney<br>
> <<a href="mailto:paddy.mahoney@gmail.com">paddy.mahoney@gmail.com</a>> wrote:<br>
>> Hello All,<br>
>><br>
>> I have been working on updating the frtime collection to use the Racket lang<br>
>> rather than the mzscheme language. To this end, I forked on github and<br>
>> created a new branch frtime-to-racket, which can be found at:<br>
>> <a href="https://github.com/paddymahoney/racket.git" target="_blank">https://github.com/paddymahoney/racket.git</a><br>
>><br>
>> This branch contains 36 commits. The first 34 are minor, and don't actually<br>
>> break functionality. See the commit log:<br>
>> <a href="https://github.com/paddymahoney/racket/commits/frtime-to-racket" target="_blank">https://github.com/paddymahoney/racket/commits/frtime-to-racket</a><br>
>><br>
>> The 35th commit is bigger, and represents the bulk of the move of the<br>
>> collection and the other main modules to the racket lang rather than<br>
>> mzscheme. The issue I face is that this commit is breaking all of the demos<br>
>> within the frtime/demos/ subdirectory. These demos rely on animation.rkt at<br>
>> the root. The demos in the frtime/gui/demo directory don't depend on<br>
>> animation.rkt, and seem to work, albeit with a slow asynchronous perhaps?<br>
>> (perhaps some subset of the issues affecting the animation demos also affect<br>
>> the demos relying only on the fred wrappers).<br>
>><br>
>> The 36th commit is a new helper "develop-frtime.rkt" which I use to unlink<br>
>> the install collection and link the development frtime collection.<br>
>><br>
>> I have very closely reviewed all the changes in the commit logs, and have<br>
>> played around extensively to try to find a particular change that has the<br>
>> effect of breaking the animations, to no avail.<br>
>><br>
>> My uneducated guesses as to what is occurring:<br>
>> 1. The behavior seen in running the demos is that they will typically<br>
>> update for a few frames or seconds, but then freeze in place. A similar<br>
>> issue is described in Gregory Cooper's thesis "Integrating Dataflow<br>
>> Evaluation into a Practical<br>
>> Higher-Order Call-by-Value Language". From page 99:<br>
>> "There is, however, a problem with the strategy described above that is<br>
>> difficult to di-agnose and debug. The symptoms are as follows: at first, the<br>
>> program seems to work just<br>
>> fine. Sometimes it may run successfully to completion. Other times,<br>
>> depending upon what<br>
>> else is happening, it runs for a while, then suddenly and seemingly without<br>
>> explanation the<br>
>> gauge’s properties stop updating when the behaviors change. The point at<br>
>> which it stops<br>
>> varies from run to run, but there are never any error messages.<br>
>> The problem results from an interaction with the memory manager. An ordinary<br>
>> FRP<br>
>> application would use the event source returned by the map-e, but in this<br>
>> case we only<br>
>> care about side effects, so we neglect to save the result. Since there are<br>
>> no references to<br>
>> the updating event source, the garbage collector eventually reclaims it, and<br>
>> the gauge stops<br>
>> reacting to changes in the behavior.<br>
>> To avoid these problems, we define a new abstraction specifically for<br>
>> side-effecting<br>
>> event processors. This abstraction, called for-each-e!, works just like<br>
>> map-e, except that it<br>
>> ensures its result will not be collected. It also lends itself to a more<br>
>> efficient implementa-tion, since it can throw away the results of the<br>
>> procedure calls instead of enqueuing them<br>
>> on a new event stream."<br>
>><br>
>>> this seems very much like what I see in the behavior of say,<br>
>>> "demos/analog-clock.rkt". You are often able to force an update by dragging<br>
>>> the clock or updating the slider, and occasionally the clock will tick in<br>
>>> the beginning. In addition, sometimes the clock won't show initially (this<br>
>>> may occur when there is a difference in the way the dataflow graph is<br>
>>> updated?). However, I have been unsuccessful in determining whether this is<br>
>>> in fact the case, or if there a distinct issue here with similar symptoms.<br>
>>> In fact, I don't know what is occurring at all, and I am at a loss as to how<br>
>>> to resolve this problem.<br>
>><br>
>> 2. Something isn't being lifted.<br>
>>> I have run Check Syntax and traced most of the bindings to ensure that<br>
>>> lifted equivalents are being used everywhere. I can't find a binding that<br>
>>> was not lifted, but I cannot rule this out either.<br>
>>>Files that might be involved:<br>
>> lang-utils.rkt<br>
>> lang-core.rkt<br>
>> opt/frtime-opt-lang.rkt<br>
>><br>
>> 3. Persuant to 1, garbage collection behavior/calls have changed, and the<br>
>> result is that some behavior is being collected prematurely. Interactions<br>
>> with mred usage and garbage collection might contribute if this is an issue.<br>
>><br>
>> I have invested a ton of time into understanding enough to make even these<br>
>> minor changes, and really don't want to see this work die on the vine. So I<br>
>> open it to you Racket experts for help debugging this.<br>
>><br>
>> Instructions to see the issue:<br>
>> Open a command line and:<br>
>>> git clone <a href="https://github.com/paddymahoney/racket.git" target="_blank">https://github.com/paddymahoney/racket.git</a><br>
>> (you might want to do this in a different directory than that which holds<br>
>> another fork of racket)<br>
>>>git checkout frtime-to-racket<br>
>> Open the "racket/collects/frtime/develop-frtime.rkt" file in drracket and<br>
>> update the two paths. Run the function (start-developing-frtime) to ensure<br>
>> that the development rather than installation collection is used when we run<br>
>> the demos. If you don't, any collection paths will refer to the install<br>
>> directory, and you will receive errors.<br>
>> Open "racket/collects/frtime/demos/analog-clock.rkt. Run it.<br>
>><br>
>> Please let me know if you require any further assistance reproducing this<br>
>> bug, and I will endeavor to provide. In addition, I will be extremely<br>
>> grateful for any assistance here. I'd like to attend the October RacketConf,<br>
>> and a beverage of some kind would be in order to reward my hero.<br>
>><br>
>> Thank you all,<br>
>><br>
>> -Patrick<br>
>><br>
>> ____________________<br>
>> Racket Users list:<br>
>> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
>><br>
</div></div></blockquote></div><br>