<div><br></div><div>(Per: Message for you at the bottom!)</div><div><br></div><div><br></div>Hi Matthew and anyone interested in getting BH non-syntactictower + std-bundled libs + Sack going,<div><br></div><div><b>Objective</b></div>

<div>To make you get going in a Black Hole environment that's been proven by experience to work very very well, giving a rapid start with 'batteries included'-style nicety, which is of value for those who are at a beginner level in these particular tools and libraries.</div>

<div><br></div><div><br></div><div><b>Note on </b><b>validity duration of this email</b></div><div>Basically this email ought to be as good as the last said word, until ~February 2013.</div><div><br></div><div>Regarding BH, this email and files referred to here will be valid until the BH repos and docs online have been tweaked and a bit restructured. A separate annoncement will be made when this has happened.</div>

<div><br></div><div>Regarding Sack, this email and files referred to here are valid currently. The work needed to make the <a href="https://github.com/pereckerdal/sack/">Sack github repo</a> support both Black Hole versions out of the box is almost nil but has not been done. I'll do this personally at latest at the time the step above is done.</div>

<div><br></div><div>For anyone interested, there's a production-quality HTTPS server extension to Sack. The next days as from this writing, the HTTPS client functionality is tweaked, as well as an asynchronous http* client API introduced, similar to XmlHttpRequest. If you want this, ask for it.</div>

<div><br></div><div>This is a limited-purpose snapshot and for the Black Hole + bundled libs archive, GIT repo files have been duly omitted.</div><div><br></div><div><br></div><div><b>Prerequisites<br></b>Super-basic knowledge of Gambit, in particular naturally understanding when <font face="courier new, monospace">,q</font>  = quit Gambit, is needed.</div>

<div><br></div><div>Gambit installed on your system.</div><div><br></div><div>Paths here are written from a Unix point of view but making it go on Windows is straightforward.</div><div><br></div><div>Optional: Gambit compiled from source, and the source still available in your home directory (<span style="font-family:'courier new',monospace">~/gambc-v4*</span>).</div>

<div><br><div><div><br></div><div><b>To install these software components, please follow the following installation steps:</b></div><div><br></div><div><b> * Download the archive with non-syntactictower Black Hole and the "bundled libs", + archive overview:</b></div>

<div><br></div><div>   * Download <font face="courier new, monospace">2012-11-28-bh-non-syntactictower+bundled-libs.tar.gz</font> available for direct download at <a href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds#Module_systems">Gambit's Dumping Grounds page</a>. <span style="font-family:arial,helvetica,sans-serif">It will be available there for as long as it's not clearly obsolete.</span></div>

<div><br></div><div>     This is a file set that has two parts:</div><div><br></div><div><div>      * In the root directory: BH, that equals the legacy branch with pull request 45 linked to above included, though I'm sending it to you separately also just to be really safe you get the right thing.</div>

</div><div><br></div><div>      * In the std/ directory: The "bundled libraries" found on <a href="https://github.com/pereckerdal/std" target="_blank" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)">https://github.com/pereckerdal/std</a><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.727272033691406px;background-color:rgb(255,255,255)"> , though in a more tested and tried version, and with some extensions.</span></div>

<div><br></div><div><br></div><div>   * Untar this file in your home directory (<font face="courier new, monospace">~</font>), i.e. <font face="courier new, monospace">cd ~; tar xvfz bh-non-syntactictower+bundled-libs.tar.gz</font> .</div>

<div><br></div><div>   * Compile Black Hole: <font face="courier new, monospace">cd blackhole; gsc build</font></div><div><br></div><div><b> * Set up Black Hole:</b></div><div><br></div><div>    * Make a /usr/bin/bsc file:</div>

<div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="courier new, monospace">cat > /usr/bin/bsc</font></div></div><div><div><font face="courier new, monospace">#!/bin/sh</font></div>

</div><div><div><font face="courier new, monospace">gsc -:dar,t8,l30,m20000,-n,tn,f8 -e '(load "~~/lib/blackhole/build.o1")(set! module#*compiler-options* (list (string->symbol "debug")))' $@ -</font></div>

