<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2021-08-19T20:58:07+00:00</updated><id>/feed.xml</id><title type="html">LIVE 2021 submission</title><subtitle>Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.</subtitle><entry><title type="html">Closing The Loop Early For Self-Improvable Graphical Systems</title><link href="/2021/08/17/LIVE-2021-demo.html" rel="alternate" type="text/html" title="Closing The Loop Early For Self-Improvable Graphical Systems" /><published>2021-08-17T14:11:12+00:00</published><updated>2021-08-17T14:11:12+00:00</updated><id>/2021/08/17/LIVE-2021-demo</id><content type="html" xml:base="/2021/08/17/LIVE-2021-demo.html">&lt;h2 id=&quot;author-information&quot;&gt;Author information&lt;/h2&gt;

&lt;p&gt;(Redacted to assist reviewers)&lt;/p&gt;

&lt;h2 id=&quot;the-dream-self-improvable-systems-based-on-structured-representations&quot;&gt;The dream: self-improvable systems based on structured representations&lt;/h2&gt;
&lt;p&gt;My research interest is to combine two properties that, so far, only exist independently.&lt;/p&gt;

&lt;p&gt;The first, &lt;strong&gt;self-improvability&lt;/strong&gt;, is the ability for a system to present &lt;em&gt;itself&lt;/em&gt; as open for modification to a deep level. The quintissential example is the &lt;a href=&quot;http://www.vpri.org/pdf/rn2006001a_colaswp.pdf&quot;&gt;“Combined Object Lambda Architecture” research&lt;/a&gt; by Piumarta et al. However, Smalltalk, Lisp, and Unix as a whole also exhibit this property. Note that, although software &lt;em&gt;within&lt;/em&gt; Unix can be modified by changing the source code and rebuilding, the language and abstractions used in the source code are often different to those in the built program. So a Unix-based system &lt;em&gt;as a whole&lt;/em&gt; is improved by means of itself, yet its individual components are not.&lt;/p&gt;

&lt;p&gt;The second, &lt;strong&gt;structuredness&lt;/strong&gt;, means that data (and code) is represented as &lt;em&gt;graphs and trees instead of strings&lt;/em&gt; wherever possible. Examples include &lt;a href=&quot;http://www.subtext-lang.org/&quot;&gt;Subtext&lt;/a&gt; and spreadsheets. This makes parsing and serialising unnecessary, while syntax errors and “tabs versus spaces” are appropriately banished. Code and data can be presented in a variety of context-appropriate ways, taking full advantage of a 2D display, and can be manipulated directly as structures instead of characters. Real graphics, colours and shapes – not just ASCII art – can be included as desired. None of this precludes “typing out” structures on the keyboard, either.&lt;/p&gt;

&lt;p&gt;Existing systems that demonstrate self-improvability seem invested in the text-and-parsing world, and systems not in this world do not exhibit self-improvability. I want to combine the best of both.&lt;/p&gt;

&lt;p&gt;Alas, while the path for building self-improvable &lt;em&gt;languages&lt;/em&gt; is well trodden, its techniques do not clearly translate over to the world of &lt;em&gt;interactive structure&lt;/em&gt;. What I am presenting here is my progress so far at navigating these uncharted waters.&lt;/p&gt;

&lt;h2 id=&quot;building-up-from-a-human-friendly-low-level&quot;&gt;Building up from a &lt;em&gt;human-friendly&lt;/em&gt; low level&lt;/h2&gt;
&lt;p&gt;The way to build a self-improvable system is to &lt;em&gt;bootstrap&lt;/em&gt; it from some given starting point. An initial &lt;em&gt;substrate&lt;/em&gt; must be decided upon. First, we have to decide the form of data, i.e. &lt;em&gt;state&lt;/em&gt;, in the substrate. Then, we must ensure that &lt;em&gt;changes&lt;/em&gt; to the state can be described &lt;em&gt;in the state itself.&lt;/em&gt; In other words, &lt;em&gt;code must be data&lt;/em&gt;. With this in place, code can be generated by programs, and the ladder of abstraction can be climbed from Assembler to high-level code descriptions. In other words, we can “close the loop”.&lt;/p&gt;

