<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 21, 2013 at 10:42 AM, Eric Dobson <span dir="ltr"><<a href="mailto:eric.n.dobson@gmail.com" target="_blank">eric.n.dobson@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am under the assumption that the compiled directory is just a cache<br>
of the byte code version of the compiled source code, and that racket<br>
should use the source code when ever that cache is invalid. This is<br>
currently not true, as my examples show, yet racket does work to make<br>
it mostly true. So my question is why doesn't racket do the same check<br>
that raco make does?<br>
<br></blockquote><div><br></div><div style>I believe the concern is that it is expensive (in terms of filesystem access). This decision was made a very long time ago, tho, and I don't know if we've done any real measurements or if maybe the balance has changed.</div>
<div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
No I don't want racket to run raco make before requiring the file.<br>
That would update the compiled directories, (which likely isn't<br>
expensive, but not the feature I'm asking about).<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Mar 21, 2013 at 8:34 AM, Tobias Hammer <<a href="mailto:tobias.hammer@dlr.de">tobias.hammer@dlr.de</a>> wrote:<br>
> You can use a little 'preload' script:<br>
><br>
> wrap-compile.rkt<br>
> #lang racket<br>
> (require compiler/cm)<br>
> (current-load/use-compiled<br>
> (make-compilation-manager-load/use-compiled-handler))<br>
><br>
> and run with racket -t wrap-compile.rkt <more><br>
> I would really love to see this functionality as a command line option to<br>
> the console racket<br>
><br>
> Tobias<br>
><br>
><br>
><br>
><br>
><br>
> On Thu, 21 Mar 2013 16:31:51 +0100, Eric Dobson <<a href="mailto:eric.n.dobson@gmail.com">eric.n.dobson@gmail.com</a>><br>
> wrote:<br>
><br>
>> So anyone who just uses the command line tools is out of luck? I like<br>
>> my build system to be correct, and it seems weird that there is work<br>
>> to make sure the right zo file is matched with the source file but<br>
>> that it is incorrect in some simple cases.<br>
>><br>
>> On Thu, Mar 21, 2013 at 8:19 AM, Robby Findler<br>
>> <<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>> wrote:<br>
>>><br>
>>> Or use DrRacket and turn on the auto compilation feature. Or set up<br>
>>> compiler/cm yourself to do that.<br>
>>><br>
>>> Robby<br>
>>><br>
>>><br>
>>> On Thu, Mar 21, 2013 at 10:16 AM, Eric Dobson <<a href="mailto:eric.n.dobson@gmail.com">eric.n.dobson@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>><br>
>>>> That doesn't explain why I can get the same behavior as the macro with<br>
>>>> a function call, probably inlining is responsible for that though.<br>
>>>><br>
>>>> So the take away is that if I want my running system to represent the<br>
>>>> current state of the source files I either need to run raco make every<br>
>>>> single time, or never run raco make. That seems very counter<br>
>>>> intuitive.<br>
>>>><br>
>>>> On Thu, Mar 21, 2013 at 1:51 AM, Tobias Hammer <<a href="mailto:tobias.hammer@dlr.de">tobias.hammer@dlr.de</a>><br>
>>>> wrote:<br>
>>>> > The difference lies in the method how racket and raco make check for<br>
>>>> > changes.<br>
>>>> > - racket only looks at each individual file's timestamp source and .zo<br>
>>>> > timestamp and uses whichever is never.<br>
>>>> > - raco make always checks if the file has changed or any of its<br>
>>>> > dependencies<br>
>>>> > has changed to decide if it has to recompile the file.<br>
>>>> ><br>
>>>> > Whats happens in version 1 is that the macro is already expanded in<br>
>>>> > a.zo<br>
>>>> > and<br>
>>>> > a.zo is still never than a.rkt. Therefore racket loads a.zo (but<br>
>>>> > b.rkt)<br>
>>>> > and<br>
>>>> > prints 'version1.<br>
>>>> > In version 2 raco make (or more correctly compiler/cm) checks a.rkt,<br>
>>>> > finds<br>
>>>> > the dependency to b.rkt, notices the change in b.rkt (by calculating a<br>
>>>> > checksum over the whole dependency tree if i remember correct) and<br>
>>>> > therefore<br>
>>>> > recompiles a.rkt AND b.rkt.<br>
>>>> ><br>
>>>> > Version 3 should as far as i understand never differ, assumed raco<br>
>>>> > make<br>
>>>> > works.<br>
>>>> ><br>
>>>> > Tobias<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > On Thu, 21 Mar 2013 06:23:24 +0100, Eric Dobson<br>
>>>> > <<a href="mailto:eric.n.dobson@gmail.com">eric.n.dobson@gmail.com</a>><br>
>>>> > wrote:<br>
>>>> ><br>
>>>> >> I'm trying to understand what are the guarantees that raco make is<br>
>>>> >> meant to provide. I'm going to limit this to simple programs, no<br>
>>>> >> fancy<br>
>>>> >> dynamic requires, or trying to trick the compiler.<br>
>>>> >><br>
>>>> >> In the following scenario:<br>
>>>> >> 1. Edit files<br>
>>>> >> 2. run 'raco make <files>'<br>
>>>> >> 3. Change files<br>
>>>> >> I expect all of these to have the same effect during the running of<br>
>>>> >> phase 0 when running racket.<br>
>>>> >> 4. racket <main-file><br>
>>>> >> or<br>
>>>> >> 4. raco make <files><br>
>>>> >> 5. racket <main-file><br>
>>>> >> or<br>
>>>> >> 4. rm -rf compiled/<br>
>>>> >> 5. raco make <files><br>
>>>> >> 6. racket <main-file><br>
>>>> >><br>
>>>> >> I can make version 1 and 2 differ with the following program:<br>
>>>> >> a.rkt<br>
>>>> >> #lang racket<br>
>>>> >> (require "b.rkt")<br>
>>>> >> (macro)<br>
>>>> >><br>
>>>> >> #lang racket<br>
>>>> >> (provide maco)<br>
>>>> >> (define-syntax (macro stx)<br>
>>>> >> #''version1)<br>
>>>> >><br>
>>>> >> Where the edit is changing version1 to version2. I can also replicate<br>
>>>> >> this with a function and not a macro.<br>
>>>> >><br>
>>>> >> I thought I could make version 2 and version 3 differ, but cannot<br>
>>>> >> seem<br>
>>>> >> to replicate it now, but it would be helpful to know if I see<br>
>>>> >> something that is fixed by clearing the compiled directories.<br>
>>>> >><br>
>>>> >> My understanding was that racket used the same logic as raco make on<br>
>>>> >> whether or not to use the compiled versions versus recompiling, and<br>
>>>> >> this seems to refute that. Can someone give some insight on what I<br>
>>>> >> should be expecting?<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>
>>>> ><br>
>>>> ><br>
>>>> > --<br>
>>>> > ---------------------------------------------------------<br>
>>>> > Tobias Hammer<br>
>>>> > DLR / Robotics and Mechatronics Center (RMC)<br>
>>>> > Muenchner Str. 20, D-82234 Wessling<br>
>>>> > Tel.: 08153/28-1487<br>
>>>> > Mail: <a href="mailto:tobias.hammer@dlr.de">tobias.hammer@dlr.de</a><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>
>>><br>
>>><br>
><br>
><br>
> --<br>
> ---------------------------------------------------------<br>
> Tobias Hammer<br>
> DLR / Robotics and Mechatronics Center (RMC)<br>
> Muenchner Str. 20, D-82234 Wessling<br>
> Tel.: 08153/28-1487<br>
> Mail: <a href="mailto:tobias.hammer@dlr.de">tobias.hammer@dlr.de</a><br>
</div></div></blockquote></div><br></div></div>