</div><div><font face="courier new, monospace">[ctrl+D]</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">chmod +x /usr/bin/bsc</font></div></blockquote><div><div>

<font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">    * Make </font><font face="courier new, monospace">~~/lib/blackhole/build.o1</font><font face="arial, helvetica, sans-serif"> link to </font><font face="courier new, monospace">~/blackhole/build.o1</font><font face="arial, helvetica, sans-serif">:</font></div>

<div><font face="courier new, monospace">   ln -s /usr/local/Gambit-C/lib/blackhole ~/blackhole</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="font-family:arial,helvetica,sans-serif">    * </span><font face="arial, helvetica, sans-serif">For the package resolver for the std package to find module files, which it looks for in </font><font face="courier new, monospace">~~/lib/modules/std</font><font face="arial, helvetica, sans-serif"> :</font></div>

<div><div><font face="courier new, monospace">   ln -s /usr/local/Gambit-C/lib/modules ~/blackhole</font></div></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><b><br>

</b></font></div><div><b> * S<span style="font-family:arial,helvetica,sans-serif">et up the bundled libraries:</span></b></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">    * the </span><font face="courier new, monospace">(std net/tcp-ip)</font><span style="font-family:arial,helvetica,sans-serif"> module has some lowlevel dependencies, if you want access to it, copy </span><font face="courier new, monospace">lib/*.h</font><span style="font-family:arial,helvetica,sans-serif"> of your Gambit source distribution into </span><span style="font-family:'courier new',monospace">/usr/local/Gambit-C/lib/ i.e. something like:</span></div>

<div><span style="font-family:'courier new',monospace">     </span><font face="courier new, monospace"> cd ~/gambc-v4[tab]</font></div><div><font face="courier new, monospace">      cd lib</font></div><div><font face="courier new, monospace">      cp *.h </font><span style="font-family:'courier new',monospace">/usr/local/Gambit-C/lib/</span></div>

<div><br></div><div>    * Compile the bundle libraries:</div><div><br></div><div><font face="courier new, monospace">    bsc</font></div><div><font face="courier new, monospace">    (modules-compile! (modules-in-dir "~~/lib/modules")))</font></div>

<div><br></div><div>       Please note that compiling the <font face="courier new, monospace">(std string/digest)</font> module may occupy ~1.5-2GB memory. The others should be require much less though.</div><div><br></div>

<div><br></div><div><div><b> * S<span style="font-family:arial,helvetica,sans-serif">et up the Sack web server and client middleware:</span></b></div></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div>

<div><span style="font-family:arial,helvetica,sans-serif">    * Create a project directory for yourself, say </span><font face="courier new, monospace">~/proj</font><span style="font-family:arial,helvetica,sans-serif"> :  </span><font face="courier new, monospace">mkdir ~/proj; cd ~/proj</font></div>

<div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">    * Download the </span><span style="font-family:'courier new',monospace">2012-11-28-</span><font face="courier new, monospace">sack-current-for-BH-non-syntactictower.tar.gz</font><span style="font-family:arial,helvetica,sans-serif"> file from <a href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds#Networking_2">Gambit's Dumping Grounds page</a>. It will be available there for as long as it's not clearly obsolete.</span></div>

<div><br></div><div>     * Unpack Sack into <font face="courier new, monospace">~/proj/lib</font> : <font face="courier new, monospace">mkdir ~/proj/lib; cd ~/proj/lib; tar xvfz ../sack-current-2012-11-28-for-BH-non-syntactictower.tar.gz; cd ..</font></div>

<div><br></div><div>    * Optional: Compile Sack:</div><div><font face="courier new, monospace">   bsc</font></div><div><font face="courier new, monospace">   (modules-compile! (modules-in-dir "lib/sack")))</font></div>

<div><br></div><div><b>Done!</b></div><div><b><br></b></div><div>You can now run Gambit with Black Hole from your shell anytime under the name <font face="courier new, monospace">bsc</font> . It's nicely pre-setup with UTF-8 encoding, clear exception reporting, and per-line output buffering for performance (note, invoking <font face="courier new, monospace">|force-output|</font> after any <font face="courier new, monospace">|display|</font> etc. may be needed).</div>