&lt;p&gt;This already happened at the &lt;em&gt;machine level&lt;/em&gt; of computing, of course.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The form of state is simply bit-patterns, equivalently &lt;em&gt;numbers&lt;/em&gt;, arranged in a &lt;em&gt;flat&lt;/em&gt; line and addressed by &lt;em&gt;numbers&lt;/em&gt;.&lt;/li&gt;
  &lt;li&gt;Code is data: machine instructions are encoded as bits (numbers).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problem with this is that it is &lt;em&gt;human-repellent&lt;/em&gt;. You can’t survive in this environment for long without introducing &lt;em&gt;symbolic names&lt;/em&gt; in some form - whether encoded as Unicode in the state, or on a piece of paper, or simply in your head. We simply do not identify things by opaque numbers, and nor should we.&lt;/p&gt;

&lt;p&gt;Additionally, the state is &lt;em&gt;flat&lt;/em&gt;. You can’t &lt;em&gt;insert or grow&lt;/em&gt; something without &lt;em&gt;physically moving other stuff&lt;/em&gt; to make space. Anything that can be called a &lt;em&gt;structure&lt;/em&gt; (trees, graphs etc.) has to be &lt;em&gt;faked&lt;/em&gt; as scattered memory blocks pointing to each other.&lt;/p&gt;

&lt;p&gt;Historically, this was an unfortunate necessity. But nowadays, we have the opportunity to forget about this level, and instead build things on top of a &lt;em&gt;human-friendly low level&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;State is a &lt;em&gt;tree&lt;/em&gt; (alternatively, graph) &lt;em&gt;of textual names&lt;/em&gt; (which can include spaces!)&lt;/li&gt;
  &lt;li&gt;Changes to the state (code) are simply pieces of state with a certain format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It might look like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/tree-state.png&quot; alt=&quot;State in treeview&quot; class=&quot;img-responsive&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;the-devils-in-the-details&quot;&gt;The devil’s in the details&lt;/h2&gt;
