<div dir="ltr">Aha.<div><br></div><div>Brief Q:s:<br><div><br></div><div>1) The force code is not blocking the thread scheduler, right - so the lazy expression can do (thread-sleep! alot) without freezing the host, right?</div><div><br></div><div>2) The auto-forcing is universal, right?</div><div><br></div><div>3) Any guess about how much slower the generated code becomes, do you think it's rather 20% or 400%?</div><div><br></div></div><div>    I guess if on the C/assembly level the check is really simple, then a good CPU will be able to optimize through already-forced values via branch prediction so rather 20% .. ?</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-10 10:40 GMT+08:00 Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When using --enable-auto-force, it is OK for test1 to fail this way (because test1 introspects the structure of the generated code, and, unfortunately, using auto forcing changes the structure of the code).<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On Jun 9, 2016, at 4:00 PM, Bradley Lucier <<a href="mailto:lucier@math.purdue.edu">lucier@math.purdue.edu</a>> wrote:<br>
><br>
> I'm taking the liberty of adding the Gambit mail list to the CC, since this may be of general interest.<br>
><br>
> "make check" fails after configuring with<br>
><br>
> ./configure 'CC=/usr/local/gcc-6.1.0/bin/gcc -march=native' '--enable-single-host' '--enable-multiple-versions' '--enable-shared' --enable-auto-forcing<br>
><br>
> "make -i check" (to ignore errors and continue) gives<br>
><br>
> ------------ TEST 1 (debugging support)<br>
> LD_LIBRARY_PATH=../lib:../gsi:../gsc:/usr/local/Gambit/current/lib:/usr/local/netpbm10/lib:/usr/local/gcc-6.1.0/lib/: ../gsi/gsi -:~~bin=../bin,~~lib=../lib,~~include=../include -f debug.scm > test1.out<br>
> diff test1.ok test1.out && rm -f test1.out<br>
> 81a82<br>
>> #return(##cprc-if2 3) : ($code rte)<br>
> 85a87<br>
>> #return(##cprc-if3 3) : ($code rte)<br>
> 108a111<br>
>> #return(##cprc-cond-if 3) : ($code rte)<br>
> 112a116<br>
>> #return(##cprc-cond-or 3) : ($code rte)<br>
> 117,120c121,126<br>
> < #return(##cprc-cond-send-red 3) : ($code rte pred)<br>
> < #procedure(##cprc-cond-send-red 4)<br>
> < #return(##cprc-cond-send-red 5) : ($code rte oper)<br>
> < #return(##cprc-cond-send-red 6) : ($code rte)<br>
> ---<br>
>> #return(##cprc-cond-send-red 3) : ($code rte)<br>
>> #return(##cprc-cond-send-red 4) : ($code rte pred)<br>
>> #return(##cprc-cond-send-red 5) : ($code rte pred)<br>
>> #procedure(##cprc-cond-send-red 6)<br>
>> #return(##cprc-cond-send-red 7) : ($code rte oper)<br>
>> #return(##cprc-cond-send-red 8) : ($code rte)<br>
> 125,127c131,135<br>
> < #return(##cprc-cond-send-sub 3) : ($code rte pred)<br>
> < #return(##cprc-cond-send-sub 4) : ($code rte oper)<br>
> < #return(##cprc-cond-send-sub 5) : ($code rte)<br>
> ---<br>
>> #return(##cprc-cond-send-sub 3) : ($code rte)<br>
>> #return(##cprc-cond-send-sub 4) : ($code rte pred)<br>
>> #return(##cprc-cond-send-sub 5) : ($code rte pred)<br>
>> #return(##cprc-cond-send-sub 6) : ($code rte oper)<br>
>> #return(##cprc-cond-send-sub 7) : ($code rte)<br>
> 131a140<br>
>> #return(##cprc-or 3) : ($code rte)<br>
> 135a145<br>
>> #return(##cprc-and 3) : ($code rte)<br>
> 140c150,151<br>
> < #return(##cprc-case 3) : (rte $code)<br>
> ---<br>
>> #return(##cprc-case 3) : ($code rte)<br>
>> #return(##cprc-case 4) : (rte $code)<br>
> 250,251c261,263<br>
> < #procedure(##cprc-app0-red 3)<br>
> < #return(##cprc-app0-red 4) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app0-red 3) : ($code rte)<br>
>> #procedure(##cprc-app0-red 4)<br>
>> #return(##cprc-app0-red 5) : ($code rte)<br>
> 257,259c269,272<br>
> < #procedure(##cprc-app1-red 4)<br>
> < #return(##cprc-app1-red 5) : ($code rte oper)<br>
> < #return(##cprc-app1-red 6) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app1-red 4) : ($code rte oper)<br>
>> #procedure(##cprc-app1-red 5)<br>
>> #return(##cprc-app1-red 6) : ($code rte oper)<br>
>> #return(##cprc-app1-red 7) : ($code rte)<br>
> 266,268c279,282<br>
> < #procedure(##cprc-app2-red 5)<br>
> < #return(##cprc-app2-red 6) : ($code rte oper)<br>
> < #return(##cprc-app2-red 7) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app2-red 5) : ($code rte oper arg1)<br>
>> #procedure(##cprc-app2-red 6)<br>
>> #return(##cprc-app2-red 7) : ($code rte oper)<br>
>> #return(##cprc-app2-red 8) : ($code rte)<br>
> 276,278c290,293<br>
> < #procedure(##cprc-app3-red 6)<br>
> < #return(##cprc-app3-red 7) : ($code rte oper)<br>
> < #return(##cprc-app3-red 8) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app3-red 6) : ($code rte oper arg1 arg2)<br>
>> #procedure(##cprc-app3-red 7)<br>
>> #return(##cprc-app3-red 8) : ($code rte oper)<br>
>> #return(##cprc-app3-red 9) : ($code rte)<br>
> 287,289c302,305<br>
> < #procedure(##cprc-app4-red 7)<br>
> < #return(##cprc-app4-red 8) : ($code rte oper)<br>
> < #return(##cprc-app4-red 9) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app4-red 7) : ($code rte oper arg1 arg2 arg3)<br>
>> #procedure(##cprc-app4-red 8)<br>
>> #return(##cprc-app4-red 9) : ($code rte oper)<br>
>> #return(##cprc-app4-red 10) : ($code rte)<br>
> 297,298c313,315<br>
> < #procedure(##cprc-app-red 6)<br>
> < #return(##cprc-app-red 7) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app-red 6) : ($code rte oper)<br>
>> #procedure(##cprc-app-red 7)<br>
>> #return(##cprc-app-red 8) : ($code rte)<br>
> 303a321<br>
>> #return(##cprc-app0-sub 4) : ($code rte)<br>
> 310c328,329<br>
> < #return(##cprc-app1-sub 5) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app1-sub 5) : ($code rte oper)<br>
>> #return(##cprc-app1-sub 6) : ($code rte)<br>
> 317,318c336,338<br>
> < #return(##cprc-app2-sub 5) : ($code rte oper)<br>
> < #return(##cprc-app2-sub 6) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app2-sub 5) : ($code rte oper arg1)<br>
>> #return(##cprc-app2-sub 6) : ($code rte oper)<br>
>> #return(##cprc-app2-sub 7) : ($code rte)<br>
> 326,327c346,348<br>
> < #return(##cprc-app3-sub 6) : ($code rte oper)<br>
> < #return(##cprc-app3-sub 7) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app3-sub 6) : ($code rte oper arg1 arg2)<br>
>> #return(##cprc-app3-sub 7) : ($code rte oper)<br>
>> #return(##cprc-app3-sub 8) : ($code rte)<br>
> 336,337c357,359<br>
> < #return(##cprc-app4-sub 7) : ($code rte oper)<br>
> < #return(##cprc-app4-sub 8) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app4-sub 7) : ($code rte oper arg1 arg2 arg3)<br>
>> #return(##cprc-app4-sub 8) : ($code rte oper)<br>
>> #return(##cprc-app4-sub 9) : ($code rte)<br>
> 345,346c367,369<br>
> < #procedure(##cprc-app-sub 6)<br>
> < #return(##cprc-app-sub 7) : ($code rte)<br>
> ---<br>
>> #return(##cprc-app-sub 6) : ($code rte oper)<br>
>> #procedure(##cprc-app-sub 7)<br>
>> #return(##cprc-app-sub 8) : ($code rte)<br>
> makefile:113: recipe for target 'test1' failed<br>
> make[1]: [test1] Error 1 (ignored)<br>
><br>
><br>
> I don't know whether this is important.<br>
><br>
> Brad<br>
><br>
> On 06/09/2016 02:11 PM, Mikael More wrote:<br>
>> Awesomeness, thanks!!!!!<br>
>><br>
>> Fantastic, this means tight integration with a functional object<br>
>> database is possible.<br>
>><br>
>> I guess the expression code is running under the scheduler too, opening<br>
>> for storage of the database on non-low-latency facilities too, great!<br>
>><br>
>><br>
>><br>
>> 2016-06-10 1:30 GMT+08:00 Bradley Lucier <<a href="mailto:lucier@math.purdue.edu">lucier@math.purdue.edu</a><br>
>> <mailto:<a href="mailto:lucier@math.purdue.edu">lucier@math.purdue.edu</a>>>:<br>
>><br>
>>   Try adding --enable-auto-forcing to your configure of Gambit.<br>
>><br>
>><br>
>>   On 06/09/2016 01:20 PM, Adam wrote:<br>
>><br>
>>       Hi Marc!<br>
>><br>
>>       I have a practical question:<br>
>><br>
>>       I am thinking about the possibility of realizing a TIGHTLY<br>
>>       integrated<br>
>>       persistent object store ("object database").<br>
>><br>
>>       (Tightly integrated, that is, with the Scheme heap.)<br>
>><br>
>>       The object store would be functional, so the host system can cache<br>
>>       object references as much as it wants.<br>
>><br>
>><br>
>>       My question is:<br>
>><br>
>>       The best thing would be to<br>
>><br>
>>       1) Have lazy loading of objects into the Scheme heap from the<br>
>>       database<br>
>>       (because the stored structures may have wather depth and shape<br>
>>       meaning<br>
>>       that precaching algorithms never would have an idea about what<br>
>>       really<br>
>>       needs to be loaded, so better let the code show that simply<br>
>>       through what<br>
>>       slots etc. it accesses), *AND* to at the same time<br>
>><br>
>>       2) *NOT* need to customize the Scheme code for the lazy loading,<br>
>>       i.e.,<br>
>>       have implicit |force| all over the code?<br>
>><br>
>><br>
>>       A final wish here would be<br>
>><br>
>>       3) The option that the |force| would be run as a procedure<br>
>>       within the<br>
>>       green threading system, so that other green threads would continue<br>
>>       executing while the lazy value is being loaded. Not sure about<br>
>>       this one<br>
>>       though - maybe for code-performance reasons it would be better<br>
>>       to have<br>
>>       it block.<br>
>><br>
>><br>
>>       Even runtime procedures would need to do the implicit |force|.<br>
>>       So the<br>
>>       values that not are loaded right now, would be represented by a<br>
>>       loading<br>
>>       closure, and the result of closure invocation would be the value<br>
>>       that<br>
>>       should take the place of the respective accessed slot.<br>
>><br>
>><br>
>>       Can this be done in Gambit, in its current form or with some<br>
>>       very slight<br>
>>       modification?<br>
>><br>
>>       Thanks!<br>
>><br>
>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>