<div><br></div><div><b><br></b></div><div><b>Example HTTP server:</b></div><div><br></div><div>(presuming you're in <font face="courier new, monospace">~/proj</font> :)</div><div><br></div><div><font face="courier new, monospace">bsc</font></div>

<div><font face="courier new, monospace">(import (std misc/u8v) lib/sack/src/server)</font></div><div><font face="courier new, monospace"><br></font></div><div><div><font face="courier new, monospace">(define (simple-webserver! server #!rest rest)</font></div>

<div><font face="courier new, monospace">  (apply sack-start!</font></div><div><font face="courier new, monospace">         (cons (lambda (env)</font></div><div><font face="courier new, monospace">                 (let ((</font><span style="font-family:'courier new',monospace">first</span><font face="courier new, monospace">? #t))</font></div>

<div><font face="courier new, monospace">                   (values 200</font></div><div><font face="courier new, monospace">                           '(("Content-Type" . "text/html"))</font></div>

<div><font face="courier new, monospace">                           (lambda ()</font></div><div><font face="courier new, monospace">                             (let ((r (and </font><span style="font-family:'courier new',monospace">first</span><font face="courier new, monospace">? (string->utf8-u8vector (server)))))</font></div>

<div><font face="courier new, monospace">                               (set! first? #f)</font></div><div><font face="courier new, monospace">                               r)))))</font></div><div><font face="courier new, monospace">               rest)))</font></div>

<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">(simple-webserver! (lambda () "Hello World!") port-number: 5000)</font></div></div><div><br></div><div><br></div>

<div><b>Example HTTP client:</b></div><div>(presuming you're in <font face="courier new, monospace">~/proj</font> :)</div><div><br></div><div><font face="courier new, monospace">bsc</font></div><div><font face="courier new, monospace"><br>

</font></div><div><font face="courier new, monospace">(import (std misc/u8v) lib/sack/src/http-client)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">(utf8-u8vector->string (http-response-get-content </font><span style="font-family:'courier new',monospace">(http-get-url "<a href="http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page">http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page</a>")))</span></div>

<div><br></div><div><br></div><div><br></div><div><br></div><div>If you have any queries please don't hesitate to ask.</div><div><br></div><div>Mikael</div><div><br></div><div><br></div><div><div>(<b>Per:</b> Dear Per,</div>

<div><br></div><div>Through this email I'm providing a temporary workaround for the following, though, can you please include this pull request <a href="https://github.com/pereckerdal/blackhole/pull/45">https://github.com/pereckerdal/blackhole/pull/45</a> in the legacy BH repo?</div>

<div><br></div><div>Matthew and anyone downloading legacy BH from github is experiencing complete malfunction until this pull request is included.</div><div><br></div><div>Thanks!)</div></div><div><br></div><div><br></div>

<div><br></div><div><br><div class="gmail_quote">2012/11/28 Matthew Phillips <span dir="ltr"><<a href="mailto:matthew@phillipsoft.biz" target="_blank">matthew@phillipsoft.biz</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br><br><div class="gmail_quote"><div class="im">On Wed, Nov 28, 2012 at 3:26 PM, Mikael <span dir="ltr"><<a href="mailto:mikael.rcv@gmail.com" target="_blank">mikael.rcv@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Ah, noted Sack uses the syntactictower branch's module naming scheme for SRFI:s. Let me know if I should email over one with the non-syntactictower branch's.<div><br></div><div><br></div><div>Apart from what's released online yet, Sack has stable HTTPS server support, let me know if you want it.</div>




<div><br></div><div><br></div><div>Release of improved HTTPS client support as well as an asynchronous HTTP* client API (akin to the API exported by the web browser XHR object) is underway.</div><div><br></div><div>Brgds</div>


<div><div>

<div><br><div class="gmail_quote"><br></div></div></div></div></blockquote><div><br></div></div><div>If you could send me the Sack that works with the legacy branch, that would be wonderful. </div></div>
</blockquote></div><br></div></div></div>