&lt;p&gt;The above description of our starting substrate is a sketch, far from complete. My implementation technology is JavaScript in the web browser, and I know I want an expanding/collapsing tree view as a minimal way to &lt;em&gt;see&lt;/em&gt; the current state. As soon as I decide to &lt;em&gt;do&lt;/em&gt; something, it’s apparent that there are still many undefined design details. For the “state” half of the problem:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What JavaScript data structures will model the state? &lt;em&gt;(Plain JavaScript objects, a.k.a. dictionaries or &lt;strong&gt;maps&lt;/strong&gt;)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Are we going with strict trees, DAGs or general graphs? &lt;em&gt;(Support general graphs in a tree view.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;How smart should the state be? Should it be “reactive”, notifying listeners when pieces change? &lt;em&gt;(No.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;How will we represent lists? Will they start at 0 or 1? &lt;em&gt;(Lists are just dictionaries with numerical keys, starting at 1.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Which parts of the state will have special meaning, and which will be user-defined?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And so on. The last question relates to the model of computation, i.e. the “changes to state” half of the problem:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What programming model will lie at the lowest level? &lt;em&gt;(Imperative Assembler.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;How will instructions be arranged? Will each have a “next” pointer? &lt;em&gt;(No, just as a list.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;What format will instructions have? &lt;em&gt;(An “op” field to dispatch the correct behaviour, and any custom arguments.)&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;What types of instructions will be available? How many? Sophisticated or primitive? &lt;em&gt;(A handful, all primitive.)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Answering these design questions is more art than science. In my case they depended on factors too complicated and boring to justify here, including a heavy dose of personal taste. However, there does flow through a common theme, for which my answers were informed by a principle, or heuristic. The theme is this: &lt;em&gt;should we make the starting substrate more, or less, feature-rich; sophisticated; helpful; smart?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My heuristic is &lt;em&gt;no&lt;/em&gt; – our starting substrate should be small, primitive, and quick to implement. That way, the sooner we can leave JavaScript, to start working entirely &lt;em&gt;in-system&lt;/em&gt;.&lt;/p&gt;

&lt;h2 id=&quot;minimal-substrates-for-maximal-progress&quot;&gt;Minimal substrates for maximal progress?&lt;/h2&gt;
&lt;p&gt;Truly, it is tedious to work with a programming system that only has the bare essentials. It is tempting to see this looming ahead, and to get to work implementing a substrate that is smart, helpful, reactive, whatever – perhaps it even has a standard library. This is a fine goal to have for the system, but such progress must be accomplished &lt;em&gt;in-system&lt;/em&gt;, or it is wasted.&lt;/p&gt;

&lt;p&gt;It is wasted because it involves putting all our work into code that exists &lt;strong&gt;in our JavaScript files&lt;/strong&gt;, which are inaccessible to the system. This means that we cannot take advantage of anything we invent in the system – visualisations, abstractions, domain-specific languages – to affect these parts of it. &lt;strong&gt;They are permanently locked out of self-improvability!&lt;/strong&gt; Even if we give our system access to the JavaScript, reintroducing these &lt;em&gt;text strings!&lt;/em&gt; would corrupt our beautiful world with the ugly anachronisms of parsing and serialising once again, and we might as well give up.&lt;/p&gt;

&lt;p&gt;We proceed with the knowledge that any fancy features we implement in JavaScript are temporary crutches that we’ll need to re-implement in-system, sooner or later. In short, the JavaScript is a ladder to throw away once transcended. It can’t quite be “jettisoned without remorse” as &lt;a href=&quot;http://www.vpri.org/pdf/rn2006001a_colaswp.pdf&quot;&gt;Piumarta&lt;/a&gt; does with his C++; it’s all we’ve got to “run” anything (short of WebAssembly). However, we can aim for a &lt;em&gt;minimal&lt;/em&gt; JavaScript kernel that can, perhaps, be “forgotten without remorse”.&lt;/p&gt;

&lt;p&gt;This heuristic, if accepted, leads quite inevitably to an answer to one of the major questions: the base programming model must resemble imperative Assembler. This is because, being the quickest to implement, it will get us out of JavaScript the fastest.&lt;/p&gt;

&lt;h2 id=&quot;demo-camera-panning-lifted-out-of-javascript&quot;&gt;Demo: camera panning lifted out of JavaScript&lt;/h2&gt;
&lt;p&gt;The following video shows a tree view of system state on the right, next to a 3D rendering window. The camera can be panned around by dragging with the mouse and zoomed by scrolling. This behaviour is running in JavaScript, but notice the flag &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dragging_in_system&lt;/code&gt; in the tree view. When we set it to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;true&lt;/code&gt;, all that happens when we drag is that the press and release positions are recorded under the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pointer&lt;/code&gt; key. We can then run the instructions to see the very same camera-moving behaviour running in-system. In the next section we will explain the instruction set, and later we will take a closer look at the code in the video.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/KbymDIzPOFE&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;the-basic-instruction-set&quot;&gt;The basic instruction set&lt;/h2&gt;
&lt;p&gt;Our reference point is the global root of the state tree. Its immediate children we call &lt;strong&gt;registers&lt;/strong&gt;. A handful of registers are treated specially, but the rest can be named at will and used as local variables by user programs. The special registers are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;next_instruction&lt;/code&gt;: this is the Instruction Pointer. It can be pointed to any list and will advance within it. To jump, just overwrite it!&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt;: the current focus of attention. This is the bottleneck for load/store operations. It also holds the key when indexing maps (a.k.a. dictionaries).&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map&lt;/code&gt;: whatever map is held here will be indexed or written to by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;store&lt;/code&gt; instructions.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source&lt;/code&gt;: this holds the source value for map write operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The minimal necessary instructions are as follows:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load &amp;lt;value&amp;gt;&lt;/code&gt;: makes &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; hold the given immediate value.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deref&lt;/code&gt;: treats &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; as naming another register, and replaces &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; with its contents.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index&lt;/code&gt;: uses the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; as a key to look up in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map&lt;/code&gt;, and replaces &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map&lt;/code&gt; with the corresponding value.
(If the map does not have that key, it returns the value of the “default” &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_&lt;/code&gt; key instead; this is how we get “else” in conditional branches.)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;store &amp;lt;register&amp;gt;&lt;/code&gt;: copies the contents of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; to the named register.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;store&lt;/code&gt;: without any register argument, uses the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; as a key to look up in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map&lt;/code&gt;, and copies the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source&lt;/code&gt; to this location.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;js &amp;lt;func&amp;gt;&lt;/code&gt;: executes the given JavaScript function. This is a last-resort window into the world “underneath” and is necessary for making use of Web libraries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because these are so primitive, affecting minimal state, they are perhaps best comparable to micro-operations in a CISC processor. What seem like the most primitive possible operations (e.g. copying one piece of state elsewhere, or taking a conditional branch) expand to several or even many instructions. Here are some examples of recurring patterns (heralding future macros and subroutines):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Copying one register to another, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reg_dest &amp;lt;- reg_source&lt;/code&gt;, expands to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load reg_source; deref; store reg_dest&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Writing to maps via registers, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;reg_map.[reg_key] &amp;lt;- reg_source&lt;/code&gt; involves copying the three registers to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;source&lt;/code&gt; respectively. In full, this expands to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load reg_map; deref; store map; load reg_source; deref; store source; load reg_key; deref; store&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Accessing a fixed path involves repeated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;index&lt;/code&gt; pairs for each key. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;focus &amp;lt;- map.a.b.c&lt;/code&gt; expands to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;load a; index; load b; index; load c; index&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;demo-writing-to-the-tree&quot;&gt;Demo: writing to the tree&lt;/h2&gt;
&lt;p&gt;The following video shows an initial state with a data structure, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lisp_stuff&lt;/code&gt;, which is a prototype of what a high-level language structure might look like in this substrate. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;next_instruction&lt;/code&gt; has been pointed to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;instructions&lt;/code&gt; register, starting at key 1. The instructions change the value at the path &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lisp_stuff.args_e.value.args_e.body_e.1.type&lt;/code&gt; to the value &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;foobar&lt;/code&gt;.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/osjd_gRK_3c&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;demo-conditional-jump&quot;&gt;Demo: conditional jump&lt;/h2&gt;
&lt;p&gt;The initial state here involves the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;weather&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conclusion&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;finished&lt;/code&gt; registers. If the weather is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cold&lt;/code&gt; the conclusion should be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;it's cold&lt;/code&gt;; if it’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;warm&lt;/code&gt; the conclusion should be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;it's warm&lt;/code&gt;, and otherwise &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;it's neither!&lt;/code&gt;. The branching structure can be seen in the instruction list. Regardless of the branch, they should all merge afterward to set &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;finished&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There is no need for a comparison instruction, because there is already an instruction for indexing maps based on a key name. Notice how verbose it is to overwrite &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;next_instruction&lt;/code&gt; to make a jump! We need to reset the key to 1 as well as point to a new map, but we cannot do these as two separate instructions or it will jump to the wrong place! Instead, we must prepare a new value to write in one single instruction.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/XkTpEouEkrA&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;and-now-the-shapes&quot;&gt;And Now, The Shapes&lt;/h2&gt;
&lt;p&gt;In the previous two demos, we’ve been using plain HTML and CSS for graphics. For things like arrows and more complicated shapes, we need something else. In a previous project, I used SVG. I discovered that SVG is very unpleasant to work with programmatically. Pain points include the fact that everything is “stringly typed” (structure, even matrix transformations, is encoded as attribute strings) and that one must use &lt;em&gt;tree node ordering&lt;/em&gt; to control which shapes go in front of or behind others. This time, I am using THREE.js, a 3D graphics library that is nevertheless a wise choice for serious 2D graphics.&lt;/p&gt;

&lt;p&gt;The obvious path forward is to make a bunch of THREE.js API calls in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;js&lt;/code&gt; instructions; however, in this case it pays to consider another way. Think of Commodore 64 BASIC and memory-mapped I/O. In the flat, binary model of state, there is a region of memory known as the &lt;strong&gt;framebuffer&lt;/strong&gt;; you can write values there and see coloured pixels light up on the display.&lt;/p&gt;

&lt;p&gt;In keeping with our theme here, how can we lift the flat and binary idea of a “framebuffer” into minimal basic human-friendliness? There are several choices, one being to simply preserve pixel access in a nicer way, but how about this: &lt;em&gt;the framebuffer does for raster graphics what the tree does for vector graphics.&lt;/em&gt; Memory-mapped graphics at the machine level, the framebuffer, matches the flat nature of the rest of memory. Why not define memory-mapped graphics at the structured level as structures representing shapes, i.e. as retained-mode vector graphics?&lt;/p&gt;

&lt;p&gt;In our case, we are fortunate to already have a tree structure in THREE.js which can be straightforwardly mirrored into our system state. At the time of writing, this is still mostly not implemented. We can, however, return to the camera panning demo from earlier for a closer look.&lt;/p&gt;

&lt;h2 id=&quot;demo-camera-panning-internals&quot;&gt;Demo: camera panning internals&lt;/h2&gt;
&lt;p&gt;As soon as we have a means for graphics in our substrate, an essential task is to allow zooming and panning around the world. The physical screen can only hold so much, and this task amounts to &lt;em&gt;freeing ourselves&lt;/em&gt; from its constraints. Let’s see how panning is achieved in the system’s instruction set:&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/8aMj_kZsur8&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;This relies on the new registers &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vec_from&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vec_to&lt;/code&gt;, and the new instruction &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vsub&lt;/code&gt; which returns the vector &lt;em&gt;from&lt;/em&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vec_from&lt;/code&gt; &lt;em&gt;to&lt;/em&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vec_to&lt;/code&gt;. Notice also the format of vectors, particularly that each carries the name of its basis frame. Representing a screen vector in world co-ordinates is as simple as calling an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;in world&lt;/code&gt; instruction.&lt;/p&gt;

&lt;p&gt;We have missed no opportunity to put the immensely &lt;em&gt;fundamental&lt;/em&gt; infrastructure of vector transformations on a “minimally human-friendly” footing. All too often in programming – even mathematics and physics – we are presented with a vision of “vectors” as mere lists of numbers, and we must keep track of bases and transformations on paper. Worse, even the components are listed as 0, 1, 2 or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;x&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;y&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;z&lt;/code&gt; (which are no less meaningless) and we must waste cognition remembering which directions correspond to which indexes. As an exception to the “minimalism” heuristic, it is plausibly worth building “smart” vector and transformation infrastructure directly into the substrate.&lt;/p&gt;

&lt;h2 id=&quot;the-story-so-far-and-ahead&quot;&gt;The story so far, and ahead&lt;/h2&gt;
&lt;p&gt;So far, here is the rough sequence of steps involved in bootstrapping a self-improvable graphical system:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Choose an Implementation Substrate &lt;em&gt;IS&lt;/em&gt; (JavaScript)&lt;/li&gt;
  &lt;li&gt;Choose the in-system state format (trees)&lt;/li&gt;
  &lt;li&gt;Derive the minimal set of instructions to represent computation (load, store, deref, index, js)&lt;/li&gt;
  &lt;li&gt;Implement (in the &lt;em&gt;IS&lt;/em&gt;) the fetch-decode-execute cycle for these instructions (this should be quick)&lt;/li&gt;
  &lt;li&gt;Implement (in the system) zoom / pan round an unlimited space&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We are in the middle of step 5. It is not obvious what the next priority is, but certainly future steps will include the following.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Macros, subroutines and high-level code.&lt;/strong&gt; Develop calling conventions for re-using chunks of instructions and returning from them; allow unknown “instructions” to be processed by user-defined macro expanders. Use the linear world of Assembler to escape to a structured, Lisp-like expression of behaviour built on maps instead of lists (Masp?)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Render the trees in THREE.js&lt;/strong&gt;. It was convenient to have a tree view in HTML as the initial, throwaway viewer for system state. However, if the THREE.js view is supposed to be our window into the world, then one day the tree view must be part of it. Appropriate, domain-specific, high-level structures representing tree view nodes can be progressively expanded into shape structures. The subtle art of deciding which responsibilities belong in the substrate, and which belong in JavaScript, is particularly important here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Innovate visual editing&lt;/strong&gt;. The tree representation of code will inevitably be verbose and tedious; at least we can try the full spectrum of textual-graphical possibilities here, which cannot be said for text editors on the outside.&lt;/p&gt;

&lt;h2 id=&quot;food-for-thought&quot;&gt;Food for thought&lt;/h2&gt;
&lt;p&gt;My current goal is to see merely an &lt;em&gt;example&lt;/em&gt; of a self-improvable graphical system. Beyond this, I hope that the exercise will result in techniques transferrable to other implementation technologies besides JavaScript, and to different answers to the various design questions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hypothesis:&lt;/em&gt; given a particular way of organising state, a minimal Assembler language of changes to that state can be &lt;strong&gt;mechanically derived.&lt;/strong&gt; Imagine deriving the Assembler language for the following state models: SVG trees in the browser DOM; The Unix filesystem; a general graph structure; 2D continuous space(!)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hypothesis:&lt;/em&gt; there is a general &lt;em&gt;bootstrapping technique&lt;/em&gt;, such that the starting point can be any language or platform according to taste or whim. It can be treated as an axiom; &lt;em&gt;given&lt;/em&gt; such an implementation technology, the main steps for bootstrapping a self-improvable system can be straightforwardly followed.&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;Ian Piumarta &lt;a href=&quot;http://www.vpri.org/pdf/rn2006001a_colaswp.pdf&quot;&gt;“Accessible Language-Based Environments of Recursive Theories”&lt;/a&gt;, Viewpoints Research Institute, 2006&lt;/li&gt;
  &lt;li&gt;Jonathan Edwards &lt;a href=&quot;http://www.subtext-lang.org/&quot;&gt;“Subtext: uncovering the simplicity of programming”&lt;/a&gt;, ongoing&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><summary type="html">Author information (Redacted to assist reviewers)</summary></entry><entry><title type="html">Welcome to Jekyll!</title><link href="/jekyll/update/2021/08/17/welcome-to-jekyll.html" rel="alternate" type="text/html" title="Welcome to Jekyll!" /><published>2021-08-17T14:11:12+00:00</published><updated>2021-08-17T14:11:12+00:00</updated><id>/jekyll/update/2021/08/17/welcome-to-jekyll</id><content type="html" xml:base="/jekyll/update/2021/08/17/welcome-to-jekyll.html">&lt;p&gt;You’ll find this post in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;, which launches a web server and auto-regenerates your site when a file is updated.&lt;/p&gt;

&lt;p&gt;Jekyll requires blog post files to be named according to the following format:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YEAR-MONTH-DAY-title.MARKUP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YEAR&lt;/code&gt; is a four-digit number, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MONTH&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DAY&lt;/code&gt; are both two-digit numbers, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MARKUP&lt;/code&gt; is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.&lt;/p&gt;

&lt;p&gt;Jekyll also offers powerful support for code snippets:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hi, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Tom'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#=&amp;gt; prints 'Hi, Tom' to STDOUT.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Check out the &lt;a href=&quot;https://jekyllrb.com/docs/home&quot;&gt;Jekyll docs&lt;/a&gt; for more info on how to get the most out of Jekyll. File all bugs/feature requests at &lt;a href=&quot;https://github.com/jekyll/jekyll&quot;&gt;Jekyll’s GitHub repo&lt;/a&gt;. If you have questions, you can ask them on &lt;a href=&quot;https://talk.jekyllrb.com/&quot;&gt;Jekyll Talk&lt;/a&gt;.&lt;/p&gt;</content><author><name></name></author><category term="jekyll" /><category term="update" /><summary type="html">You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.</summary></entry></feed>