<?xml version='1.0' encoding='UTF-8'?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><title>hyper.dev</title><link>https://hyper.dev</link><description>The easy, fine &amp; neat geek from another world!</description><docs>http://www.rssboard.org/rss-specification</docs><generator>python-feedgen</generator><language>en</language><lastBuildDate>Thu, 30 Nov 2023 19:42:48 +0000</lastBuildDate><item><title>Cross-compiling Racket’s Chez</title><link>https://hyper.dev/2023/04/cross-compiling-chez-racket/</link><description>Racket team lead by Matthew Flatt did an awesome work on Chez Scheme such as aarch64 support, that means you can use Chez on Raspberry Pi 400. Problem is Raspberry Pi 400 is very slow, hence it is better to compile things on another machine.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;Racket team lead by Matthew Flatt did an awesome work on Chez Scheme such as aarch64 support, that means you can use Chez on Raspberry Pi 400. Problem is Raspberry Pi 400 is very slow, hence it is better to compile things on another machine.&lt;/p&gt;
     &lt;p&gt;I used to rely on QEMU, LXC, LXD, then Docker, and podman; this tutorial describe the best workflow I know today to test, and build software across distributions, and across architectures.&lt;/p&gt;
     &lt;p&gt;I work on a Lenovo laptop with Ubuntu, and Alpine on the RasperryPi 400. While I can not claim to be able to reproduce the same environment across distro&amp;#8230; I can haz Chez^W &lt;a href="https://github.com/letloop"&gt;letloop&lt;/a&gt; where ever that matters thanks to Matthew Flatt, and the other awesome people, and companies making code available on the Internet.&lt;/p&gt;
     &lt;p&gt;I want to demonstrate how to use systemd&amp;#8217;s Linux container wrapper aka. &lt;code&gt;systemd-nspawn&lt;/code&gt;, and QEMU, a full hardware emulator that can run any Operating System to compile anything from where you are. Moreover Linux kernel has the ability to run arbitrary executable file formats, and rely on QEMU to execute binaries from other architectures via &lt;a href="https://en.wikipedia.org/wiki/Binfmt_misc"&gt;binfmt_misc&lt;/a&gt;. With that ability, it possible to use a root filesystem for a distribution built for any arch supported by QEMU, and &lt;em&gt;nspawn&lt;/em&gt; inside it, and then compile Chez (or whatever) with ease.&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Note: I tried chroot, and proot, as of 2023, systemd&amp;#8217;s nspawn works better. Docker, and podman should work.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;On the shoulder of giants, that suite of tools allow to cross compile anything from your host with a recent Linux kernel, systemd, QEMU, a rootfs, and that is done without the need to change the build scripts of the software you want to compile.&lt;a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
     &lt;p&gt;To get started on Ubuntu Jammy 22.04, you need the help of &lt;code&gt;apt&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; sudo apt install systemd-container qemu-user-static&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Canonical makes available several root filesystem for several architectures, here we will use Alpine arm64 available at:&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;&lt;a href="https://uk.lxd.images.canonical.com/images/alpine/3.17/arm64/default/"&gt;https://uk.lxd.images.canonical.com/images/alpine/3.17/arm64/default/&lt;/a&gt;&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;Pick the latest, you will be good.&lt;/p&gt;
     &lt;p&gt;Somewhere in your home directory, extract that archive, like:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb2-1"&gt;&lt;a href="#cb2-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; mkdir -p ~/rootfs/alpine/3.17/arm64/&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb2-2"&gt;&lt;a href="#cb2-2" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; cd ~/rootfs/alpine/3.17/arm64/&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb2-3"&gt;&lt;a href="#cb2-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; wget https://uk.lxd.images.canonical.com/images/alpine/3.17/arm64/default/20230412_13:02/rootfs.tar.xz&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb2-4"&gt;&lt;a href="#cb2-4" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; tar xf rootfs.tar.xz&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Before calling &lt;code&gt;tar&lt;/code&gt;, you may verify the file &lt;code&gt;rootfs.tar.gz&lt;/code&gt; with the hash found in the file next to it called &lt;code&gt;SHA256SUM&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;As of 2023, you still need sudo rights to use &lt;code&gt;systemd-nspawn&lt;/code&gt;,&lt;a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; once you hit enter, you will enter Alpine arm64 from your host:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb3-1"&gt;&lt;a href="#cb3-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; sudo systemd-nspawn --uuid=$(systemd-id128 new) -D $(pwd)&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb3-2"&gt;&lt;a href="#cb3-2" aria-hidden="true"&gt;&lt;/a&gt;[&lt;span class="ex"&gt;sudo&lt;/span&gt;] password for amirouche:&lt;/span&gt;
     &lt;span id="cb3-3"&gt;&lt;a href="#cb3-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;Spawning&lt;/span&gt; container blog on /home/amirouche/rootfs/blog.&lt;/span&gt;
     &lt;span id="cb3-4"&gt;&lt;a href="#cb3-4" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;Press&lt;/span&gt; ^] three times within 1s to kill container.&lt;/span&gt;
     &lt;span id="cb3-5"&gt;&lt;a href="#cb3-5" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~#&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;You can triple check that it is indeed arm64^W aarch64 with the following:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb4"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb4-1"&gt;&lt;a href="#cb4-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# uname -a&lt;/span&gt;
     &lt;span id="cb4-2"&gt;&lt;a href="#cb4-2" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;Linux&lt;/span&gt; blog 5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 21:16:15 UTC 2 aarch64 Linux&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;We will proceed with compiling Chez, before, let&amp;#8217;s install dependencies, among other things, git:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb5"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb5-1"&gt;&lt;a href="#cb5-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# apk add build-base git lz4-dev libuuid util-linux-dev zlib-dev&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Then the usual hip command line dance hop that may take a while:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb6"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb6-1"&gt;&lt;a href="#cb6-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# git clone https://github.com/racket/chezscheme&lt;/span&gt;
     &lt;span id="cb6-2"&gt;&lt;a href="#cb6-2" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# cd chezscheme&lt;/span&gt;
     &lt;span id="cb6-3"&gt;&lt;a href="#cb6-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# ./configure --threads --disable-x11 --disable-curses&lt;/span&gt;
     &lt;span id="cb6-4"&gt;&lt;a href="#cb6-4" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# make -j &lt;span class="va"&gt;$(&lt;/span&gt;&lt;span class="ex"&gt;nproc&lt;/span&gt;&lt;span class="va"&gt;)&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-5"&gt;&lt;a href="#cb6-5" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# make install&lt;/span&gt;
     &lt;span id="cb6-6"&gt;&lt;a href="#cb6-6" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;alpine&lt;/span&gt;:~# scheme --version&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Let there be loops ;-)&lt;/p&gt;
     &lt;section class="footnotes" role="doc-endnotes"&gt;
     &lt;hr&gt;
     &lt;ol&gt;
     &lt;li id="fn1" role="doc-endnote"&gt;&lt;p&gt;Look into &amp;#8220;cross compilation late night hell&amp;#8221; if you want to know how hard that can be&lt;a href="#fnref1" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;li id="fn2" role="doc-endnote"&gt;&lt;p&gt;Send me an &lt;a href="mailto:amirouche%20at%20hyper.dev"&gt;email&lt;/a&gt; if that change&lt;a href="#fnref2" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;/section&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/04/cross-compiling-chez-racket/</guid><pubDate>Wed, 12 Apr 2023 00:00:00 +0000</pubDate></item><item><title>Petit Cloud - 0 - Specification</title><link>https://hyper.dev/2023/04/petit-cloud-specification/</link><description>You may remember the days of html, dynamic or not, php3, funny, and funky under construction 🚧 Ah!… While the visual aesthetic may remain in the past, the ease, and simplicity to create, show, and tell used to be simpler, easier, and more fun. Petit Cloud is a demonstration that the 90s, early 00s workflow can be implemented for fun with our favorite material.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;You may remember the days of html, dynamic or not, php3, funny, and funky under construction &amp;#128679;&amp;#8230; Ah!&amp;#8230; While the visual aesthetic can remain in the past, the ease, and simplicity to create, show, and tell used to be simpler, easier, and more fun. Petit Cloud is a demonstration that the 90s, early 00s workflow can be implemented for fun with our favorite material.&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Any resemblance to competitor technology is wholly, and fully coincidental.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;h2 id="specification"&gt;Specification&lt;/h2&gt;
     &lt;p&gt;The interface can not be simpler. Given a &lt;code&gt;www.scm&lt;/code&gt; with an exported procedure &lt;code&gt;main&lt;/code&gt;, it should be possible to do the following:&lt;/p&gt;
     &lt;pre class="shell"&gt;&lt;code&gt;#;sh&amp;gt; petit-cloud deploy www.example www.scm&lt;/code&gt;&lt;/pre&gt;
     &lt;p&gt;Here the intent is to deploy the code of &lt;code&gt;WWW.SCM&lt;/code&gt; including dependencies, to &lt;code&gt;WWW.EXAMPLE&lt;/code&gt;, both are parameter, and may be changed at will.&lt;/p&gt;
     &lt;p&gt;At this point jumping to &lt;code&gt;https://www.example/&lt;/code&gt; should display page associated with the root path.&lt;/p&gt;
     &lt;p&gt;The procedure &lt;code&gt;MAIN&lt;/code&gt; is the request handler. It takes as argument the HTTP request parts:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;method&lt;/li&gt;
     &lt;li&gt;url&lt;/li&gt;
     &lt;li&gt;headers&lt;/li&gt;
     &lt;li&gt;body&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;It is expected to return three values:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;integer&lt;/li&gt;
     &lt;li&gt;headers&lt;/li&gt;
     &lt;li&gt;body&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;&lt;code&gt;BODY&lt;/code&gt; is always a bytevector. &lt;code&gt;headers&lt;/code&gt; is an list mapping a symbol to a string. &lt;code&gt;URL&lt;/code&gt; is the complete Universal Ressource Location including scheme, host, path, query string, and fragment as a list. Here is a possible value for &lt;code&gt;URL&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb2-1"&gt;&lt;a href="#cb2-1" aria-hidden="true"&gt;&lt;/a&gt;(assert (&lt;span class="kw"&gt;equal?&lt;/span&gt; url (&lt;span class="kw"&gt;list&lt;/span&gt; 'https&lt;/span&gt;
     &lt;span id="cb2-2"&gt;&lt;a href="#cb2-2" aria-hidden="true"&gt;&lt;/a&gt;                          (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="st"&gt;"example"&lt;/span&gt; &lt;span class="st"&gt;"www"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb2-3"&gt;&lt;a href="#cb2-3" aria-hidden="true"&gt;&lt;/a&gt;                          (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="st"&gt;"path"&lt;/span&gt; &lt;span class="st"&gt;"to"&lt;/span&gt; &lt;span class="st"&gt;"object"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb2-4"&gt;&lt;a href="#cb2-4" aria-hidden="true"&gt;&lt;/a&gt;                          (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'q &lt;span class="st"&gt;"freedom"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb2-5"&gt;&lt;a href="#cb2-5" aria-hidden="true"&gt;&lt;/a&gt;                          (&lt;span class="kw"&gt;list&lt;/span&gt;))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;A hello world &lt;code&gt;MAIN&lt;/code&gt; can look like:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb3-1"&gt;&lt;a href="#cb3-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; main&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb3-2"&gt;&lt;a href="#cb3-2" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method url headers body)&lt;/span&gt;
     &lt;span id="cb3-3"&gt;&lt;a href="#cb3-3" aria-hidden="true"&gt;&lt;/a&gt;    (match (&lt;span class="kw"&gt;cons&lt;/span&gt; method path)&lt;/span&gt;
     &lt;span id="cb3-4"&gt;&lt;a href="#cb3-4" aria-hidden="true"&gt;&lt;/a&gt;      (() (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb3-5"&gt;&lt;a href="#cb3-5" aria-hidden="true"&gt;&lt;/a&gt;                  '((content-type . &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb3-6"&gt;&lt;a href="#cb3-6" aria-hidden="true"&gt;&lt;/a&gt;                  (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemer!"&lt;/span&gt;)))&lt;/span&gt;
     &lt;span id="cb3-7"&gt;&lt;a href="#cb3-7" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;else&lt;/span&gt; (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;404&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb3-8"&gt;&lt;a href="#cb3-8" aria-hidden="true"&gt;&lt;/a&gt;                    '((content-type . &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb3-9"&gt;&lt;a href="#cb3-9" aria-hidden="true"&gt;&lt;/a&gt;                    (string-&amp;gt;utf8 &lt;span class="st"&gt;"Nothing here, error 404!"&lt;/span&gt;))))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Furthermore, a couple of procedure should be made available:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;code&gt;www-form-urlencoded-read&lt;/code&gt; that helps with forms;&lt;/li&gt;
     &lt;li&gt;&lt;code&gt;jsonify&lt;/code&gt; that takes a scheme objects as argument, and returns the bytevector made of its JSON representation;&lt;/li&gt;
     &lt;li&gt;&lt;code&gt;htmlify&lt;/code&gt; same as &lt;code&gt;jsonify&lt;/code&gt; for HTML.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;Go back, rest, think, and eat your vegetables.&lt;/p&gt;
     &lt;center&gt;
     t&lt;img src="vegetables-vs-machine-vs-kids.gif" alt="All kinds of vegetables that go throught a mixer for the pleasure of people like us"&gt;
     &lt;center&gt;
	&lt;/center&gt;&lt;/center&gt;&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/04/petit-cloud-specification/</guid><pubDate>Thu, 13 Apr 2023 00:00:00 +0000</pubDate></item><item><title>Petit Cloud - 1 - Kickstart</title><link>https://hyper.dev/2023/04/petit-cloud-kickstart/</link><description>In the previous article, we set our goal to deploy a program in one hip command line hop, let’s kickstart the code with an outline of the application server.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;In the previous article, we set a goal to deploy a program in one hip command line hop, let&amp;#8217;s kickstart the code with an outline of the application server.&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Any resemblance to competitor technology is wholly, and fully coincidental.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;h2 id="continuation"&gt;Continuation&lt;/h2&gt;
     &lt;p&gt;We want to deploy http web application stuffed into a &lt;code&gt;hello&lt;/code&gt; library that looks like the following:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;;; hello.scm&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-2"&gt;&lt;a href="#cb1-2" aria-hidden="true"&gt;&lt;/a&gt;(library (hello)&lt;/span&gt;
     &lt;span id="cb1-3"&gt;&lt;a href="#cb1-3" aria-hidden="true"&gt;&lt;/a&gt;  (export main)&lt;/span&gt;
     &lt;span id="cb1-4"&gt;&lt;a href="#cb1-4" aria-hidden="true"&gt;&lt;/a&gt;  (import (petit-cloud application))&lt;/span&gt;
     &lt;span id="cb1-5"&gt;&lt;a href="#cb1-5" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-6"&gt;&lt;a href="#cb1-6" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; main&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path headers body)&lt;/span&gt;
     &lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true"&gt;&lt;/a&gt;              (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'content-type &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true"&gt;&lt;/a&gt;              (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemer!\n"&lt;/span&gt;)))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The expected, so called workflow, is that given an existing application server running at &lt;code&gt;www.example:9999&lt;/code&gt;, we want to deploy the above library with the following one-liner:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb2-1"&gt;&lt;a href="#cb2-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; petit-cloud deploy www.example:9999 hello.scm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;When that command is issued, we will be prompted for a password, after a nanowhile, we will be able the manually test it with:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb3-1"&gt;&lt;a href="#cb3-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; curl http://www.example:9999&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb3-2"&gt;&lt;a href="#cb3-2" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="ex"&gt;Hello&lt;/span&gt; schemer!&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The application server will be listening to port 9999 of all available network interfaces, that can be done with:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb4"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb4-1"&gt;&lt;a href="#cb4-1" aria-hidden="true"&gt;&lt;/a&gt;(define-values (client-accept close)&lt;/span&gt;
     &lt;span id="cb4-2"&gt;&lt;a href="#cb4-2" aria-hidden="true"&gt;&lt;/a&gt;  (petit-cloud-http-connect &lt;span class="st"&gt;"0.0.0.0"&lt;/span&gt; &lt;span class="dv"&gt;9999&lt;/span&gt;))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The variable &lt;code&gt;client-socket&lt;/code&gt; is a generator of three objects &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, and &lt;code&gt;close&lt;/code&gt;, that work as follow:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;code&gt;(read)&lt;/code&gt; will produce a representation of an HTTP request;&lt;/li&gt;
     &lt;li&gt;&lt;code&gt;(write object)&lt;/code&gt; will write &lt;code&gt;OBJECT&lt;/code&gt; as an HTTP response;&lt;/li&gt;
     &lt;li&gt;&lt;code&gt;(close)&lt;/code&gt; will close the connection.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;The simplest way to use it is:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb5"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb5-1"&gt;&lt;a href="#cb5-1" aria-hidden="true"&gt;&lt;/a&gt;(define-values (client-accept close)&lt;/span&gt;
     &lt;span id="cb5-2"&gt;&lt;a href="#cb5-2" aria-hidden="true"&gt;&lt;/a&gt;  (petit-cloud-http-connect &lt;span class="st"&gt;"0.0.0.0"&lt;/span&gt; &lt;span class="dv"&gt;9999&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb5-3"&gt;&lt;a href="#cb5-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb5-4"&gt;&lt;a href="#cb5-4" aria-hidden="true"&gt;&lt;/a&gt;(define-values (&lt;span class="kw"&gt;read&lt;/span&gt; &lt;span class="kw"&gt;write&lt;/span&gt; close)&lt;/span&gt;
     &lt;span id="cb5-5"&gt;&lt;a href="#cb5-5" aria-hidden="true"&gt;&lt;/a&gt;  &lt;span class="co"&gt;;; client-accept will pause&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb5-6"&gt;&lt;a href="#cb5-6" aria-hidden="true"&gt;&lt;/a&gt;  &lt;span class="co"&gt;;; until a HTTP request hit&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb5-7"&gt;&lt;a href="#cb5-7" aria-hidden="true"&gt;&lt;/a&gt;  &lt;span class="co"&gt;;; the port 9999&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb5-8"&gt;&lt;a href="#cb5-8" aria-hidden="true"&gt;&lt;/a&gt;  (client-accept))&lt;/span&gt;
     &lt;span id="cb5-9"&gt;&lt;a href="#cb5-9" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb5-10"&gt;&lt;a href="#cb5-10" aria-hidden="true"&gt;&lt;/a&gt;(define-values (method url headers body) (&lt;span class="kw"&gt;read&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb5-11"&gt;&lt;a href="#cb5-11" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;;; let's reply&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb5-12"&gt;&lt;a href="#cb5-12" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;write&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb5-13"&gt;&lt;a href="#cb5-13" aria-hidden="true"&gt;&lt;/a&gt;       (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'content-type &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb5-14"&gt;&lt;a href="#cb5-14" aria-hidden="true"&gt;&lt;/a&gt;       (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemers\n"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb5-15"&gt;&lt;a href="#cb5-15" aria-hidden="true"&gt;&lt;/a&gt;(close)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;It is possible accept multiple clients simultaneously, by passing a procedure to &lt;code&gt;petit-cloud-http-connect&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb6"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb6-1"&gt;&lt;a href="#cb6-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; client-accept&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-2"&gt;&lt;a href="#cb6-2" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (&lt;span class="kw"&gt;read&lt;/span&gt; &lt;span class="kw"&gt;write&lt;/span&gt; close)&lt;/span&gt;
     &lt;span id="cb6-3"&gt;&lt;a href="#cb6-3" aria-hidden="true"&gt;&lt;/a&gt;    &lt;span class="co"&gt;;; where is everyone&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-4"&gt;&lt;a href="#cb6-4" aria-hidden="true"&gt;&lt;/a&gt;    (define-values (method url headers body) (&lt;span class="kw"&gt;read&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb6-5"&gt;&lt;a href="#cb6-5" aria-hidden="true"&gt;&lt;/a&gt;    &lt;span class="co"&gt;;; reply&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-6"&gt;&lt;a href="#cb6-6" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;write&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-7"&gt;&lt;a href="#cb6-7" aria-hidden="true"&gt;&lt;/a&gt;           (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'content-type &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb6-8"&gt;&lt;a href="#cb6-8" aria-hidden="true"&gt;&lt;/a&gt;           (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemers\n"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb6-9"&gt;&lt;a href="#cb6-9" aria-hidden="true"&gt;&lt;/a&gt;    &lt;span class="co"&gt;;; the end&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-10"&gt;&lt;a href="#cb6-10" aria-hidden="true"&gt;&lt;/a&gt;    (close)))&lt;/span&gt;
     &lt;span id="cb6-11"&gt;&lt;a href="#cb6-11" aria-hidden="true"&gt;&lt;/a&gt;           &lt;/span&gt;
     &lt;span id="cb6-12"&gt;&lt;a href="#cb6-12" aria-hidden="true"&gt;&lt;/a&gt;(petit-cloud-http-connect &lt;span class="st"&gt;"0.0.0.0"&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-13"&gt;&lt;a href="#cb6-13" aria-hidden="true"&gt;&lt;/a&gt;                          &lt;span class="dv"&gt;9999&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-14"&gt;&lt;a href="#cb6-14" aria-hidden="true"&gt;&lt;/a&gt;                          client-accept)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The command call &lt;code&gt;petit-cloud deploy&lt;/code&gt; will hit the application server with a &lt;code&gt;method&lt;/code&gt; that is the symbol &lt;code&gt;'POST&lt;/code&gt;, and an &lt;code&gt;url&lt;/code&gt; that is:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb7"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb7-1"&gt;&lt;a href="#cb7-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="dv"&gt;9999&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb7-2"&gt;&lt;a href="#cb7-2" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="st"&gt;"example"&lt;/span&gt; &lt;span class="st"&gt;"www"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb7-3"&gt;&lt;a href="#cb7-3" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="st"&gt;"_"&lt;/span&gt; &lt;span class="st"&gt;"api"&lt;/span&gt; &lt;span class="st"&gt;"petit"&lt;/span&gt; &lt;span class="st"&gt;"cloud"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb7-4"&gt;&lt;a href="#cb7-4" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;list&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb7-5"&gt;&lt;a href="#cb7-5" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;list&lt;/span&gt;))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;And the body is the bytevector representation of &lt;code&gt;hello.scm&lt;/code&gt; at the start of the article.&lt;/p&gt;
     &lt;p&gt;We can implement a predicate that returns &lt;code&gt;#t&lt;/code&gt; when it is a call by &lt;code&gt;petit-cloud deploy&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb8"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb8-1"&gt;&lt;a href="#cb8-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; petit-cloud-deploy&lt;/span&gt;?&lt;/span&gt;
     &lt;span id="cb8-2"&gt;&lt;a href="#cb8-2" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path)&lt;/span&gt;
     &lt;span id="cb8-3"&gt;&lt;a href="#cb8-3" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;equal?&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'POST &lt;/span&gt;
     &lt;span id="cb8-4"&gt;&lt;a href="#cb8-4" aria-hidden="true"&gt;&lt;/a&gt;                  (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="dv"&gt;9999&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb8-5"&gt;&lt;a href="#cb8-5" aria-hidden="true"&gt;&lt;/a&gt;                        (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="st"&gt;"example"&lt;/span&gt; &lt;span class="st"&gt;"www"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb8-6"&gt;&lt;a href="#cb8-6" aria-hidden="true"&gt;&lt;/a&gt;                        (&lt;span class="st"&gt;"_"&lt;/span&gt; &lt;span class="st"&gt;"api"&lt;/span&gt; &lt;span class="st"&gt;"petit"&lt;/span&gt; &lt;span class="st"&gt;"cloud"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb8-7"&gt;&lt;a href="#cb8-7" aria-hidden="true"&gt;&lt;/a&gt;                        (&lt;span class="kw"&gt;list&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb8-8"&gt;&lt;a href="#cb8-8" aria-hidden="true"&gt;&lt;/a&gt;                        (&lt;span class="kw"&gt;list&lt;/span&gt;)))&lt;/span&gt;
     &lt;span id="cb8-9"&gt;&lt;a href="#cb8-9" aria-hidden="true"&gt;&lt;/a&gt;            (&lt;span class="kw"&gt;cons&lt;/span&gt; method path))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;If the request is not a deployment, we fallback to the application procedure returned by the parameter &lt;code&gt;petit-cloud-current-application&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;At this point, and without any error handling, our application server code looks like the following:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb9"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb9-1"&gt;&lt;a href="#cb9-1" aria-hidden="true"&gt;&lt;/a&gt;(import (petit-cloud))&lt;/span&gt;
     &lt;span id="cb9-2"&gt;&lt;a href="#cb9-2" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb9-3"&gt;&lt;a href="#cb9-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb9-4"&gt;&lt;a href="#cb9-4" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; petit-cloud-deploy&lt;/span&gt;?&lt;/span&gt;
     &lt;span id="cb9-5"&gt;&lt;a href="#cb9-5" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path)&lt;/span&gt;
     &lt;span id="cb9-6"&gt;&lt;a href="#cb9-6" aria-hidden="true"&gt;&lt;/a&gt;    (equal (&lt;span class="kw"&gt;cons&lt;/span&gt; 'POST &lt;/span&gt;
     &lt;span id="cb9-7"&gt;&lt;a href="#cb9-7" aria-hidden="true"&gt;&lt;/a&gt;                 (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="dv"&gt;9999&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb9-8"&gt;&lt;a href="#cb9-8" aria-hidden="true"&gt;&lt;/a&gt;                       &lt;span class="co"&gt;;; TODO: do not hardcode port, and domain&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb9-9"&gt;&lt;a href="#cb9-9" aria-hidden="true"&gt;&lt;/a&gt;                       (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="st"&gt;"example"&lt;/span&gt; &lt;span class="st"&gt;"www"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb9-10"&gt;&lt;a href="#cb9-10" aria-hidden="true"&gt;&lt;/a&gt;                       (&lt;span class="kw"&gt;list&lt;/span&gt; &lt;span class="st"&gt;"_"&lt;/span&gt; &lt;span class="st"&gt;"api"&lt;/span&gt; &lt;span class="st"&gt;"petit"&lt;/span&gt; &lt;span class="st"&gt;"cloud"&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb9-11"&gt;&lt;a href="#cb9-11" aria-hidden="true"&gt;&lt;/a&gt;                       (&lt;span class="kw"&gt;list&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb9-12"&gt;&lt;a href="#cb9-12" aria-hidden="true"&gt;&lt;/a&gt;                       (&lt;span class="kw"&gt;list&lt;/span&gt;)))&lt;/span&gt;
     &lt;span id="cb9-13"&gt;&lt;a href="#cb9-13" aria-hidden="true"&gt;&lt;/a&gt;           (&lt;span class="kw"&gt;cons&lt;/span&gt; method path))))&lt;/span&gt;
     &lt;span id="cb9-14"&gt;&lt;a href="#cb9-14" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb9-15"&gt;&lt;a href="#cb9-15" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; client-accept&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb9-16"&gt;&lt;a href="#cb9-16" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (&lt;span class="kw"&gt;read&lt;/span&gt; &lt;span class="kw"&gt;write&lt;/span&gt; close)&lt;/span&gt;
     &lt;span id="cb9-17"&gt;&lt;a href="#cb9-17" aria-hidden="true"&gt;&lt;/a&gt;    (define-values (method url headers body) (&lt;span class="kw"&gt;read&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb9-18"&gt;&lt;a href="#cb9-18" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;if&lt;/span&gt; (petit-cloud-deploy? method path)&lt;/span&gt;
     &lt;span id="cb9-19"&gt;&lt;a href="#cb9-19" aria-hidden="true"&gt;&lt;/a&gt;        (&lt;span class="kw"&gt;let&lt;/span&gt; ((application (make-petit-cloud-application body)))&lt;/span&gt;
     &lt;span id="cb9-20"&gt;&lt;a href="#cb9-20" aria-hidden="true"&gt;&lt;/a&gt;          (petit-cloud-current-application application)&lt;/span&gt;
     &lt;span id="cb9-21"&gt;&lt;a href="#cb9-21" aria-hidden="true"&gt;&lt;/a&gt;          (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;201&lt;/span&gt; (&lt;span class="kw"&gt;list&lt;/span&gt;) (bytevector)))&lt;/span&gt;
     &lt;span id="cb9-22"&gt;&lt;a href="#cb9-22" aria-hidden="true"&gt;&lt;/a&gt;        (&lt;span class="kw"&gt;let&lt;/span&gt; ((application (petit-cloud-current-application)))&lt;/span&gt;
     &lt;span id="cb9-23"&gt;&lt;a href="#cb9-23" aria-hidden="true"&gt;&lt;/a&gt;          (application method url headers body)))))&lt;/span&gt;
     &lt;span id="cb9-24"&gt;&lt;a href="#cb9-24" aria-hidden="true"&gt;&lt;/a&gt;           &lt;/span&gt;
     &lt;span id="cb9-25"&gt;&lt;a href="#cb9-25" aria-hidden="true"&gt;&lt;/a&gt;(petit-cloud-http-connect &lt;span class="st"&gt;"0.0.0.0"&lt;/span&gt; &lt;span class="dv"&gt;9999&lt;/span&gt; client-accept)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;h2 id="backtracking"&gt;Backtracking&lt;/h2&gt;
     &lt;p&gt;Let&amp;#8217;s summarize:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;p&gt;The evaluation of the expression &lt;code&gt;(petit-cloud-http-connect ip port   handler)&lt;/code&gt; will call &lt;code&gt;HANDLER&lt;/code&gt; on each new request. The definition of &lt;code&gt;petit-cloud-http-connect&lt;/code&gt; is interesting for the purpose of building a petit cloud, call that the cherry on the cake.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;The procedure mentioned above called &lt;code&gt;HANDLER&lt;/code&gt; is passed three arguments: &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, and &lt;code&gt;close&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;Each procedure of &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, and &lt;code&gt;close&lt;/code&gt; follow a precise protocol. The way they are applied, its arguments, and return values, but also the order in which each of them is called is specified. For instance, calling &lt;code&gt;close&lt;/code&gt;, thereafter &lt;code&gt;read&lt;/code&gt; or &lt;code&gt;write&lt;/code&gt; does not make sense, because after &lt;code&gt;(close)&lt;/code&gt; there is no-one listening.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;The procedure &lt;code&gt;petit-cloud deploy&lt;/code&gt; will call the procedure &lt;code&gt;HANDLER&lt;/code&gt;, compute a new application with &lt;code&gt;make-petit-cloud-application&lt;/code&gt;, with the returned procedure, reset the parameter &lt;code&gt;petit-cloud-current-application&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;What &lt;code&gt;(make-petit-cloud-application body)&lt;/code&gt; do is very interesting. Tho, at this time, that is only food for thought.&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="not-romanesco-brocoli-jumping.gif" title="fig:" alt="happy jumping broccoli is food"&gt;
     &lt;/center&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/04/petit-cloud-kickstart/</guid><pubDate>Thu, 13 Apr 2023 00:00:00 +0000</pubDate></item><item><title>Petit Cloud - 2 - Kernel</title><link>https://hyper.dev/2023/04/petit-cloud-kernel/</link><description>We jumped into an adventure to build the simplest way possible to deploy a Scheme web application. In the previous article, we identified two procedures. Today we will dive into the kernel.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;We jumped into an adventure to build the simplest way possible to deploy a Scheme web application. In the previous article, we identified two procedures, &lt;code&gt;petit-cloud-http-connect&lt;/code&gt;, and the kernel procedure &lt;code&gt;make-petit-cloud-application&lt;/code&gt;. We will dive into the latter.&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Any resemblance to competitor technology is wholly, and fully coincidental.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;h2 id="continuation"&gt;Continuation&lt;/h2&gt;
     &lt;p&gt;We want to deploy http web application built with a library &lt;code&gt;(hello)&lt;/code&gt; with a procedure &lt;code&gt;main&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;;; hello.scm&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-2"&gt;&lt;a href="#cb1-2" aria-hidden="true"&gt;&lt;/a&gt;(library (hello)&lt;/span&gt;
     &lt;span id="cb1-3"&gt;&lt;a href="#cb1-3" aria-hidden="true"&gt;&lt;/a&gt;  (export main)&lt;/span&gt;
     &lt;span id="cb1-4"&gt;&lt;a href="#cb1-4" aria-hidden="true"&gt;&lt;/a&gt;  (import (petit-cloud application))&lt;/span&gt;
     &lt;span id="cb1-5"&gt;&lt;a href="#cb1-5" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-6"&gt;&lt;a href="#cb1-6" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; main&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path headers body)&lt;/span&gt;
     &lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true"&gt;&lt;/a&gt;              (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'content-type &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true"&gt;&lt;/a&gt;              (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemer!\n"&lt;/span&gt;)))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Given an application server running at &lt;code&gt;DOMAIN:PORT&lt;/code&gt;, it must be possible to deploy it with the following shell invokation:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode bash"&gt;&lt;code class="sourceCode bash"&gt;&lt;span id="cb2-1"&gt;&lt;a href="#cb2-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;#;sh&amp;gt; petit-cloud deploy DOMAIN:PORT hello.scm&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Short of logging, monitoring devices, and error handling, the application server code is:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb3-1"&gt;&lt;a href="#cb3-1" aria-hidden="true"&gt;&lt;/a&gt;(import (petit-cloud))&lt;/span&gt;
     &lt;span id="cb3-2"&gt;&lt;a href="#cb3-2" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb3-3"&gt;&lt;a href="#cb3-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb3-4"&gt;&lt;a href="#cb3-4" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; petit-cloud-deploy&lt;/span&gt;?&lt;/span&gt;
     &lt;span id="cb3-5"&gt;&lt;a href="#cb3-5" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path)&lt;/span&gt;
     &lt;span id="cb3-6"&gt;&lt;a href="#cb3-6" aria-hidden="true"&gt;&lt;/a&gt;    ...))&lt;/span&gt;
     &lt;span id="cb3-7"&gt;&lt;a href="#cb3-7" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb3-8"&gt;&lt;a href="#cb3-8" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; client-accept&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb3-9"&gt;&lt;a href="#cb3-9" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (&lt;span class="kw"&gt;read&lt;/span&gt; &lt;span class="kw"&gt;write&lt;/span&gt; close)&lt;/span&gt;
     &lt;span id="cb3-10"&gt;&lt;a href="#cb3-10" aria-hidden="true"&gt;&lt;/a&gt;    (define-values (method url headers body) (&lt;span class="kw"&gt;read&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb3-11"&gt;&lt;a href="#cb3-11" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;if&lt;/span&gt; (petit-cloud-deploy? method path)&lt;/span&gt;
     &lt;span id="cb3-12"&gt;&lt;a href="#cb3-12" aria-hidden="true"&gt;&lt;/a&gt;        (&lt;span class="kw"&gt;let&lt;/span&gt; ((application (make-petit-cloud-application body)))&lt;/span&gt;
     &lt;span id="cb3-13"&gt;&lt;a href="#cb3-13" aria-hidden="true"&gt;&lt;/a&gt;          (petit-cloud-current-application application)&lt;/span&gt;
     &lt;span id="cb3-14"&gt;&lt;a href="#cb3-14" aria-hidden="true"&gt;&lt;/a&gt;          (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;201&lt;/span&gt; (&lt;span class="kw"&gt;list&lt;/span&gt;) (bytevector)))&lt;/span&gt;
     &lt;span id="cb3-15"&gt;&lt;a href="#cb3-15" aria-hidden="true"&gt;&lt;/a&gt;        (&lt;span class="kw"&gt;let&lt;/span&gt; ((application (petit-cloud-current-application)))&lt;/span&gt;
     &lt;span id="cb3-16"&gt;&lt;a href="#cb3-16" aria-hidden="true"&gt;&lt;/a&gt;          (application method url headers body)))))&lt;/span&gt;
     &lt;span id="cb3-17"&gt;&lt;a href="#cb3-17" aria-hidden="true"&gt;&lt;/a&gt;           &lt;/span&gt;
     &lt;span id="cb3-18"&gt;&lt;a href="#cb3-18" aria-hidden="true"&gt;&lt;/a&gt;(petit-cloud-http-connect DOMAIN PORT client-accept)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The procedure &lt;code&gt;make-petit-cloud-application&lt;/code&gt; takes a bytevector as argument that is read into a symbolic expression that is the same as the library &lt;code&gt;(hello)&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb4"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb4-1"&gt;&lt;a href="#cb4-1" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;;; hello.scm&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb4-2"&gt;&lt;a href="#cb4-2" aria-hidden="true"&gt;&lt;/a&gt;(library (hello)&lt;/span&gt;
     &lt;span id="cb4-3"&gt;&lt;a href="#cb4-3" aria-hidden="true"&gt;&lt;/a&gt;  (export main)&lt;/span&gt;
     &lt;span id="cb4-4"&gt;&lt;a href="#cb4-4" aria-hidden="true"&gt;&lt;/a&gt;  (import (petit-cloud application))&lt;/span&gt;
     &lt;span id="cb4-5"&gt;&lt;a href="#cb4-5" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb4-6"&gt;&lt;a href="#cb4-6" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; main&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb4-7"&gt;&lt;a href="#cb4-7" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path headers body)&lt;/span&gt;
     &lt;span id="cb4-8"&gt;&lt;a href="#cb4-8" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb4-9"&gt;&lt;a href="#cb4-9" aria-hidden="true"&gt;&lt;/a&gt;              (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'content-type &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb4-10"&gt;&lt;a href="#cb4-10" aria-hidden="true"&gt;&lt;/a&gt;              (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemer!\n"&lt;/span&gt;)))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;We want to translate the library &lt;code&gt;(hello)&lt;/code&gt; into executable code, in other words convert data into code.&lt;/p&gt;
     &lt;p&gt;Turning data, into a program can be done with an interpreter.&lt;/p&gt;
     &lt;p&gt;In the case of Scheme, is to use the readily available &lt;code&gt;eval&lt;/code&gt;.&lt;a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Even if they are ways to &lt;a href="https://srfi.schemers.org/srfi-172/"&gt;make it safer&lt;/a&gt;, or safe, the procedure &lt;code&gt;eval&lt;/code&gt; is unsafe, it can have side effects, and other effects that will have significant security consequences: do not expose such an application server in open Internet without the careful review of an expert.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;As of 2023, R7RS specify &lt;code&gt;eval&lt;/code&gt; as follow:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb5"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb5-1"&gt;&lt;a href="#cb5-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; expr-or-definition environment-specifier)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The form &lt;code&gt;library&lt;/code&gt; is neither an expression, or definition it is in most Scheme implementation a meta-syntaxic device hardcoded in the macro expander, the same component responsible for interpreting macros.&lt;/p&gt;
     &lt;p&gt;We could rename, and write &lt;code&gt;(hello)&lt;/code&gt; on disk, but there is a more straightforward way, a transformation relying on &lt;code&gt;define&lt;/code&gt;, &lt;code&gt;set!&lt;/code&gt;, and &lt;code&gt;let&lt;/code&gt;. The library &lt;code&gt;(hello)&lt;/code&gt; can be rewritten into an expression that can be handed to &lt;code&gt;eval&lt;/code&gt; to return the procedure &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;The transformation will yield the following expression called &lt;code&gt;module&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb6"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb6-1"&gt;&lt;a href="#cb6-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;begin&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-2"&gt;&lt;a href="#cb6-2" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; main &lt;/span&gt;&lt;span class="dv"&gt;#f&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb6-3"&gt;&lt;a href="#cb6-3" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb6-4"&gt;&lt;a href="#cb6-4" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;let&lt;/span&gt; ()&lt;/span&gt;
     &lt;span id="cb6-5"&gt;&lt;a href="#cb6-5" aria-hidden="true"&gt;&lt;/a&gt;    &lt;/span&gt;
     &lt;span id="cb6-6"&gt;&lt;a href="#cb6-6" aria-hidden="true"&gt;&lt;/a&gt;    (set! main&lt;/span&gt;
     &lt;span id="cb6-7"&gt;&lt;a href="#cb6-7" aria-hidden="true"&gt;&lt;/a&gt;          (&lt;span class="kw"&gt;lambda&lt;/span&gt; (method path headers body)&lt;/span&gt;
     &lt;span id="cb6-8"&gt;&lt;a href="#cb6-8" aria-hidden="true"&gt;&lt;/a&gt;            (&lt;span class="kw"&gt;values&lt;/span&gt; &lt;span class="dv"&gt;200&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb6-9"&gt;&lt;a href="#cb6-9" aria-hidden="true"&gt;&lt;/a&gt;                    (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'content-type &lt;span class="st"&gt;"text/plain"&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb6-10"&gt;&lt;a href="#cb6-10" aria-hidden="true"&gt;&lt;/a&gt;                    (string-&amp;gt;utf8 &lt;span class="st"&gt;"Hello schemer!\n"&lt;/span&gt;)))))&lt;/span&gt;
     &lt;span id="cb6-11"&gt;&lt;a href="#cb6-11" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb6-12"&gt;&lt;a href="#cb6-12" aria-hidden="true"&gt;&lt;/a&gt;  main)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Then, the following snippet, will return &lt;code&gt;main&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb7"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb7-1"&gt;&lt;a href="#cb7-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; module '(petit-cloud application))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;That is enough to known to implement a simple &lt;code&gt;make-petit-cloud-application&lt;/code&gt;.&lt;/p&gt;
     &lt;h2 id="backtracking"&gt;Backtracking&lt;/h2&gt;
     &lt;p&gt;We described how to transform an library definition, into an expression that can be fed into &lt;code&gt;eval&lt;/code&gt;, that will return the procedure that will eventually reply to end-users.&lt;/p&gt;
     &lt;p&gt;That is not a complete implementation, more code are necessary to make this outline fit for production. If you want to use such an application server, and self-host it, the code is within reach.&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="image.gif"&gt;
     &lt;/center&gt;
     &lt;section class="footnotes" role="doc-endnotes"&gt;
     &lt;hr&gt;
     &lt;ol&gt;
     &lt;li id="fn1" role="doc-endnote"&gt;&lt;p&gt;The procedure &lt;code&gt;eval&lt;/code&gt; can be implemented as an interpreter, or compiler&lt;a href="#fnref1" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;/section&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/04/petit-cloud-kernel/</guid><pubDate>Wed, 19 Apr 2023 00:00:00 +0000</pubDate></item><item><title>letloop v6</title><link>https://hyper.dev/2023/07/letloop-v6/</link><description>letloop is command line tool for Chez Scheme with (eventually) all the goodies packed in.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;letloop is a Chez Scheme command line tool with some goodies: the test runner with code coverage makes sure you touch the ground running, and it also possible to produce elf binaries for your deployment convenience.&lt;/p&gt;
     &lt;p&gt;The algorithm to reduce entropy is missing. Be assured that I am doing everything I can to fix the current state of the art^W loop. Meanwhile, download letloop for your favorite GNU/Linux, or (Just Linux), then you can use the following templates as inspiration to invoke your favorite, all around best scheming device:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;p&gt;&lt;code&gt;letloop exec program.scm&lt;/code&gt; executes program.scm;&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&lt;code&gt;letloop compile program.scm&lt;/code&gt; will produce an elf binary called &lt;code&gt;a.out&lt;/code&gt; for &lt;code&gt;program.scm&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&lt;code&gt;letloop check library.scm&lt;/code&gt; execute the test runner for &lt;code&gt;library.scm&lt;/code&gt;. The test runner expects tests to be thunks named with a prefix &lt;code&gt;~check-&lt;/code&gt; e.g.&amp;#160;&lt;code&gt;~check-ess-000-earth-is-not-flat&lt;/code&gt; exported by &lt;code&gt;library.scm&lt;/code&gt;. The test runner expects a return value that satisfies the following predicate &lt;code&gt;(lambda (x) (eq? x #true)&lt;/code&gt;, otherwise anything besides &lt;code&gt;#true&lt;/code&gt; is considered a test failure, or error, use &lt;code&gt;--fail-fast&lt;/code&gt; to exit as soon as bad things happens. A HTML code coverage report with number of run times is produced. It helps identify hot, cold, and dead code.&lt;/p&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;blockquote&gt;
     &lt;p&gt;&lt;a href="https://github.com/letloop/cli/releases/tag/v6"&gt;v6 - let loop be (with small fixes)&lt;/a&gt;&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;letloop offered with the hope of being useable, useful, and used. If you think it fails at one of those, reach me at &lt;a href="mailto:amirouche+letloop@hyper.dev"&gt;amirouche@hyper.dev&lt;/a&gt;.&lt;/p&gt;
     &lt;p&gt;This post was sponsored by my grand ma as known as: mother Lily of the valley.&lt;/p&gt;
     &lt;center&gt;
     &lt;video src="lily-of-the-valley.mp4" title="fig:" controls=""&gt;&lt;a href="lily-of-the-valley.mp4"&gt;Lily of the valley on top of a mushroom collecting drops of rain from a flower&lt;/a&gt;&lt;/video&gt;
     &lt;/center&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/07/letloop-v6/</guid><pubDate>Tue, 04 Jul 2023 00:00:00 +0000</pubDate></item><item><title>dx - 0 - cheatsheet on discourse</title><link>https://hyper.dev/2023/09/cheatsheet-on-discourse/</link><description>Before you speak, let your words pass through tree gates.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;Screenshot from inanimate alice, perpetual nomads. Available at &lt;a href="https://mezbreeze.itch.io/perpetual-nomads"&gt;itch.io&lt;/a&gt;.&lt;/p&gt;
     &lt;h2 id="do-not-share-what-you-do-not-want-to-be-known"&gt;Do not share, what you do not want to be known&lt;/h2&gt;
     &lt;h2 id="the-three-gates-of-speech"&gt;The three gates of speech&lt;/h2&gt;
     &lt;p&gt;Before you speak, let your words pass through three gates.&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;At the first gate, ask yourself, is it true.&lt;/li&gt;
     &lt;li&gt;At the second gate ask, is it necessary.&lt;/li&gt;
     &lt;li&gt;At the third gate ask, is it kind.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="rogerian-rhetoric"&gt;Rogerian rhetoric&lt;/h2&gt;
     &lt;p&gt;You should attempt to re-express your target&amp;#8217;s position so clearly, vividly, and fairly that your target says, &amp;#8220;Thanks, I wish I&amp;#8217;d thought of putting it that way.&amp;#8221;&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;p&gt;You should list any points of agreement (especially if they are not matters of general or widespread agreement).&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;You should mention anything you have learned from your target.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;Only then are you permitted to say so much as a word of rebuttal or criticism.&lt;/p&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;Dennett&amp;#8217;s version of Rapoport&amp;#8217;s Rules&lt;/p&gt;
     &lt;h2 id="argument-ranking"&gt;Argument Ranking&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679; - High-level generators - Disagreements that remain when everyone understands exactly what&amp;#8217;s being argued, and agrees on what all the evidence says, but have vague and hard-to-define reasons for disagreeing.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675; - Operationalizing - Where both parties understand they&amp;#8217;re in a cooperative effort to fix exactly what they&amp;#8217;re arguing about.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675; - Survey of evidence - Not trying to devastate the other person with a mountain of facts and start looking at the studies and arguments on both sides and figuring out what kind of complex picture they paint.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675; - Disputing definitions - Argument hinges on the meaning of words, or whether something counts as a member of a category or not.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675; - Single Studies - Better than scattered facts, proving they at least looked into the issue formally.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675; - Demands for rigor - Attempts to demand that an opposing argument be held to such strict standards that nothing could possibly clear the bar.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675; - Single Facts- One fact, which admittedly does support their argument, but presented as if it solves the debate in and of itself.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675; - Gotchas - Short claims that purport to be devastating proof that one side can&amp;#8217;t possibly be right.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675; - Social shaming- A demand for listeners to place someone outside the boundary of whom deserve to be heard.&lt;/p&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;&amp;#8220;How to apologize: Quickly, specifically, sincerely.&amp;#8221;, by Kevin Kelly&lt;/p&gt;
     &lt;h2 id="arguments-category"&gt;Arguments category&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;Ad baculum : Argument relying on an appeal to fear or a threat.&lt;/li&gt;
     &lt;li&gt;Ad ignorantiam : Argument relying on people&amp;#8217;s ignorance.&lt;/li&gt;
     &lt;li&gt;Ad populum : Argument relying on sentimental weakness.&lt;/li&gt;
     &lt;li&gt;Ad verecundiam : Argument relying on the the words of an &amp;#8220;expert&amp;#8221;, or authority.&lt;/li&gt;
     &lt;li&gt;Ex silentio : Argument relying on ignorance.&lt;/li&gt;
     &lt;li&gt;Ex nihilo : An argument that bears no relation to the previous topic of discussion.&lt;/li&gt;
     &lt;li&gt;Non sequitur : An inference that does not follow from established premises or evidence.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="responses"&gt;Responses&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;Akrasia : State of acting against one&amp;#8217;s better judgment.&lt;/li&gt;
     &lt;li&gt;Connotation : Emotional association with a word.&lt;/li&gt;
     &lt;li&gt;Intransigence : Refusal to change one&amp;#8217;s views or to agree about something.&lt;/li&gt;
     &lt;li&gt;Inferential distance : Gap between the background knowledge and epistemology of a person trying to explain an idea, and the background knowledge and epistemology of the person trying to understand it.&lt;/li&gt;
     &lt;li&gt;Straw man : Creating a false or made up scenario and then attacking it. Painting your opponent with false colors only deflects the purpose of the argument.&lt;/li&gt;
     &lt;li&gt;Steel man : To steelman is to address the strongest possible variant or the most charitable interpretation of an idea, rather than the most available phrasings.&lt;/li&gt;
     &lt;li&gt;Red herring : A diversion from the active topic.&lt;/li&gt;
     &lt;li&gt;Rationalization : Starts from a conclusion, and then works backward to arrive at arguments apparently favouring that conclusion. Rationalization argues for a side already selected.&lt;/li&gt;
     &lt;li&gt;Dogpiling : A disagreement wherein one person says something wrong or offensive, and a large number of people comment in response to tell them how wrong they are, and continue to disparage the original commenter beyond any reasonable time limit.&lt;/li&gt;
     &lt;li&gt;Grandstanding : An action that is intended to make people notice and admire you, behaving in a way that makes people pay attention to you instead of thinking about more important matters.&lt;/li&gt;
     &lt;li&gt;Whataboutism : An attempt to discredit an opponent&amp;#8217;s position by charging them with hypocrisy without directly refuting or disproving their argument.&lt;/li&gt;
     &lt;li&gt;Dissensus : The deliberate avoidance of consensus.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="beliefs"&gt;Beliefs&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;Belief : The mental state in which an individual holds a proposition to be true.&lt;/li&gt;
     &lt;li&gt;Priors : The beliefs an agent holds regarding a fact, hypothesis or consequence, before being presented with evidence.&lt;/li&gt;
     &lt;li&gt;Alief : An independent source of emotional reaction which can coexist with a contradictory belief. Example The fear felt when a monster jumps out of the darkness in a scary movie is based on the alief that the monster is about to attack you, even though you believe that it cannot.&lt;/li&gt;
     &lt;li&gt;Proper belief : Requires observations, gets updated upon encountering new evidence, and provides practical benefit in anticipated experience.&lt;/li&gt;
     &lt;li&gt;Improper belief : Is a belief that isn&amp;#8217;t concerned with describing the territory. Note that the fact that a belief just happens to be true doesn&amp;#8217;t mean you&amp;#8217;re right to have it. If you buy a lottery ticket, certain that it&amp;#8217;s a winning ticket (for no reason), and it happens to be, believing that was still a mistake.&lt;/li&gt;
     &lt;li&gt;Belief in belief : Where it is difficult to believe a thing, it is often much easier to believe that you ought to believe it. Were you to really believe and not just believe in belief, the consequences of error would be much more severe. When someone makes up excuses in advance, it would seem to require that belief, and belief in belief, have become unsynchronized.&lt;/li&gt;
     &lt;li&gt;A Priori : Knowledge which we can be sure of without any empirical evidence(evidence from our senses). So, knowledge that you could realize if you were just a mind floating in a void unconnected to a body.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="leading"&gt;Leading&lt;/h2&gt;
     &lt;blockquote&gt;
     &lt;p&gt;&amp;#8220;A leader is best when people barely know they exists, when their work is done, their aim fulfilled, people will say: we did it ourselves.&amp;#8221;&lt;/p&gt;
     &lt;p&gt;&amp;#8212; &amp;#32769;&amp;#23376; (Lao Tse), &amp;#36947;&amp;#24503;&amp;#32147; (Dao De Jing)&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;h2 id="wikipedias-etiquette"&gt;Wikipedia&amp;#8217;s etiquette&lt;/h2&gt;
     &lt;p&gt;The first principle of Wikipedia etiquette has been said to be Assume Good Faith, also they Be Bold, but not Reckless.&lt;/p&gt;
     &lt;h2 id="wrong-discourse"&gt;Wrong discourse&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;Answer: Jumping into a conversation with endless unapplicable, unrealistic or unrelated answers to the question.&lt;/li&gt;
     &lt;li&gt;Question: Spouting accusations while cowardly hiding behind the claim of just asking questions, and ignoring the answers. Asking loaded questions.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="good-discourse"&gt;Good discourse&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;Answer: A clear and honest response to the central point of a question without an aggressive attempt to convince.&lt;/li&gt;
     &lt;li&gt;Question: question asked with the intention to be fair, open, and honest, regardless of the outcome of the interaction.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;Social rules are expected to be broken from time to time, in that regard they are different from a code of conduct.&lt;/p&gt;
     &lt;h2 id="response-ranking"&gt;Response Ranking&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679; - Central point - Commit to refute explicitly the central point.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675; - Refutation - Argue a conflicting passage, explain why it&amp;#8217;s mistaken.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675; - Counterargument - Contradict with added reasoning or evidence.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675; - Contradiction - State the opposing case, what.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675; - Responding to Tone - Responding to the author&amp;#8217;s tone, how.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675; - Ad Hominem - Attacking the author directly, who.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="interaction-ranking"&gt;Interaction Ranking&lt;/h2&gt;
     &lt;h3 id="discussion"&gt;Discussion&lt;/h3&gt;
     &lt;ul&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679; - Release - Initiating a discussion on the lessons learnt from a project.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675; - Update - Presenting the recent development of a personal experience, ongoing event or work in progress.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675; - Soapbox - Spontaneous and or enthusiastic posts about a general topic of interest or finding.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h3 id="low-effort"&gt;Low-Effort&lt;/h3&gt;
     &lt;ul&gt;
     &lt;li&gt;&amp;#9679;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675; - Rant- Venting frustration publicly without explicitly looking to have a conversation about the matter.&lt;/li&gt;
     &lt;li&gt;&amp;#9679;&amp;#9675;&amp;#9675;&amp;#9675;&amp;#9675; - Shitpost - Aggressively or ironically looking for the biggest reaction with the least effort possible. Includes subtoots and vague-posting.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h3 id="emotional-reaction"&gt;Emotional Reaction&lt;/h3&gt;
     &lt;ul&gt;
     &lt;li&gt;Seduction - You are led to feel that the fulfillment of your dreams depends on your doing what the other is encouraging you to do.&lt;/li&gt;
     &lt;li&gt;Alignment - The interests of the system are presented as fulfilling your emotional needs. You are led to feel that your survival, your viability in society or your very identity depends on your doing what the other is requiring of you.&lt;/li&gt;
     &lt;li&gt;Reduction - Complex subjects are reduced to a single, emotionally charged issue.&lt;/li&gt;
     &lt;li&gt;Polarization - Issues are presented in such a way that you are either right or wrong. You are told that any dialogue between different perspectives is suspect, dangerous or simply not permissible.&lt;/li&gt;
     &lt;li&gt;Marginalization - You are made to feel that your own interests (or interests that run counter to the interests of the other) are inconsequential.&lt;/li&gt;
     &lt;li&gt;Framing - The terms of a debate are set so that issues that threaten the system cannot be articulated or discussed. You are led to ignore aspects of the issue that may be vitally important to your own interests but are contrary to the interests of the other that is seeking to make you act in their interests.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h3 id="quotes"&gt;Quotes&lt;/h3&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;p&gt;&amp;#8220;Kings speak for the realm, governors for the state, popes for the church. Indeed, the titled, as titled, cannot speak with annyone.&amp;#8221; &amp;#8212; James P. Carse, Finite and Infinite Games&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#8220;Instead of trying to prove your opponent wrong, try to see in what sense he might be right.&amp;#8221; &amp;#8212; Robert Nozick, Anarchy, State, and Utopia&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#8220;You should mention anything you have learned from your target.&amp;#8221;&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;&amp;#8220;I don&amp;#8217;t argue: I just say what I know or what I believe, as the case may be.&amp;#8221; &amp;#8212; John W. Cohan&lt;/p&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="copy"&gt;Copy&lt;/h2&gt;
     &lt;p&gt;The whole page is licensed under cc-by-nc-sa; it is adapted from https://wiki.xxiivv.com/site/discourse.html to make it easier for me to change it. I also avoid the words &amp;#8220;bad&amp;#8221; (replaced with &amp;#8220;wrong&amp;#8221;) and &amp;#8220;faith&amp;#8221; (replaced with &amp;#8220;discourse&amp;#8221;), a few other changes.&lt;/p&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/cheatsheet-on-discourse/</guid><pubDate>Sat, 16 Sep 2023 00:00:00 +0000</pubDate></item><item><title>dx - 1 - code crafting codex</title><link>https://hyper.dev/2023/09/code-crafting-codex/</link><description>Get lost in code development experience.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;A problem can have several solutions. A solution can have different implementations each of which with their own strengths and weakness in terms of space, time and generality.&lt;/p&gt;
     &lt;p&gt;The goal of a code experience design is to optimize the cognitive effort required to understand, learn and use. Otherwise said, code usability aim to improve ease.&lt;/p&gt;
     &lt;p&gt;While looking for ease, one might trade it over expressive power.&lt;/p&gt;
     &lt;p&gt;Crafting an experience requires to understand the cognitive load associated with the production. Cognitive load theory has been designed to provide guidelines intended to assist in the presentation of information in a manner that encourages learner activities that optimize intellectual performance.&lt;/p&gt;
     &lt;p&gt;Here is some of those guidelines:&lt;/p&gt;
     &lt;ol type="1"&gt;
     &lt;li&gt;People learn more effectively when they can build on what they already understand;&lt;/li&gt;
     &lt;li&gt;Take advantage of schemata;&lt;/li&gt;
     &lt;li&gt;Take advantage of visual thinking and other non-verbal thought;&lt;/li&gt;
     &lt;li&gt;The average person can retain &lt;del&gt;only seven&lt;/del&gt; five chunks &lt;del&gt;of information&lt;/del&gt; in short-term memory;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;p&gt;Repeat!&lt;/p&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/code-crafting-codex/</guid><pubDate>Sat, 16 Sep 2023 00:00:00 +0000</pubDate></item><item><title>okvs - 0 - natural query</title><link>https://hyper.dev/2023/09/okdb-natural-query/</link><description>Ordered Key-Value Store has a small user interface that give us a good good reason to have another look at processing, memory, permanence, and pointer swizzling.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;Ordered Key-Value Store has a small user interface that give us another good good reason to have a look at processing, memory, permanence, and pointer swizzling.&lt;/p&gt;
     &lt;p&gt;A useable database must offer the following actions:&lt;/p&gt;
     &lt;ol type="1"&gt;
     &lt;li&gt;&lt;code&gt;set&lt;/code&gt; will store a piece a data;&lt;/li&gt;
     &lt;li&gt;&lt;code&gt;query&lt;/code&gt; will fetch zero or more piece of data;&lt;/li&gt;
     &lt;li&gt;&lt;del&gt;&lt;code&gt;delete&lt;/code&gt; supposed to do what you think it will, but you will not use it, and even when you do, it will just acknowledge you made a wish;&lt;/del&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;p&gt;The primary question that comes to mind is: what is a piece of data?&lt;/p&gt;
     &lt;p&gt;In the OKVS paradigm, &amp;#8220;piece of data&amp;#8221; has two parts: the key, similar to what LISP call &lt;code&gt;car&lt;/code&gt;, and the value, similar to what LISP call &lt;code&gt;cdr&lt;/code&gt;. So &lt;code&gt;set&lt;/code&gt; may be described with &lt;code&gt;set(car, cdr)&lt;/code&gt;, in more parenthetical terms &lt;code&gt;(set object other)&lt;/code&gt;&lt;a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;. In an OKVS, key, and value, respectively &lt;code&gt;car&lt;/code&gt;, and &lt;code&gt;cdr&lt;/code&gt;, or &lt;code&gt;object&lt;/code&gt;, and &lt;code&gt;other&lt;/code&gt;, are sequences of ones and zeros&lt;a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;. The user interface of the OKVS paradigm use bit low level data representation.&lt;/p&gt;
     &lt;p&gt;Data that is binary sequences is a clue into why OKVS is fractal.&lt;/p&gt;
     &lt;p&gt;We know what is a piece of data: two bit sequences called &lt;code&gt;key&lt;/code&gt;, and &lt;code&gt;value&lt;/code&gt;. The database is a list of associations between a &lt;code&gt;key&lt;/code&gt;, and a &lt;code&gt;value&lt;/code&gt;. At any given point in time, given a bit sequence, it can only be associated once, and only once to another bit sequence.&lt;/p&gt;
     &lt;p&gt;Let&amp;#8217;s consider a procedure that would be called &lt;code&gt;get&lt;/code&gt;. One must divine that &lt;code&gt;get&lt;/code&gt; is a shortcut to &lt;code&gt;(get key)&lt;/code&gt; that returns, if any, the value that was associated with &lt;code&gt;key&lt;/code&gt; using &lt;code&gt;(set key value)&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;Comes &lt;code&gt;query&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;To be an interesting user interface action, &lt;code&gt;query&lt;/code&gt; must subsume &lt;code&gt;get&lt;/code&gt;&lt;a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"&gt;&lt;sup&gt;3&lt;/sup&gt;&lt;/a&gt;. The procedure &lt;code&gt;get&lt;/code&gt; will read, and return something, if any. The procedure &lt;code&gt;query&lt;/code&gt; will also read, and return nothing, return something , and opt-in to return strictly more than one thing. If there is at least two results, one should consider what comes first, what comes next, and if any what comes last..&lt;a href="https://hyper.dev/2023/09/okdb-natural-query/"&gt;.&lt;/a&gt; That is why there is an O in OKVS. We want to specify a sorting strategy. The procedure &lt;code&gt;query&lt;/code&gt; returns paired bit sequences in their natural order&lt;a href="#fn4" class="footnote-ref" id="fnref4" role="doc-noteref"&gt;&lt;sup&gt;4&lt;/sup&gt;&lt;/a&gt;. To cover all use cases, the sorted subspace returned by &lt;code&gt;query&lt;/code&gt; is described using two bit sequences called &lt;code&gt;start&lt;/code&gt;, and &lt;code&gt;end&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;That is why OKVS is fractal.&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="./usagif.com-sunflower-16.gif" title="fig:" alt="Sunflowers turning into a white circle over a dark background, and morph to sunflowers in what appears like a (wanna be (infinite)) loop."&gt;
     &lt;/center&gt;
     &lt;section class="footnotes" role="doc-endnotes"&gt;
     &lt;hr&gt;
     &lt;ol&gt;
     &lt;li id="fn1" role="doc-endnote"&gt;&lt;p&gt;I tried to avoid a name collision, and by the way the verbatim associate an unexpected sense to the action handle&amp;#8217;s surface&lt;a href="#fnref1" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;li id="fn2" role="doc-endnote"&gt;&lt;p&gt;According to astute lispers, it could represent everything, and beyond, of what you take for granted&lt;a href="#fnref2" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;li id="fn3" role="doc-endnote"&gt;&lt;p&gt;In product terms: &amp;#8220;describe a feature that is strict superset of what is enabled by &lt;code&gt;get&lt;/code&gt;&amp;#8221;, in algebraic terms it can be represented by a matrix with a bigger rank, see &lt;a href="https://en.wikipedia.org/wiki/Scheme_(mathematics)"&gt;Scheme&lt;/a&gt;. The matrix can describe another space of features, a space where there is more features&lt;a href="#fnref3" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;li id="fn4" role="doc-endnote"&gt;&lt;p&gt;A cyclical, cynical, but not clinical, or poisonous, definition of bit sequence&amp;#8217;s natural order&lt;a href="#fnref4" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;/section&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/okdb-natural-query/</guid><pubDate>Sat, 16 Sep 2023 00:00:00 +0000</pubDate></item><item><title>okvs - 1 - prologue</title><link>https://hyper.dev/2023/09/okdb-prologue/</link><description>A better database paradigm is the enemy of good, a perfect database is the enemy of better; on-the-fly mainstreaming commons legacy is future-proof operative.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;A better database paradigm is the enemy of good, a perfect database is the enemy of better; on-the-fly mainstreaming commons legacy is future-proof operative.&lt;/p&gt;
     &lt;p&gt;While there is no shortage of database systems, there used to be none that met my expectations. I can think of the following requirements:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;Can write, and read the following structures:
     &lt;ul&gt;
     &lt;li&gt;relational, graphical&lt;/li&gt;
     &lt;li&gt;recursive, hierarchical&lt;/li&gt;
     &lt;li&gt;time, spatial, geometric&lt;/li&gt;
     &lt;li&gt;textual&lt;/li&gt;
     &lt;/ul&gt;&lt;/li&gt;
     &lt;li&gt;Support efficient:
     &lt;ul&gt;
     &lt;li&gt;pagination&lt;/li&gt;
     &lt;li&gt;versioning&lt;/li&gt;
     &lt;li&gt;horizontal scaling&lt;/li&gt;
     &lt;li&gt;down scaling&lt;/li&gt;
     &lt;/ul&gt;&lt;/li&gt;
     &lt;li&gt;Support ACID transactions across objects&lt;/li&gt;
     &lt;li&gt;Programmable with Turing-complete programming language&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;We will argue that one or more of those requirements are unnecessary, and overkill. DWMT. NIH. YAGNI. DRY. We will argue that by relaxing a few of the requirements, a particular software or a set of vendors can bridge the chasm. We will argue endlessly, and we will be building hedera ivy, yet-another-database, wheel re-invention, pollution, the heresy of my diluted genius, that curse the software industry with fragmentation diversity, and fatigue jails. We will mention UNIX, respect, enterprise software architectures, open, free, available, sources, transparent, experiences, know-hows, failures, patterns, bugs, wars, fixes, success, huts, hugs, hubs, stories, productions, uses, re-uses, decades^W centuries^W milleniums of goods, but proof-of-work of maintreaming commons legacy.&lt;/p&gt;
     &lt;p&gt;Stand up, and still, I boost a grown up trend.&lt;/p&gt;
     &lt;p&gt;OKVS are used in Software as a Service (SaaS), privateer honeypots, source available software programmed with long now C++, Java, C#, JavaScript, Scala, Go, Zig, Rust, Python, Clojure, Common Lisp, and Scheme.&lt;/p&gt;
     &lt;p&gt;You have already used an Ordered Key-Value Store.&lt;/p&gt;
     &lt;p&gt;You know about the components that make an OKVS. If you are a software engineer, you will not learn algorithms, or new structures. You will re-discover how to use, and re-use readily available knowledge to better what you do in a way that is logical, that make sense in your target environment, product, and whatever your varia vocable.&lt;/p&gt;
     &lt;p&gt;Ordered Key Value Stores are useful, usable, and used.&lt;/p&gt;
     &lt;p&gt;Is it an expert tool? Is it an acceptable tool? Are problems of yesterday, today, and tomorrow fixed, or some require the precise craft of engineering art?&lt;/p&gt;
     &lt;p&gt;If the Revised&lt;sup&gt;-1&lt;/sup&gt; Report on Kernel is the language of programmable programming; then OKVS is the language of programmable storage.&lt;/p&gt;
     &lt;p&gt;Caveat emptor: you think in terms of specific, more or less precise, tailored, ad-hoc, prolly re-usable wording. You answer questions such as: what problem do I want to solve? Along the transderivational process, you log the most fitting, under, and over fitting representations; you plan, exercise read, and write workloads, record time, the flow of volatile, and permanent space usage, draft what happens sub-second, shorter than the span of human awareness, and the other side of the continuum: operations that have eventually a long while.&lt;/p&gt;
     &lt;p&gt;Look to tell a good story.&lt;/p&gt;
     &lt;p&gt;To ease the reader perfect skills, re-new old ideas, the essence of OKVS paradigm, the reference will also be illustrated with the help of LaTeX to limit, and hopefully eliminate dubious derivations. First, the goal is to cover as much substance as possible to give the freedom to think. Then with convos put the user interface to the test with well-known human interactions.&lt;/p&gt;
     &lt;p&gt;It helps to give yourself the opportunity to do it, in the most fitting order try to: think, exercise, solve, code, rest, sleep, and have fun.&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="./04155647a93f8fccaa76ba1e85e09fd5.gif" title="fig:" alt="Lost pea boat by INnovaTion at dribble.com"&gt;
     &lt;/center&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/okdb-prologue/</guid><pubDate>Sat, 16 Sep 2023 00:00:00 +0000</pubDate></item><item><title>task - 1 - transderivational beam search</title><link>https://hyper.dev/2023/09/transderivational-beam-search/</link><description>Given a finite set of objects &lt;code&gt;pool&lt;/code&gt;, and an object &lt;code&gt;query&lt;/code&gt;. Look within approximately &lt;code&gt;t&lt;/code&gt; time, at most &lt;code&gt;n&lt;/code&gt; objects subset of &lt;code&gt;pool&lt;/code&gt; that are near &lt;code&gt;query&lt;/code&gt; according to the metric &lt;code&gt;m&lt;/code&gt;, call that subset &lt;code&gt;candidates&lt;/code&gt;.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;blockquote&gt;
     &lt;p&gt;This work was sponsored by &lt;a href="https://haute-couture.enioka.com/manifeste"&gt;enioka&lt;/a&gt;.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;Given a finite set of objects &lt;code&gt;pool&lt;/code&gt;, and an object &lt;code&gt;query&lt;/code&gt;. Look, which ever comes first, within approximately &lt;code&gt;t&lt;/code&gt; time, or at most &lt;code&gt;n&lt;/code&gt; objects subset of &lt;code&gt;pool&lt;/code&gt; that are near &lt;code&gt;query&lt;/code&gt; according to the metric &lt;code&gt;m&lt;/code&gt;, call that subset &lt;code&gt;candidates&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;Extra: Add support for continuation. A continuation may produce objects that are more near &lt;code&gt;query&lt;/code&gt; than the previous continuation&amp;#8217;s candidates.&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;&lt;strong&gt;Transderivational search&lt;/strong&gt; is a psychological and cybernetics term, meaning when a search is being conducted for a fuzzy match across a broad field. In computing the equivalent function can be performed using content-addressable memory. Unlike usual searches, which look for literal (i.e.&amp;#160;exact, logical, or regular expression) matches, a transderivational search is a search for a possible meaning or possible match as part of communication, and without which an incoming communication cannot be made any sense of whatsoever. It is thus an integral part of processing language, and of attaching meaning to communication.&lt;/p&gt;
     &lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Transderivational_search"&gt;https://en.wikipedia.org/wiki/Transderivational_search&lt;/a&gt;&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;blockquote&gt;
     &lt;p&gt;In computer science, &lt;strong&gt;beam search&lt;/strong&gt; is a heuristic search algorithm that explores a graph by expanding the most promising node in a limited set. Beam search is an optimization of best-first search that reduces its memory requirements. Best-first search is a graph search which orders all partial solutions (states) according to some heuristic. But in beam search, only a predetermined number of best partial solutions are kept as candidates. It is thus a greedy algorithm.&lt;/p&gt;
     &lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Beam_search"&gt;https://en.wikipedia.org/wiki/Beam_search&lt;/a&gt;&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;Follow up the &lt;a href="/2023/exact-brute-force-rank/"&gt;exact brute force appraoch&lt;/a&gt;&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="/2023/09/transderivational-beam-search/image.QNKLB2.bottom.png" title="fig:" alt="Source: https://mezbreeze.itch.io/portraits-volume-one"&gt;
     &lt;/center&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/transderivational-beam-search/</guid><pubDate>Tue, 19 Sep 2023 00:00:00 +0000</pubDate></item><item><title>petit-cloud - 3 - be strong hold</title><link>https://hyper.dev/2023/09/petit-cloud-be-strong-hold/</link><description>petit-cloud application server release, be str43ng hold.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;petit-cloud is a Scheme application server written in Scheme that makes it easy to deploy web applications. petit-cloud is a single-human sized generation x&amp;#8217;s iteration on Earth&amp;#8217;s knowledge sharing system; once petit-cloud is ready, set, and serving, an operator can deploy any compatible application from the confort of a wooden chair with one hip command line hop. There is some guess work to do to add support for background task such as database schema changes&lt;a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;, or sh42ring among manifold operators.&lt;/p&gt;
     &lt;h2 id="usage"&gt;Usage&lt;/h2&gt;
     &lt;p&gt;Server side, you do:&lt;/p&gt;
     &lt;pre class="shell"&gt;&lt;code&gt;$ ./venv
     $ letloop exec . petit-cloud-server.scm -- 127.0.0.1 9999&lt;/code&gt;&lt;/pre&gt;
     &lt;p&gt;Client side, you do:&lt;/p&gt;
     &lt;pre class="shell"&gt;&lt;code&gt;$ curl http://localhost:9999
     hello world
     $ ./venv
     $ letloop exec . petit-cloud.scm -- http://localhost:9999/_/api/v0/ example.scm
     Please, input the secret: foobar
     Good! What is done, is not to be done!
     $ curl http://localhost:9999
     hello world 1 from example application
     $ curl http://localhost:9999
     hello world 2 from example application
     $&lt;/code&gt;&lt;/pre&gt;
     &lt;h2 id="download"&gt;Download&lt;/h2&gt;
     &lt;pre class="shell"&gt;&lt;code&gt;$ wget https://hyper.dev/2023/09/petit-cloud-be-strong-hold/letloop-petit-cloud-v3.tar.gz
     $ sha256sum letloop-petit-cloud-v3.tar.gz
     3c167a09930f812e32a7171e6de1d602654d0715a3d67eb6513554a19ab3913a  letloop-petit-cloud-v3.tar.gz&lt;/code&gt;&lt;/pre&gt;
     &lt;p&gt;Visit the repository in letloop organization &lt;a href="https://github.com/letloop/petit-cloud/"&gt;github.com/letloop/petit-cloud/&lt;/a&gt;.&lt;/p&gt;
     &lt;h2 id="discussion"&gt;Discussion&lt;/h2&gt;
     &lt;p&gt;What we were talking over the last months^W decades seems within reach when using a tool: Chez Scheme.&lt;/p&gt;
     &lt;p&gt;Let me invoke the spirit of freedom to say: the fully operational multitenant, lead people generation, multi-party observability, legal checklist, law enforcement, business-as-usual code quality are not only easy, and easier, they are within reach when there is will, food, housing, and psycological security.&lt;/p&gt;
     &lt;section class="footnotes" role="doc-endnotes"&gt;
     &lt;hr&gt;
     &lt;ol&gt;
     &lt;li id="fn1" role="doc-endnote"&gt;&lt;p&gt;when online migration are not supported&lt;a href="#fnref1" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;/section&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/petit-cloud-be-strong-hold/</guid><pubDate>Thu, 21 Sep 2023 00:00:00 +0000</pubDate></item><item><title>petit-cloud - 4 - f(r)u(c)ture</title><link>https://hyper.dev/2023/09/petit-cloud-future/</link><description>petit-cloud is a single-human sized generation x’s iteration on Earth’s knowledge sharing system; little did you know generation y is zooming into the future.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;So far, petit-cloud is a single-human sized clone of generation x&amp;#8217;s knowledge sharing system. Once petit-cloud 3 is ready, set, and serving, an operator can deploy any compatible application from the confort of a wooden chair with one hip command line hop. There is some guess work to do to add support for background task such as large database schema changes, or safe support for multiple operators&amp;#8230; hyper?&lt;/p&gt;
     &lt;p&gt;What if we move the operators from each their own chair to the couch?&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="family-couch.webp" title="fig:" alt="family on a couch pointing in the same direction"&gt;
     &lt;/center&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/petit-cloud-future/</guid><pubDate>Thu, 21 Sep 2023 00:00:00 +0000</pubDate></item><item><title>letloop - 7 - break, the loop</title><link>https://hyper.dev/2023/09/letloop-v7-break-loop/</link><description>letloop is a Chez Scheme distribution with many goodies packed in.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;letloop is a Chez Scheme distribution many goodies packed in.&lt;/p&gt;
     &lt;p&gt;Libraries are embedded in the binary release. It is not using the upstream machinery, it works. You will only need a copy of letloop binary to build a bulletin board about cracking schemers statistically significant cognition patterns with raspberries, and cosmits!&lt;/p&gt;
     &lt;p&gt;This release improve the software that test, and release letlooop. We are still looking to clone &lt;a href="https://nixos.org"&gt;nix&lt;/a&gt;, and &lt;a href="https://gnu.org/s/guix"&gt;guix&lt;/a&gt; to make letloop a hundred percent linux future-proof. Functional, and in particular functional package management is bootstrapping awesome ideas, tho, that, that is only a good bad rationalization. The good good rationale is that with a nix-like features, letloop will have:&lt;/p&gt;
     &lt;ol type="1"&gt;
     &lt;li&gt;&lt;p&gt;everything in a mono repository, hence waste less energy to be consistent, ordered, and logic;&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;more independant, and working on upstreaming, and downstreaming.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;more control, and easier control over its binary release e.g.&amp;#160;make it easier to test, build, then embed &lt;code&gt;.so&lt;/code&gt; shared libraries;&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;reproduciblity;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;p&gt;It is also the test bed of large system such as Earth wanna-be renewable supply chain of joy. &lt;a href="https://github.com/letloop/cli/issues/1836"&gt;If you have ideas, tips, love, and tricks about (just linux) chime in&lt;/a&gt;.&lt;/p&gt;
     &lt;p&gt;We are working on revised ordered key-value store (okvs), and beyond&lt;a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;. OKVS&lt;sup&gt;&lt;a href="https://okvs.dev"&gt;2&lt;/a&gt;&lt;/sup&gt; has an improved user interface, including more control over memory use, the sample implementation targets permanent storage, and bigger than volatile memory data, built on with entangle async framework. There is manyfold ways, you can help. They are a dozen of extensions (nstore, vnstore, gstore, bbkh, vstore, hnsw&amp;#8230;) that should be tested (and reworked :). There is a volatile memory sample implementation; &lt;a href="https://github.com/letloop/cli/issues/1850"&gt;Do not jump head first; introduce your self.&lt;/a&gt;&lt;/p&gt;
     &lt;p&gt;This release comes with the following libraries:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;entangle, a transparent asynchronous network library that &lt;a href="https://github.com/giltene/wrk2"&gt;wrk&lt;/a&gt; at 25k RPS; there is code for iouring, but performance are not good; we will investigate having epoll for network, and iouring for disk access.&lt;/li&gt;
     &lt;li&gt;SRFI 241, &lt;a href="https://srfi.schemers.org/srfi-241/"&gt;match with catamorphism&lt;/a&gt;, that makes it very simple to traverse and transform abstract syntax trees;&lt;/li&gt;
     &lt;li&gt;SRFI 224, &lt;a href="https://srfi.schemers.org/srfi-224/"&gt;integer mappings&lt;/a&gt;;&lt;/li&gt;
     &lt;li&gt;gamma, a predicate generics library;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;And more standard tooling:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;html;&lt;/li&gt;
     &lt;li&gt;json;&lt;/li&gt;
     &lt;li&gt;sxpath;&lt;/li&gt;
     &lt;li&gt;http;&lt;/li&gt;
     &lt;li&gt;basic http curl cli bindings;&lt;/li&gt;
     &lt;li&gt;and some cffi helpers;&lt;/li&gt;
     &lt;/ul&gt;
     
     &lt;blockquote&gt;
     &lt;a href="https://github.com/letloop/cli/releases/tag/v7"&gt;Download letloop v7 - break, the loop&lt;/a&gt;
     
     &lt;/blockquote&gt;
     &lt;p&gt;letloop is a Chez Scheme distribution with many goodies: the test runner with code coverage makes sure you touch the ground running. letloop can also produce elf binaries for your deployment convenience. The algorithm to reduce entropy is missing. Be assured that we are doing everything we can to fix, and improve the current state of the art^W loop.&lt;/p&gt;
     &lt;p&gt;We will be there. In the meantime, happy release day!&lt;/p&gt;
     &lt;p&gt;letloop is offered in the hope of being useable, useful, and used. If you think it fails at one of those, reach me at &lt;a href="mailto:amirouche+letloop@hyper.dev"&gt;amirouche@hyper.dev&lt;/a&gt;.&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="banana-breakfast-recipes-1922904326.jpeg" title="fig:" alt="nuts, and fruits for breakfast"&gt;
     &lt;/center&gt;
     &lt;section class="footnotes" role="doc-endnotes"&gt;
     &lt;hr&gt;
     &lt;ol&gt;
     &lt;li id="fn1" role="doc-endnote"&gt;&lt;p&gt;What about: Futamura projection + OKVS&lt;sup&gt;2&lt;/sup&gt; = OKVS&lt;sup&gt;3&lt;/sup&gt;&lt;a href="#fnref1" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;/section&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/09/letloop-v7-break-loop/</guid><pubDate>Sat, 30 Sep 2023 00:00:00 +0000</pubDate></item><item><title>okvs - 2 - revised okvs interface, alpha release</title><link>https://hyper.dev/2023/revised-okvs-alpha/</link><description>Rework of SRFI-167.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;h1 id="import-okvs"&gt;(import (okvs))&lt;/h1&gt;
     &lt;p&gt;Rework of SRFI-167.&lt;/p&gt;
     &lt;h2 id="change-log"&gt;Change log&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;2023-10-06: initial publication on hyper.dev;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="issues"&gt;Issues&lt;/h2&gt;
     &lt;ul&gt;
     &lt;li&gt;Missing implementation that rely permanent memory and support bigger-than-memory.&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h2 id="abstract"&gt;Abstract&lt;/h2&gt;
     &lt;p&gt;Ordered Key-Value Store (OKVS) is a type of data storage paradigm that can support multi-model database. An OKVS is an ordered mapping of bytes to bytes. It is a more powerful paradigm than a key-value store because OKVS allow to build higher level abstractions without the need to do scans. An OKVS will keep the key-value pairs sorted by the key lexicographic order. OKVS systems provides different set of features and performance trade-offs. Most of them are shipped as a library without network interfaces, in order to be embedded in another process. Most OKVS support ACID guarantees. Some OKVS are distributed databases. Ordered Key-Value Store found their way into many modern database systems including NewSQL database systems.&lt;/p&gt;
     &lt;p&gt;The generics from &lt;code&gt;(okvs)&lt;/code&gt; extends the legacy Ordered Key-Value Store interface inherited from Ken Thomson&amp;#8217;s DBM, then sleepy cats&amp;#8217; BerkeleyDB, and nowadays FoundationDB, and &lt;a href="https://tikv.org"&gt;TiKV&lt;/a&gt; to make the implementation of efficient extensions easier thanks to the ability to estimate within a range the count of keys, and the count of bytes.&lt;/p&gt;
     &lt;h2 id="rationale"&gt;Rationale&lt;/h2&gt;
     &lt;p&gt;There is several existing databases that expose an interface similar to &lt;code&gt;okvs&lt;/code&gt;, and even more that use an Ordered Key-Value Store (OKVS) as their backing storage.&lt;/p&gt;
     &lt;p&gt;While &lt;code&gt;okvs&lt;/code&gt; interface is lower-level than the mainstream SQL, it also has the advantage of having less moving pieces, and stems from a well-known datastructure, part of every software engineering curriculum, namely binary trees, it makes &lt;code&gt;okvs&lt;/code&gt; a good teaching material that has immediate useful applications, including building your own SQL database. Last but not least, &lt;code&gt;okvs&lt;/code&gt; pin the current practice of building databases on top of a similar tool.&lt;/p&gt;
     &lt;p&gt;&lt;code&gt;okvs&lt;/code&gt; is used to build many datastructures, called &lt;em&gt;extensions&lt;/em&gt;.&lt;/p&gt;
     &lt;p&gt;Extensions of &lt;code&gt;okvs&lt;/code&gt; are counter, bag, set, and multi-mapping. Higher level extensions include &lt;a href="https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model"&gt;Entity-Attribute-Value&lt;/a&gt; possibly supported by datalog, Generic Tuple Store (nstore) inspired from &lt;a href="https://en.wikipedia.org/wiki/Resource_Description_Framework"&gt;Resource Description Framework&lt;/a&gt; that can match the query capabilities of &lt;a href="https://www.w3.org/TR/rdf-sparql-query/"&gt;SPARQL&lt;/a&gt;, and &lt;a href="https://w3c.github.io/rdf-star/cg-spec/"&gt;RDF-star&lt;/a&gt;, or the Versioned Generic Tuple Store (vnstore), that ease the implementation of bitemporal databases. Also, it is possible to implement a property graph database, ranked set, leaderboard, priority queue. It is possible to implement efficient geometric queries with the help of xz-ordered curves. Vector database indices such as Hierarchical Navigable Small World are also available.&lt;/p&gt;
     &lt;h2 id="reference"&gt;Reference&lt;/h2&gt;
     &lt;h3 id="minimal"&gt;Minimal&lt;/h3&gt;
     &lt;h4 id="make-okvs"&gt;&lt;code&gt;(make-okvs)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Return a handle over an ordered key-value store.&lt;/p&gt;
     &lt;h4 id="okvs-object"&gt;&lt;code&gt;(okvs? object)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns &lt;code&gt;#true&lt;/code&gt; if &lt;code&gt;object&lt;/code&gt; is an ordered key-value store object returned by &lt;code&gt;make-okvs&lt;/code&gt;. Otherwise, returns &lt;code&gt;#false&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-error-okvs-object"&gt;&lt;code&gt;(okvs-error? okvs object)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns &lt;code&gt;#true&lt;/code&gt; if &lt;code&gt;object&lt;/code&gt; is an error produced by &lt;code&gt;okvs&lt;/code&gt;. Otherwise, returns &lt;code&gt;#false&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-transaction-okvs-object"&gt;&lt;code&gt;(okvs-transaction? okvs object)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns &lt;code&gt;#true&lt;/code&gt; if &lt;code&gt;object&lt;/code&gt; is a transaction object produced by &lt;code&gt;call-with-okvs-transaction&lt;/code&gt; or &lt;code&gt;call-with-okvs-transaction-read-only&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-handle-okvs-object"&gt;&lt;code&gt;(okvs-handle? okvs object)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns &lt;code&gt;#true&lt;/code&gt; if &lt;code&gt;object&lt;/code&gt; satisfy one of the following predicate:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;code&gt;okvs-transaction?&lt;/code&gt;&lt;/li&gt;
     &lt;li&gt;&lt;code&gt;okvs-cursor?&lt;/code&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;h4 id="call-with-okvs-transaction-okvs-proc-success-failure"&gt;&lt;code&gt;(call-with-okvs-transaction okvs proc success failure)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Describe the extent of the transaction within &lt;code&gt;PROC&lt;/code&gt; in case of success &lt;code&gt;success&lt;/code&gt; is called with returned values, when an object is raised &lt;code&gt;failure&lt;/code&gt; is invoked with the raised objects. Otherwise, If a continuation escape &lt;code&gt;PROC&lt;/code&gt; the behavior is unspecified.&lt;/p&gt;
     &lt;h4 id="okvs-query-handle-key-other-offset-limit"&gt;&lt;code&gt;(okvs-query handle key [other [offset [limit]]])&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;If only &lt;code&gt;handle&lt;/code&gt;, and &lt;code&gt;key&lt;/code&gt; are provided, returns the value associated with &lt;code&gt;key&lt;/code&gt;, or &lt;code&gt;#false&lt;/code&gt; if &lt;code&gt;key&lt;/code&gt; is not paired with an object.&lt;/p&gt;
     &lt;p&gt;If &lt;code&gt;other&lt;/code&gt; is provided, returns a generator producing all pairs present in the okvs associated with &lt;code&gt;handle&lt;/code&gt; between &lt;code&gt;key&lt;/code&gt;, and &lt;code&gt;other&lt;/code&gt; in lexicographic order. If &lt;code&gt;key&lt;/code&gt; is smaller than &lt;code&gt;other&lt;/code&gt;, the generator produce keys in ascending order, if &lt;code&gt;key&lt;/code&gt; is bigger than &lt;code&gt;other&lt;/code&gt; produce keys in descending order.&lt;/p&gt;
     &lt;h4 id="okvs-set-handle-key-value"&gt;&lt;code&gt;(okvs-set! handle key value)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Set, or update the object associated with &lt;code&gt;key&lt;/code&gt; to &lt;code&gt;value&lt;/code&gt; inside the okvs associated with &lt;code&gt;handle&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;The modification is only visible to other transactions when the current transaction returns successfully.&lt;/p&gt;
     &lt;h4 id="okvs-clear-handle-key-other"&gt;&lt;code&gt;(okvs-clear! handle key [other])&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Clear the pairing, if any, that &lt;code&gt;key&lt;/code&gt; has with an object inside the okvs associated with &lt;code&gt;handle&lt;/code&gt;.&lt;/p&gt;
     &lt;p&gt;The modification is only visible to other transactions when the current transaction returns successfully.&lt;/p&gt;
     &lt;h4 id="okvs-close-okvs"&gt;&lt;code&gt;(okvs-close okvs)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Close the database &lt;code&gt;okvs&lt;/code&gt;.&lt;/p&gt;
     &lt;h3 id="base"&gt;Base&lt;/h3&gt;
     &lt;h4 id="okvs-empty-handle"&gt;&lt;code&gt;(okvs-empty? handle)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns &lt;code&gt;#true&lt;/code&gt; if the database associated with a &lt;code&gt;handle&lt;/code&gt; that is empty. Otherwise, returns &lt;code&gt;#false&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="call-with-okvs-transaction-read-only-okvs-proc-success-failure"&gt;&lt;code&gt;(call-with-okvs-transaction-read-only okvs proc success failure)&lt;/code&gt;&lt;/h4&gt;
     &lt;h4 id="okvs-key-max-size-handle"&gt;&lt;code&gt;(okvs-key-max-size handle)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the maximum size of a key for the database associated with &lt;code&gt;HANDLE&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-value-max-size-handle"&gt;&lt;code&gt;(okvs-value-max-size handle)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the maximum size of a value of the database associated with &lt;code&gt;HANDLE&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-cursor-okvs-object"&gt;&lt;code&gt;(okvs-cursor? okvs object)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns &lt;code&gt;#true&lt;/code&gt; if &lt;code&gt;object&lt;/code&gt; is a cursor object produced by &lt;code&gt;call-with-okvs-cursor&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="make-okvs-parameter-default"&gt;&lt;code&gt;(make-okvs-parameter default)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns a procedure that is a parameter bound during the extent of transactions. transaction parameters follow the protocol:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;p&gt;When a transaction parameter is called with one argument that satisfies &lt;code&gt;okvs-transaction?&lt;/code&gt;, it returns the current value associated within the ongoing transaction, that is &lt;code&gt;default&lt;/code&gt; at the beginning of the transaction, and until the transaction parameter is reset.&lt;/p&gt;&lt;/li&gt;
     &lt;li&gt;&lt;p&gt;When a transaction parameter is called with two arguments, the first must satisfy the predicate &lt;code&gt;okvs-transaction?&lt;/code&gt;, the second argument can be anything; that will reset the object associated with the transaction parameter within the ongoing transaction. An immediate call with the same transaction object as only argument.&lt;/p&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;Calling a transaction parameter outside a transaction is an error.&lt;/p&gt;
     &lt;h4 id="okvs-parameterize-okvs-parameter-object-...-body-..."&gt;&lt;code&gt;(okvs-parameterize ((okvs-parameter object) ...) body ...)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Binds &lt;code&gt;okvs-parameter ...&lt;/code&gt; to &lt;code&gt;object ...&lt;/code&gt; while evaluating &lt;code&gt;body ...&lt;/code&gt;&lt;/p&gt;
     &lt;h4 id="okvs-begin-hook-okvs"&gt;&lt;code&gt;(okvs-begin-hook okvs)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the SRFI-172 hooks associated with &lt;code&gt;okvs&lt;/code&gt;. The begin hook&amp;#8217;s procedures are called, when a transaction is started, at the beginning of the transaction, inside the transaction.&lt;/p&gt;
     &lt;h4 id="okvs-pre-commit-hook-okvs"&gt;&lt;code&gt;(okvs-pre-commit-hook okvs)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the SRFI-172 hooks associated with &lt;code&gt;okvs&lt;/code&gt;. The pre-commit hook&amp;#8217;s procedures are called, at the end of a transaction, before &lt;code&gt;call-with-okvs-transaction&lt;/code&gt; or &lt;code&gt;call-with-okvs-transaction-read-only&lt;/code&gt; returns, inside the transaction.&lt;/p&gt;
     &lt;h4 id="okvs-post-commit-hook-okvs"&gt;&lt;code&gt;(okvs-post-commit-hook okvs)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the SRFI-172 hooks associated with &lt;code&gt;okvs&lt;/code&gt;. The post-commit hook&amp;#8217;s procedures are called, at the end of a transaction, before &lt;code&gt;call-with-okvs-transaction&lt;/code&gt; or &lt;code&gt;call-with-okvs-transaction-read-only&lt;/code&gt; returns, outside the transaction, after the transaction has succeed to commit.&lt;/p&gt;
     &lt;h4 id="okvs-rollback-hook-okvs"&gt;&lt;code&gt;(okvs-rollback-hook okvs)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the SRFI-172 hooks associated with &lt;code&gt;okvs&lt;/code&gt;. The rollback hook&amp;#8217;s procedures are called, at the end of a transaction, before &lt;code&gt;call-with-okvs-transaction&lt;/code&gt; or &lt;code&gt;call-with-okvs-transaction-read-only&lt;/code&gt; exit, outside the transaction, after the transaction has failed to commit.&lt;/p&gt;
     &lt;h4 id="okvs-approximate-key-count-handle-key-other"&gt;&lt;code&gt;(okvs-approximate-key-count handle [key other])&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns an approximate count of keys inside the okvs associated with &lt;code&gt;handle&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-approximate-byte-count-handle-key-other"&gt;&lt;code&gt;(okvs-approximate-byte-count handle [key other])&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns an approximate count of bytes inside the okvs associated with &lt;code&gt;handle&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="call-with-okvs-cursor-handle-key-proc"&gt;&lt;code&gt;(call-with-okvs-cursor handle key proc)&lt;/code&gt;&lt;/h4&gt;
     &lt;h4 id="okvs-next-cursor"&gt;&lt;code&gt;(okvs-next cursor)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Try to move &lt;code&gt;cursor&lt;/code&gt; to the next pairing. If there is a lexicographically a bigger key in the okvs, returns &lt;code&gt;#true&lt;/code&gt;. Otherwise, returns &lt;code&gt;#false&lt;/code&gt;. It means the cursor is at the end of the key space, and &lt;code&gt;okvs-key&lt;/code&gt; or &lt;code&gt;okvs-value&lt;/code&gt; will return &lt;code&gt;#false&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-previous-cursor"&gt;&lt;code&gt;(okvs-previous cursor)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Try to move &lt;code&gt;cursor&lt;/code&gt; to the previous pairing. If there is a lexicographically a smaller key in the okvs, returns &lt;code&gt;#true&lt;/code&gt;. Otherwise, returns &lt;code&gt;#false&lt;/code&gt;. It means the cursor is at the beginning of the key space, and &lt;code&gt;okvs-key&lt;/code&gt; or &lt;code&gt;okvs-value&lt;/code&gt; will return &lt;code&gt;#false&lt;/code&gt;.&lt;/p&gt;
     &lt;h4 id="okvs-key-cursor"&gt;&lt;code&gt;(okvs-key cursor)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the key associated with &lt;code&gt;cursor&lt;/code&gt;. Returns &lt;code&gt;#false&lt;/code&gt; when &lt;code&gt;cursor&lt;/code&gt; is at the beginning, or the end of the key space, or when the cursor is not set.&lt;/p&gt;
     &lt;h4 id="okvs-value-cursor"&gt;&lt;code&gt;(okvs-value cursor)&lt;/code&gt;&lt;/h4&gt;
     &lt;p&gt;Returns the value associated with &lt;code&gt;cursor&lt;/code&gt;. Returns &lt;code&gt;#false&lt;/code&gt; when &lt;code&gt;cursor&lt;/code&gt; is at the beginning, or the end of the key space, or when the cursor is not set.&lt;/p&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/revised-okvs-alpha/</guid><pubDate>Fri, 06 Oct 2023 00:00:00 +0000</pubDate></item><item><title>seed - 0 - freedom of expression, and the spirit of John Shutt’s Kernel</title><link>https://hyper.dev/2023/seed-0-freedom-of-expression-john-shutt-kernel/</link><description>If you find Scheme boring, without creativity, and dare challenge without fear the gentle, hot and firm burn of minimalism^W barely understood devices… Even if those are readily made source available by your favorite brute force army. There is a parenthetical take as known as Kernel, and Futamura. Read on.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;Picture from &lt;a href="https://www.instagram.com/p/CjwJMeWhi-N/"&gt;instagram via midjourney&lt;/a&gt;.&lt;/p&gt;
     &lt;p&gt;If you find Scheme boring, without creativity, and dare challenge without fear the gentle, hot and firm burn of minimalism^W barely understood devices such as procedural pattern matching, &lt;code&gt;gamma&lt;/code&gt;, &lt;code&gt;vau&lt;/code&gt;, and statistics gathered on-the-fly to configure lowering at runtime that may be wholly, and fully localized, user defined, packaged, and re-used&lt;a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;.&lt;/p&gt;
     &lt;p&gt;Even if those are readily source available by your favorite brute force army. There is a parenthetical take: Kernel, and Futamura. Read on.&lt;/p&gt;
     &lt;p&gt;Kernel is the other programming interface that I can not take my mind away from. I tried. I failed. I failed many times. I failed Babelia because Kernel. I worked hard. I failed. I still dare recalling my failure. And nowadays, I do not shy away anymore. I dare claim it is not only elegant, it is beautiful. It takes more head space than any other language, standard, or (parenthetical leaning) implementation. It seems to me there is enough material for one to beam gamma rays to alphas for inspiration for decades, maybe centuries!&lt;/p&gt;
     &lt;p&gt;The primo, and ultimo goal: control a little more than Sun core.&lt;/p&gt;
     &lt;h2 id="big-equation"&gt;Big Equation&lt;/h2&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Previously I called the following &lt;a href="https://web.cs.wpi.edu/~jshutt/"&gt;John Shutt&lt;/a&gt;&amp;#8217;s equation of software. To keep any error my own, and because it goes against the grain, I intend to not mention him outside reference, and thanks. May his arguments always be properly evaluated.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;The purpose of that equation is to describe enough of a system, and deliver enough material to support &lt;a href="https://hyper.dev/2023/seed-0-public-display-attention-john-shutt-kernel/"&gt;engineered discourse&lt;/a&gt;. Here are the three branches of seed&amp;#8217;s &lt;code&gt;eval&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; &lt;/span&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; xp env ctx)&lt;/span&gt;
     &lt;span id="cb1-2"&gt;&lt;a href="#cb1-2" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;cond&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-3"&gt;&lt;a href="#cb1-3" aria-hidden="true"&gt;&lt;/a&gt;   &lt;span class="co"&gt;;; If the expression `XP` is a symbol, return the object that is&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-4"&gt;&lt;a href="#cb1-4" aria-hidden="true"&gt;&lt;/a&gt;   &lt;span class="co"&gt;;; associated with it in the environement `ENV`...&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-5"&gt;&lt;a href="#cb1-5" aria-hidden="true"&gt;&lt;/a&gt;   ((&lt;span class="kw"&gt;symbol?&lt;/span&gt; xp) (environment-ref env xp))&lt;/span&gt;
     &lt;span id="cb1-6"&gt;&lt;a href="#cb1-6" aria-hidden="true"&gt;&lt;/a&gt;   &lt;span class="co"&gt;;; If `XP` is a construction, try to apply it&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true"&gt;&lt;/a&gt;   ((&lt;span class="kw"&gt;pair?&lt;/span&gt; xp)&lt;/span&gt;
     &lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; combiner &lt;/span&gt;(&lt;span class="kw"&gt;let&lt;/span&gt; ((prefix (&lt;span class="kw"&gt;car&lt;/span&gt; xp)))&lt;/span&gt;
     &lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true"&gt;&lt;/a&gt;                       (&lt;span class="kw"&gt;if&lt;/span&gt; (combiner? prefix)&lt;/span&gt;
     &lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true"&gt;&lt;/a&gt;                           prefix&lt;/span&gt;
     &lt;span id="cb1-11"&gt;&lt;a href="#cb1-11" aria-hidden="true"&gt;&lt;/a&gt;                           (environment-ref env prefix))))&lt;/span&gt;
     &lt;span id="cb1-12"&gt;&lt;a href="#cb1-12" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;cond&lt;/span&gt; &lt;span class="co"&gt;;; Most likely combiner class, what is returned by lambda&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-13"&gt;&lt;a href="#cb1-13" aria-hidden="true"&gt;&lt;/a&gt;     ((applicative? combiner)&lt;/span&gt;
     &lt;span id="cb1-14"&gt;&lt;a href="#cb1-14" aria-hidden="true"&gt;&lt;/a&gt;      &lt;span class="co"&gt;;; Evaluate arguments `(cdr XP)`, hopfully mere environement-ref.&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-15"&gt;&lt;a href="#cb1-15" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;let&lt;/span&gt; ((xp+ (map (&lt;span class="kw"&gt;lambda&lt;/span&gt; (x) (&lt;span class="kw"&gt;eval&lt;/span&gt; x env ctx)) (&lt;span class="kw"&gt;cdr&lt;/span&gt; xp))))&lt;/span&gt;
     &lt;span id="cb1-16"&gt;&lt;a href="#cb1-16" aria-hidden="true"&gt;&lt;/a&gt;        (apply combiner env ctx xp+)))&lt;/span&gt;
     &lt;span id="cb1-17"&gt;&lt;a href="#cb1-17" aria-hidden="true"&gt;&lt;/a&gt;     ((operative? combiner)&lt;/span&gt;
     &lt;span id="cb1-18"&gt;&lt;a href="#cb1-18" aria-hidden="true"&gt;&lt;/a&gt;      &lt;span class="co"&gt;;; The arguments `(cdr XP)` are passed as is, most likely, but&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-19"&gt;&lt;a href="#cb1-19" aria-hidden="true"&gt;&lt;/a&gt;      &lt;span class="co"&gt;;; not only: symbols, numbers, booleans, and constructions...&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-20"&gt;&lt;a href="#cb1-20" aria-hidden="true"&gt;&lt;/a&gt;      (apply combiner env ctx (&lt;span class="kw"&gt;cdr&lt;/span&gt; xp))))&lt;/span&gt;
     &lt;span id="cb1-21"&gt;&lt;a href="#cb1-21" aria-hidden="true"&gt;&lt;/a&gt;    &lt;span class="co"&gt;;; ... not only self-evaluating!&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-22"&gt;&lt;a href="#cb1-22" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;else&lt;/span&gt; xp)))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;The variable &lt;code&gt;ctx&lt;/code&gt; hold the current flow of execution, to make it possible to migrate across hardware frontiers.&lt;/p&gt;
     &lt;h2 id="small-demo"&gt;Small Demo&lt;/h2&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Download the small demo at &lt;a href="https://hyper.dev/2023/seed-0-freedom-of-expression-john-shutt-kernel/seed-v1.scm"&gt;hyper.dev&lt;/a&gt;.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;h2 id="glimpsing-over"&gt;Glimpsing over&lt;/h2&gt;
     &lt;p&gt;Combiners returned by &lt;code&gt;vau&lt;/code&gt; make it possible, and easy to hook into compilation machinery, that is without more time spent on a wood bank.&lt;/p&gt;
     &lt;h3 id="when"&gt;&lt;code&gt;when&lt;/code&gt;&lt;/h3&gt;
     &lt;p&gt;Here is the &lt;code&gt;when&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb2"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb2-1"&gt;&lt;a href="#cb2-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; when&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb2-2"&gt;&lt;a href="#cb2-2" aria-hidden="true"&gt;&lt;/a&gt;  (vau (object . xps) env&lt;/span&gt;
     &lt;span id="cb2-3"&gt;&lt;a href="#cb2-3" aria-hidden="true"&gt;&lt;/a&gt;      (&lt;span class="kw"&gt;if&lt;/span&gt; (&lt;span class="kw"&gt;eval&lt;/span&gt; object env)&lt;/span&gt;
     &lt;span id="cb2-4"&gt;&lt;a href="#cb2-4" aria-hidden="true"&gt;&lt;/a&gt;          (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence xps) env)&lt;/span&gt;
     &lt;span id="cb2-5"&gt;&lt;a href="#cb2-5" aria-hidden="true"&gt;&lt;/a&gt;          (void))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Mind the fact that it works better if you do not know what a macro is, what compilation hooks are, and when you are not parenthetical phobic. Some familiarity with Scheme standard, R4RS, or R5RS helps.&lt;/p&gt;
     &lt;p&gt;It can be used like:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb3"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb3-1"&gt;&lt;a href="#cb3-1" aria-hidden="true"&gt;&lt;/a&gt;(when signal&lt;/span&gt;
     &lt;span id="cb3-2"&gt;&lt;a href="#cb3-2" aria-hidden="true"&gt;&lt;/a&gt;  (reply &lt;span class="dv"&gt;2006&lt;/span&gt;))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;At somepoint, the previous procedure definition of &lt;code&gt;when&lt;/code&gt; will be called. Using beta-reduction, and the fact that only &lt;code&gt;signal&lt;/code&gt;, and &lt;code&gt;replay&lt;/code&gt; are lexically scoped:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb4"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb4-1"&gt;&lt;a href="#cb4-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;if&lt;/span&gt; (&lt;span class="kw"&gt;eval&lt;/span&gt; 'signal env)&lt;/span&gt;
     &lt;span id="cb4-2"&gt;&lt;a href="#cb4-2" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply &lt;span class="dv"&gt;2006&lt;/span&gt;)) env)&lt;/span&gt;
     &lt;span id="cb4-3"&gt;&lt;a href="#cb4-3" aria-hidden="true"&gt;&lt;/a&gt;    (void)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Only &lt;code&gt;object&lt;/code&gt;, &lt;code&gt;xps&lt;/code&gt; were copy-pasted as a construction, and self-evaluating objects like symbols. In &lt;code&gt;env&lt;/code&gt;, the symbols &lt;code&gt;'signal&lt;/code&gt;, and &lt;code&gt;'reply&lt;/code&gt; are bound. When &lt;code&gt;(eval 'signal env)&lt;/code&gt; is processed, it returns for instance 101. That yields the following sequence:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb5"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb5-1"&gt;&lt;a href="#cb5-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="dv"&gt;101&lt;/span&gt; &lt;span class="co"&gt;;; that is not flasy&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb5-2"&gt;&lt;a href="#cb5-2" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply &lt;span class="dv"&gt;2006&lt;/span&gt;)) env)&lt;/span&gt;
     &lt;span id="cb5-3"&gt;&lt;a href="#cb5-3" aria-hidden="true"&gt;&lt;/a&gt;    (void)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Then:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb6"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb6-1"&gt;&lt;a href="#cb6-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply &lt;span class="dv"&gt;2006&lt;/span&gt;)) env)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;That is evaluated at call-site to the same object as the following expression:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb7"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb7-1"&gt;&lt;a href="#cb7-1" aria-hidden="true"&gt;&lt;/a&gt;(reply &lt;span class="dv"&gt;2006&lt;/span&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;h3 id="anaphoric-when"&gt;Anaphoric When&lt;/h3&gt;
     &lt;p&gt;Anaphoric &lt;code&gt;when&lt;/code&gt; will bind the condition, called &lt;code&gt;object&lt;/code&gt; in the above definition, to a variable inside the body. That is similar to walrus operator. An anaphoric &lt;code&gt;when&lt;/code&gt; can be implemented with:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb8"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb8-1"&gt;&lt;a href="#cb8-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; anaphoric-when&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb8-2"&gt;&lt;a href="#cb8-2" aria-hidden="true"&gt;&lt;/a&gt;  (vau (variable object . xps) env&lt;/span&gt;
     &lt;span id="cb8-3"&gt;&lt;a href="#cb8-3" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; tmp &lt;/span&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; object env))&lt;/span&gt;
     &lt;span id="cb8-4"&gt;&lt;a href="#cb8-4" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;if&lt;/span&gt; tmp&lt;/span&gt;
     &lt;span id="cb8-5"&gt;&lt;a href="#cb8-5" aria-hidden="true"&gt;&lt;/a&gt;        (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence xps)&lt;/span&gt;
     &lt;span id="cb8-6"&gt;&lt;a href="#cb8-6" aria-hidden="true"&gt;&lt;/a&gt;              (environment-cons env (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; variable tmp))))&lt;/span&gt;
     &lt;span id="cb8-7"&gt;&lt;a href="#cb8-7" aria-hidden="true"&gt;&lt;/a&gt;        (void))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;It is supposed to be used in cases where the test condition is cpu heavy:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb9"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb9-1"&gt;&lt;a href="#cb9-1" aria-hidden="true"&gt;&lt;/a&gt;(anaphoric-when signal (&lt;span class="op"&gt;+&lt;/span&gt; &lt;span class="dv"&gt;2006&lt;/span&gt; (&lt;span class="op"&gt;-&lt;/span&gt; &lt;span class="dv"&gt;1337&lt;/span&gt; &lt;span class="dv"&gt;42&lt;/span&gt;))&lt;/span&gt;
     &lt;span id="cb9-2"&gt;&lt;a href="#cb9-2" aria-hidden="true"&gt;&lt;/a&gt;        (reply signal))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;Similar to &lt;code&gt;when&lt;/code&gt;, the use of anaphoric when is mostly lexically scoped. The applicative &lt;code&gt;eval&lt;/code&gt; takes an environment as argument. The definition of &lt;code&gt;anaphoric-when&lt;/code&gt; needs the object associated with the symbol &lt;code&gt;object&lt;/code&gt; when &lt;code&gt;anaphoric-when&lt;/code&gt; is used, hence the first line &lt;code&gt;(define tmp (eval object env))&lt;/code&gt; where &lt;code&gt;ENV&lt;/code&gt; is the environment where &lt;code&gt;anaphoric-when&lt;/code&gt; is used.&lt;/p&gt;
     &lt;p&gt;The main difference between &lt;code&gt;when&lt;/code&gt; and &lt;code&gt;anaphoric-when&lt;/code&gt; is that anaphoric adds the condition object inside the environment where the body of &lt;code&gt;anaphoric-when&lt;/code&gt; is evaluated.&lt;/p&gt;
     &lt;p&gt;Again, describing a beta-reduction sequence:&lt;/p&gt;
     &lt;ol type="1"&gt;
     &lt;li&gt;
     &lt;/ol&gt;
     &lt;div class="sourceCode" id="cb10"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb10-1"&gt;&lt;a href="#cb10-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; tmp &lt;/span&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; (&lt;span class="kw"&gt;list&lt;/span&gt; '+ &lt;span class="dv"&gt;2006&lt;/span&gt; (&lt;span class="kw"&gt;list&lt;/span&gt; '- &lt;span class="dv"&gt;1337&lt;/span&gt; &lt;span class="dv"&gt;42&lt;/span&gt;)) env))&lt;/span&gt;
     &lt;span id="cb10-2"&gt;&lt;a href="#cb10-2" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;if&lt;/span&gt; tmp&lt;/span&gt;
     &lt;span id="cb10-3"&gt;&lt;a href="#cb10-3" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply 'signal))&lt;/span&gt;
     &lt;span id="cb10-4"&gt;&lt;a href="#cb10-4" aria-hidden="true"&gt;&lt;/a&gt;          (environment-cons env (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'signal tmp))))&lt;/span&gt;
     &lt;span id="cb10-5"&gt;&lt;a href="#cb10-5" aria-hidden="true"&gt;&lt;/a&gt;    (void))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;ol start="2" type="1"&gt;
     &lt;li&gt;
     &lt;/ol&gt;
     &lt;div class="sourceCode" id="cb11"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb11-1"&gt;&lt;a href="#cb11-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; tmp &lt;/span&gt;&lt;span class="dv"&gt;3301&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb11-2"&gt;&lt;a href="#cb11-2" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;if&lt;/span&gt; tmp&lt;/span&gt;
     &lt;span id="cb11-3"&gt;&lt;a href="#cb11-3" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply 'signal))&lt;/span&gt;
     &lt;span id="cb11-4"&gt;&lt;a href="#cb11-4" aria-hidden="true"&gt;&lt;/a&gt;          (environment-cons env (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'signal tmp))))&lt;/span&gt;
     &lt;span id="cb11-5"&gt;&lt;a href="#cb11-5" aria-hidden="true"&gt;&lt;/a&gt;    (void))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;ol start="3" type="1"&gt;
     &lt;li&gt;
     &lt;/ol&gt;
     &lt;div class="sourceCode" id="cb12"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb12-1"&gt;&lt;a href="#cb12-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;if&lt;/span&gt; &lt;span class="dv"&gt;3301&lt;/span&gt; &lt;span class="co"&gt;;; not falsy&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb12-2"&gt;&lt;a href="#cb12-2" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply 'signal))&lt;/span&gt;
     &lt;span id="cb12-3"&gt;&lt;a href="#cb12-3" aria-hidden="true"&gt;&lt;/a&gt;          (environment-cons env (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'signal &lt;span class="dv"&gt;3301&lt;/span&gt;))))&lt;/span&gt;
     &lt;span id="cb12-4"&gt;&lt;a href="#cb12-4" aria-hidden="true"&gt;&lt;/a&gt;    (void))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;ol start="4" type="1"&gt;
     &lt;li&gt;
     &lt;/ol&gt;
     &lt;div class="sourceCode" id="cb13"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb13-1"&gt;&lt;a href="#cb13-1" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;eval&lt;/span&gt; (list* sequence (&lt;span class="kw"&gt;list&lt;/span&gt; 'reply 'signal))&lt;/span&gt;
     &lt;span id="cb13-2"&gt;&lt;a href="#cb13-2" aria-hidden="true"&gt;&lt;/a&gt;      (environment-cons env (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;cons&lt;/span&gt; 'signal &lt;span class="dv"&gt;3301&lt;/span&gt;))))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;ol start="5" type="1"&gt;
     &lt;li&gt;The previous s-expression will be evaluated at call-site to the same object as:&lt;/li&gt;
     &lt;/ol&gt;
     &lt;div class="sourceCode" id="cb14"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb14-1"&gt;&lt;a href="#cb14-1" aria-hidden="true"&gt;&lt;/a&gt;(reply &lt;span class="dv"&gt;3301&lt;/span&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;p&gt;That is echo.&lt;/p&gt;
     &lt;h2 id="why"&gt;Why&lt;/h2&gt;
     &lt;p&gt;Unlike &lt;code&gt;define-macro&lt;/code&gt;, and even more so hygienic syntax transformers, the approach of f-expr using &lt;code&gt;vau&lt;/code&gt; makes it possible to re-use existing knowledge of how to program. It may be possible to re-implement the industrial macro machinery of modern implementations, but do we really want that?&lt;/p&gt;
     &lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
     &lt;p&gt;I will write a procedural match ie. a pattern matcher, then see where to go from there. I think publicly distributed, and localized code are more helpful, than any other projections.&lt;/p&gt;
     &lt;p&gt;By the way, while I am at looking forward, take a look at &lt;a href="https://github.com/panicz/grasp#readme"&gt;GRASP, The GRAphical Scheme Programming Environment&lt;/a&gt;, look at the &lt;a href="https://www.youtube.com/@paniczgodek"&gt;videos&lt;/a&gt;. I also recommend the answers by the same author on quora.&lt;/p&gt;
     &lt;p&gt;Regarding Futamura projection, it appears it is still interesting, and good material to build a new implementation of Scheme. After reading &lt;a href="https://www.itu.dk/people/sestoft/pebook/"&gt;pebook&lt;/a&gt;, it is certain that it is a lot of work.&lt;/p&gt;
     &lt;center&gt;
     &lt;img src="./yoga.gif" title="fig:" alt="A time for yoga."&gt;
     &lt;/center&gt;
     &lt;section class="footnotes" role="doc-endnotes"&gt;
     &lt;hr&gt;
     &lt;ol&gt;
     &lt;li id="fn1" role="doc-endnote"&gt;&lt;p&gt;may be known as up-coming long awaited next AAA release.&lt;a href="#fnref1" class="footnote-back" role="doc-backlink"&gt;&amp;#8617;&amp;#65038;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
     &lt;/ol&gt;
     &lt;/section&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/seed-0-freedom-of-expression-john-shutt-kernel/</guid><pubDate>Fri, 13 Oct 2023 00:00:00 +0000</pubDate></item><item><title>Racket’s Chez merged into Cisco’s Chez</title><link>https://hyper.dev/2023/racket-chez-merged-into-cisco-chez/</link><description>A very well come merge of Racket’s Chez into Cisco brings many interesting features.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;p&gt;A very well come merge of Racket&amp;#8217;s Chez into Cisco brings many interesting features. It already available with the following command line dance:&lt;/p&gt;
     &lt;pre class="shell"&gt;&lt;code&gt;git clone --filter=blob:none https://github.com/cisco/chezscheme
     cd chezscheme
     ./configure --installprefix=$HOME/.local/
     make -j $(nproc --ignore=1)
     make install&lt;/code&gt;&lt;/pre&gt;
     &lt;p&gt;I am very interested in the following new features:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;Hardware support includes AArch64 for Linux, Mac OS, and iOS, and RISC-V;&lt;/li&gt;
     &lt;li&gt;Unboxed floating points operations;&lt;/li&gt;
     &lt;li&gt;The new operator &lt;code&gt;thread-join&lt;/code&gt;;&lt;/li&gt;
     &lt;li&gt;Safe procedure &lt;code&gt;fasl-read&lt;/code&gt;;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;For full release notes look at:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;a href="https://users.cs.utah.edu/~mflatt/tmp/release_notes_v999.html"&gt;https://users.cs.utah.edu/~mflatt/tmp/release_notes_v999.html&lt;/a&gt;&lt;/li&gt;
     &lt;/ul&gt;
     &lt;p&gt;Or the up-to-date:&lt;/p&gt;
     &lt;ul&gt;
     &lt;li&gt;&lt;a href="https://github.com/cisco/ChezScheme/blob/main/release_notes/release_notes.stex"&gt;https://github.com/cisco/ChezScheme/blob/main/release_notes/release_notes.stex&lt;/a&gt;&lt;/li&gt;
     &lt;/ul&gt;
	&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/racket-chez-merged-into-cisco-chez/</guid><pubDate>Sat, 21 Oct 2023 00:00:00 +0000</pubDate></item><item><title>task - 1 - exact brute force rank</title><link>https://hyper.dev/2023/exact-brute-force-rank/</link><description>Given a finite set of objects &lt;code&gt;pool&lt;/code&gt;, and an object &lt;code&gt;query&lt;/code&gt;. Look within approximately &lt;code&gt;t&lt;/code&gt; time, at most &lt;code&gt;n&lt;/code&gt; objects subset of &lt;code&gt;pool&lt;/code&gt; that are near &lt;code&gt;query&lt;/code&gt; according to the metric &lt;code&gt;m&lt;/code&gt;, call that subset &lt;code&gt;candidates&lt;/code&gt;.</description><content:encoded>&lt;div id="root"&gt;
	    &lt;blockquote&gt;
     &lt;p&gt;This work was sponsored by &lt;a href="https://haute-couture.enioka.com/manifeste"&gt;enioka&lt;/a&gt;.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;The task one is:&lt;/p&gt;
     &lt;blockquote&gt;
     &lt;p&gt;Given a finite set of objects &lt;code&gt;pool&lt;/code&gt;, and an object &lt;code&gt;query&lt;/code&gt;. Look, which ever comes first, within approximately &lt;code&gt;t&lt;/code&gt; time, or at most &lt;code&gt;n&lt;/code&gt; objects subset of &lt;code&gt;pool&lt;/code&gt; that are near &lt;code&gt;query&lt;/code&gt; according to the metric &lt;code&gt;m&lt;/code&gt;, call that subset &lt;code&gt;candidates&lt;/code&gt;.&lt;/p&gt;
     &lt;/blockquote&gt;
     &lt;p&gt;Most popular approach nowadays, and the one I could start to get under control is to rely on &lt;a href="https://arxiv.org/abs/1603.09320"&gt;Hierarchical Navigable Small Worlds&lt;/a&gt;. HNSW is reminiscent of Ben Goertzel glocals from opencog fame.&lt;/p&gt;
     &lt;p&gt;HNSW datastructure use a deterministic heuristic with the distance function to construct clusters, still, it use random to spread pression on memory, and compute. It looks like a skip-list with multiple path ways. A regular natural sort will not speed queries, because of that glocals are not sorted, instead nodes are related to points in a higher level layer. The higher the level the less points they are. The highest level has only one point. Each point has a maximum &lt;code&gt;x&lt;/code&gt; neighbor in a lower level. Horizontal navigation must be done through the parent point.&lt;/p&gt;
     &lt;p&gt;While I put that whole on a flashcard, you can delice with the following brute force algorithm that will generate a pool of points nearest to a point &lt;code&gt;query&lt;/code&gt;:&lt;/p&gt;
     &lt;div class="sourceCode" id="cb1"&gt;&lt;pre class="sourceCode scheme"&gt;&lt;code class="sourceCode scheme"&gt;&lt;span id="cb1-1"&gt;&lt;a href="#cb1-1" aria-hidden="true"&gt;&lt;/a&gt;(import (chezscheme))&lt;/span&gt;
     &lt;span id="cb1-2"&gt;&lt;a href="#cb1-2" aria-hidden="true"&gt;&lt;/a&gt;(import (letloop r999))&lt;/span&gt;
     &lt;span id="cb1-3"&gt;&lt;a href="#cb1-3" aria-hidden="true"&gt;&lt;/a&gt;(import (scheme generator))&lt;/span&gt;
     &lt;span id="cb1-4"&gt;&lt;a href="#cb1-4" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-5"&gt;&lt;a href="#cb1-5" aria-hidden="true"&gt;&lt;/a&gt;&lt;span class="co"&gt;;; brute force algorithm&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-6"&gt;&lt;a href="#cb1-6" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-7"&gt;&lt;a href="#cb1-7" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; total &lt;/span&gt;(&lt;span class="kw"&gt;string-&amp;gt;number&lt;/span&gt; (&lt;span class="kw"&gt;or&lt;/span&gt; (getenv &lt;span class="st"&gt;"HYPER_TOTAL"&lt;/span&gt;) &lt;span class="st"&gt;"65536"&lt;/span&gt;)))&lt;/span&gt;
     &lt;span id="cb1-8"&gt;&lt;a href="#cb1-8" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; exponent &lt;/span&gt;(&lt;span class="kw"&gt;string-&amp;gt;number&lt;/span&gt; (&lt;span class="kw"&gt;or&lt;/span&gt; (getenv &lt;span class="st"&gt;"HYPER_EXPONENT"&lt;/span&gt;) &lt;span class="st"&gt;"8"&lt;/span&gt;)))&lt;/span&gt;
     &lt;span id="cb1-9"&gt;&lt;a href="#cb1-9" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-10"&gt;&lt;a href="#cb1-10" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; pk&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-11"&gt;&lt;a href="#cb1-11" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; args&lt;/span&gt;
     &lt;span id="cb1-12"&gt;&lt;a href="#cb1-12" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;write&lt;/span&gt; args)&lt;/span&gt;
     &lt;span id="cb1-13"&gt;&lt;a href="#cb1-13" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;newline&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb1-14"&gt;&lt;a href="#cb1-14" aria-hidden="true"&gt;&lt;/a&gt;    (&lt;span class="kw"&gt;car&lt;/span&gt; (&lt;span class="kw"&gt;reverse&lt;/span&gt; args))))&lt;/span&gt;
     &lt;span id="cb1-15"&gt;&lt;a href="#cb1-15" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-16"&gt;&lt;a href="#cb1-16" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; point-distance&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-17"&gt;&lt;a href="#cb1-17" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (a b) (&lt;span class="kw"&gt;abs&lt;/span&gt; (&lt;span class="op"&gt;-&lt;/span&gt; a b))))&lt;/span&gt;
     &lt;span id="cb1-18"&gt;&lt;a href="#cb1-18" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-19"&gt;&lt;a href="#cb1-19" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; point-random &lt;/span&gt;(&lt;span class="kw"&gt;lambda&lt;/span&gt; () (random (&lt;span class="kw"&gt;expt&lt;/span&gt; &lt;span class="dv"&gt;2&lt;/span&gt; exponent))))&lt;/span&gt;
     &lt;span id="cb1-20"&gt;&lt;a href="#cb1-20" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-21"&gt;&lt;a href="#cb1-21" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; pool &lt;/span&gt;(map (&lt;span class="kw"&gt;lambda&lt;/span&gt; _ (point-random)) (iota total)))&lt;/span&gt;
     &lt;span id="cb1-22"&gt;&lt;a href="#cb1-22" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; query &lt;/span&gt;(point-random))&lt;/span&gt;
     &lt;span id="cb1-23"&gt;&lt;a href="#cb1-23" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-24"&gt;&lt;a href="#cb1-24" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; &lt;/span&gt;~.two&lt;/span&gt;
     &lt;span id="cb1-25"&gt;&lt;a href="#cb1-25" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;lambda&lt;/span&gt; (x)&lt;/span&gt;
     &lt;span id="cb1-26"&gt;&lt;a href="#cb1-26" aria-hidden="true"&gt;&lt;/a&gt;    (inexact (&lt;span class="op"&gt;/&lt;/span&gt; (&lt;span class="kw"&gt;round&lt;/span&gt; (* x &lt;span class="dv"&gt;100&lt;/span&gt;)) &lt;span class="dv"&gt;100&lt;/span&gt;))))&lt;/span&gt;
     &lt;span id="cb1-27"&gt;&lt;a href="#cb1-27" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-28"&gt;&lt;a href="#cb1-28" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="ex"&gt;define&lt;/span&gt;&lt;span class="fu"&gt; candidates&lt;/span&gt;&lt;/span&gt;
     &lt;span id="cb1-29"&gt;&lt;a href="#cb1-29" aria-hidden="true"&gt;&lt;/a&gt;  (&lt;span class="kw"&gt;let*&lt;/span&gt; ((objects (map (&lt;span class="kw"&gt;lambda&lt;/span&gt; (x) (&lt;span class="kw"&gt;cons&lt;/span&gt; (point-distance query x) x)) pool))&lt;/span&gt;
     &lt;span id="cb1-30"&gt;&lt;a href="#cb1-30" aria-hidden="true"&gt;&lt;/a&gt;         (objects* (sort (&lt;span class="kw"&gt;lambda&lt;/span&gt; (u v) (&lt;span class="op"&gt;&amp;lt;&lt;/span&gt; (&lt;span class="kw"&gt;car&lt;/span&gt; u) (&lt;span class="kw"&gt;car&lt;/span&gt; v))) objects))&lt;/span&gt;
     &lt;span id="cb1-31"&gt;&lt;a href="#cb1-31" aria-hidden="true"&gt;&lt;/a&gt;         (distance-max (apply &lt;span class="kw"&gt;max&lt;/span&gt; (map &lt;span class="kw"&gt;car&lt;/span&gt; objects*))))&lt;/span&gt;
     &lt;span id="cb1-32"&gt;&lt;a href="#cb1-32" aria-hidden="true"&gt;&lt;/a&gt;    (map (&lt;span class="kw"&gt;lambda&lt;/span&gt; (x) (&lt;span class="kw"&gt;cons&lt;/span&gt; (~.two (&lt;span class="op"&gt;/&lt;/span&gt; (&lt;span class="op"&gt;-&lt;/span&gt; distance-max (&lt;span class="kw"&gt;car&lt;/span&gt; x)) distance-max))&lt;/span&gt;
     &lt;span id="cb1-33"&gt;&lt;a href="#cb1-33" aria-hidden="true"&gt;&lt;/a&gt;                           (&lt;span class="kw"&gt;cdr&lt;/span&gt; x)))&lt;/span&gt;
     &lt;span id="cb1-34"&gt;&lt;a href="#cb1-34" aria-hidden="true"&gt;&lt;/a&gt;         objects*)))&lt;/span&gt;
     &lt;span id="cb1-35"&gt;&lt;a href="#cb1-35" aria-hidden="true"&gt;&lt;/a&gt;&lt;/span&gt;
     &lt;span id="cb1-36"&gt;&lt;a href="#cb1-36" aria-hidden="true"&gt;&lt;/a&gt;(pk 'query (string-upcase (&lt;span class="kw"&gt;number-&amp;gt;string&lt;/span&gt; query &lt;span class="dv"&gt;36&lt;/span&gt;)) query)&lt;/span&gt;
     &lt;span id="cb1-37"&gt;&lt;a href="#cb1-37" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;newline&lt;/span&gt;)&lt;/span&gt;
     &lt;span id="cb1-38"&gt;&lt;a href="#cb1-38" aria-hidden="true"&gt;&lt;/a&gt;(&lt;span class="kw"&gt;for-each&lt;/span&gt; pk (map (&lt;span class="kw"&gt;lambda&lt;/span&gt; (x) (&lt;span class="kw"&gt;list&lt;/span&gt; (&lt;span class="kw"&gt;car&lt;/span&gt; x) (&lt;span class="kw"&gt;number-&amp;gt;string&lt;/span&gt; (&lt;span class="kw"&gt;cdr&lt;/span&gt; x) &lt;span class="dv"&gt;36&lt;/span&gt;) (&lt;span class="kw"&gt;cdr&lt;/span&gt; x))) candidates))&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
     &lt;sorted&gt; &lt;img src="/2023/09/transderivational-beam-search/image.QNKLB2.bottom.png" alt="Source: https://mezbreeze.itch.io/portraits-volume-one"&gt;
     
	&lt;/sorted&gt;&lt;/div&gt;
	</content:encoded><guid isPermaLink="true">https://hyper.dev/2023/exact-brute-force-rank/</guid><pubDate>Mon, 13 Nov 2023 00:00:00 +0000</pubDate></item></channel></rss>