force use of pandoc version >= 3.1.12.2

The `bin/pandoc-wrapper.sh` tool will verify that the ssytem
has a recent enough version of `pandoc(1)`.

We explain why we insist on `pandoc(1)`. version >= 3.1.12.2
in comments where the $PANDOC_MIN_VERSION is set.

Added `--wrap=preserve` as a default argument to `pandoc(1)`.
While this change will impact every HTML file generated,
we believe this will improve the ability of someone to look
at the generated HTML and correlate with the original markdown.

Changed `bin/pandoc-wrapper.sh` VERSION from "1.4.2 2024-03-17"
to "1.4.3 2024-03-18".

Performed `make www` to achieve all of the above and to generate
HTML using the new  `--wrap=preserve` `pandoc(1)` mode.
This commit is contained in:
Landon Curt Noll committed 2024-03-18 01:26:39 -07:00
1 parent 9eb7a54e9f
commit b0b212acb1
402 files changed
+37061 -55132

No files matched your search

+89 -128
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Lennart_Augustsson">Lennart
Augustsson</a><br> Location: <a href="../../location.html#SE">SE</a> -
<em>Kingdom of Sweden</em> (<em>Sweden</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Lennart_Augustsson">Lennart Augustsson</a><br>
Location: <a href="../../location.html#SE">SE</a> - <em>Kingdom of Sweden</em> (<em>Sweden</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -144,122 +144,108 @@ Augustsson</a><br> Location: <a href="../../location.html#SE">SE</a> -
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p>
<pre><code>STATUS: doesn&#39;t work with some compilers - please provide alternative code or fix for more compilers</code></pre>
<p>For more detailed information see <a
href="../../bugs.html#1996_august">1996 august bugs</a>.</p>
<p>For more detailed information see <a href="../../bugs.html#1996_august">1996 august bugs</a>.</p>
<h2 id="to-use">To use:</h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> test.oo</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./august</span> <span class="op">&lt;</span> test.oo</span></code></pre></div>
<p>NOTE: some compilers will compile this code into infinite loops! If
the above cat line (or one of the ones later in the try section) does
not execute in a very short amount of time, then you may need to fix
your compiler or use gcc.</p>
<p>NOTE: some compilers will compile this code into infinite loops! If the above
cat line (or one of the ones later in the try section) does not execute in a
very short amount of time, then you may need to fix your compiler or use gcc.</p>
<p>The above should print a <code>!</code> followed by a newline.</p>
<h2 id="try">Try:</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>This entry can feed on itself. If you C pre-process the source, you
can compile the interpreter:</p>
<p>This entry can feed on itself. If you C pre-process the source,
you can compile the interpreter:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> august.oc</span></code></pre></div>
<p>We can now compile the interpreter as follows:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c august.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> august.oo</span></code></pre></div>
<p>and use the compiled interpreter to execute some previously compiled
code:</p>
<p>and use the compiled interpreter to execute some previously
compiled code:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>And we can have the compiled interpreter interpret itself which in
turn compiles the test program:</p>
<p>And we can have the compiled interpreter interpret itself which
in turn compiles the test program:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo fac.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>And if you have lots of spare time, you can recurse one level
deeper:</p>
<p>And if you have lots of spare time, you can recurse one level deeper:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo august.oo fac.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>We (the judges) recommend that you spend some time studying this
entry as it surely will make the ‘best of the IOCCC’ list. It was very
well received by those who attended the IOCCC BOF.</p>
entry as it surely will make the ‘best of the IOCCC’ list. It was
very well received by those who attended the IOCCC BOF.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<p>This program is a bytecode interpreter. This fact is not particularly
obfuscated; any experienced C programmer can see that in about a
minute.</p>
<p>This program is a bytecode interpreter. This fact is not
particularly obfuscated; any experienced C programmer can see that
in about a minute.</p>
<p>The interpreter reads the bytecode from the standard input. What
remains of the standard input after this is left as standard input for
the interpreted program.</p>
<p>Having an interpreter but no code isn’t any fun. But within a comment
in the beginning of the interpreter is a sequence of bytes that is code
that the interpreter understands. It is in fact the code for a compiler
that compiles from OC (Obfuscated C, a subset of C) into the byte code
that the interpreter understands.</p>
in the beginning of the interpreter is a sequence of bytes that is
code that the interpreter understands. It is in fact the code for a
compiler that compiles from OC (Obfuscated C, a subset of C) into the
byte code that the interpreter understands.</p>
<p>The language the compiler understands is a subset of C (the grammar
is below) with the functions <code>getchar(3)</code> and
<code>putchar(3)</code> available. The subset has the types
<code>int</code>, <code>char</code>, and pointers to those (it has
function pointers too, but not with the proper syntax). Arrays can only
be global. There is a rather limited set of operators, and control
constructs.</p>
<p>The compiler has absolutely no error checking, so things can go
wrong. But this is what seasoned C programmers are used to.</p>
<p>Assume that the interpreter has been compiled (source in <a
href="august.c">august.c</a> and binary in august) and that we have this
in a file named <code>test.oc</code>:</p>
is below) with the functions <code>getchar(3)</code> and <code>putchar(3)</code>
available. The subset has the types <code>int</code>, <code>char</code>, and pointers to
those (it has function pointers too, but not with the proper
syntax). Arrays can only be global. There is a rather limited set
of operators, and control constructs.</p>
<p>The compiler has absolutely no error checking, so things
can go wrong. But this is what seasoned C programmers are used to.</p>
<p>Assume that the interpreter has been compiled (source in <a href="august.c">august.c</a>
and binary in august) and that we have this in a file named <code>test.oc</code>:</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a>main<span class="op">()</span> <span class="op">{</span> putchar<span class="op">(</span><span class="ch">&#39;!&#39;</span><span class="op">);</span> putchar<span class="op">(</span><span class="ch">&#39;</span><span class="sc">\n</span><span class="ch">&#39;</span><span class="op">);</span> exit<span class="op">(</span><span class="dv">0</span><span class="op">);</span> <span class="op">}</span></span></code></pre></div>
<p>We can then compile by</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> test.oo</span></code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> test.oo</span></code></pre></div>
<p>And run the compiled program by</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./august</span> <span class="op">&lt;</span> test.oo</span></code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./august</span> <span class="op">&lt;</span> test.oo</span></code></pre></div>
<p>Or even simpler:</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c test.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>A larger example is included <a href="fac.oc">fac.oc</a>.</p>
<p>The compiler for OC is naturally written in OC (where did you think
the byte code came from?). It is in the file <a
href="parse.oc">parse.oc</a>.</p>
<p>Hmm… So now we have an interpreter written in OC and a compiler for
OC, can we compile the interpreter? Yes, we can! The OC compiler does
not have a preprocessor (hey, what do you expect from a program that is
this small), so we need to use an external one. To pre-process <a
href="august.c">august.c</a> use the command from the Makefile, but add
the <code>-E</code> flag and change 60000 to 40000, i.e.:</p>
<div class="sourceCode" id="cb14"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-E</span> <span class="at">-DZ</span><span class="op">=</span>40000 .... august.c <span class="op">&gt;</span> august.oc</span></code></pre></div>
<p>If <code>august.oc</code> contain some junk line starting with a
<code>#</code> (most likely it does) then remove it like:</p>
<div class="sourceCode" id="cb15"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sed</span> <span class="at">-i</span><span class="st">&#39;&#39;</span> <span class="st">&#39;/^#/d&#39;</span> august.oc</span></code></pre></div>
<p>The compiler for OC is naturally written in OC (where did you think the byte
code came from?). It is in the file <a href="parse.oc">parse.oc</a>.</p>
<p>Hmm… So now we have an interpreter written in OC and a compiler for OC, can
we compile the interpreter? Yes, we can! The OC compiler does not have a
preprocessor (hey, what do you expect from a program that is this small), so we
need to use an external one. To pre-process <a href="august.c">august.c</a> use the
command from the Makefile, but add the <code>-E</code> flag and change 60000 to 40000,
i.e.:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cc</span> <span class="at">-E</span> <span class="at">-DZ</span><span class="op">=</span>40000 .... august.c <span class="op">&gt;</span> august.oc</span></code></pre></div>
<p>If <code>august.oc</code> contain some junk line starting with a <code>#</code> (most likely
it does) then remove it like:</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sed</span> <span class="at">-i</span><span class="st">&#39;&#39;</span> <span class="st">&#39;/^#/d&#39;</span> august.oc</span></code></pre></div>
<p>OK, we can now compile the interpreter:</p>
<div class="sourceCode" id="cb16"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c august.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> august.oo</span></code></pre></div>
<div class="sourceCode" id="cb16"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.c august.oc <span class="kw">|</span> <span class="ex">./august</span> <span class="op">&gt;</span> august.oo</span></code></pre></div>
<p>And we can run it:</p>
<div class="sourceCode" id="cb17"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>Here we have the interpreter interpreting another interpreter that
runs the program. Did you think that was too fast? Just throw in another
<div class="sourceCode" id="cb17"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>Here we have the interpreter interpreting another interpreter that runs
the program. Did you think that was too fast? Just throw in another
level of interpretation:</p>
<div class="sourceCode" id="cb18"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<div class="sourceCode" id="cb18"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<p>And another…</p>
<div class="sourceCode" id="cb19"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<div class="sourceCode" id="cb19"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="fu">cat</span> august.oo august.oo august.oo test.oo <span class="kw">|</span> <span class="ex">./august</span></span></code></pre></div>
<hr />
<p>Fitting the byte code for the compiler into the initial comment was a
challenge. I had to strip the compiler/interpreter of a lot of
functionality to bring down their sizes. The initial version had a full
set of binary operators as well as prefix <code>&amp;</code>. Given a
handful more bytes it would be easy to put them back.</p>
<p>Anyway, the bytecode from the compiler is first optimized in an
external optimizer (not supplied here); this brings down the size of it
by about 30%. The remaining code is then LZ-compressed (roughly) with a
sliding window of 255 bytes. The most common occurring bytes are then
encoded using <code>" \n\t;{}"</code> to avoid having them counted as
significant. About 200 bytes of the interpreter handles the unpacking of
the byte code (this is a lot, but it pays off).</p>
<p>Fitting the byte code for the compiler into the initial comment
was a challenge. I had to strip the compiler/interpreter of
a lot of functionality to bring down their sizes. The initial
version had a full set of binary operators as well as prefix <code>&amp;</code>.
Given a handful more bytes it would be easy to put them back.</p>
<p>Anyway, the bytecode from the compiler is first optimized in
an external optimizer (not supplied here); this brings down the
size of it by about 30%. The remaining code is then LZ-compressed
(roughly) with a sliding window of 255 bytes. The most common
occurring bytes are then encoded using <code>" \n\t;{}"</code> to avoid having
them counted as significant. About 200 bytes of the interpreter
handles the unpacking of the byte code (this is a lot, but it pays
off).</p>
<p>Despite all this work I still had to put a lot of code in the
compilation command. This disturbs me. It is possible to compress the
code further with a better entropy coder (e.g. an arithmetic coder), but
decompression then takes up too much code. Maybe this would be a way to
fit it all into the 1536 bytes, but I don’t have time to try it.</p>
compilation command. This disturbs me. It is possible to compress
the code further with a better entropy coder (e.g. an arithmetic
coder), but decompression then takes up too much code. Maybe this
would be a way to fit it all into the 1536 bytes, but I don’t have
time to try it.</p>
<hr />
<p>Execution starts at <code>main()</code>. Nothing can be used before
it is defined. <code>getchar()</code> and <code>putchar()</code> are
predefined functions.</p>
<p>Execution starts at <code>main()</code>. Nothing can be used before it is
defined. <code>getchar()</code> and <code>putchar()</code> are predefined functions.</p>
<p>Below is a description of the OC grammar.</p>
<h3 id="oc-grammar">OC grammar</h3>
<p>Terminals are in quotes, <code>()</code> is used for bracketing.</p>
@@ -321,62 +307,37 @@ stars: &quot;*&quot;*
</code></pre>
<hr />
<p>Well, that is enough ranting for now.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1996august"><a name="inventory"></a>Inventory for
1996/august</h1>
<h1 id="inventory-for-1996august"><a name="inventory"></a>Inventory for 1996/august</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.c">august.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.orig.c">august.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/fac.oc">fac.oc</a>
- oc source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/parse.oc">parse.oc</a>
- oc source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/test.oc">test.oc</a>
- oc source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/try.sh">try.sh</a>
- how to run</li>
<li><a href="1996_august.tar.bz2">1996_august.tar.bz2</a> - download
entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.c">august.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/august.orig.c">august.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/fac.oc">fac.oc</a> - oc source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/parse.oc">parse.oc</a> - oc source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/test.oc">test.oc</a> - oc source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/try.sh">try.sh</a> - how to run</li>
<li><a href="1996_august.tar.bz2">1996_august.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1996/august/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->