build index.html for all winners
Updated manifest as per recent file changes. Updated winner `.winner.json` to reflect the manifest changes. Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over all winning entries. These tools had slight improvements in the help usage message: * bin/gen-author.sh VERSION="1.3.1 2024-01-16" * bin/gen-inventory.sh VERSION="1.0.1 2024-01-16" * bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16" * bin/subst.default.sh VERSION="1.1.1 2024-01-16" * bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16" The `bin/readme2index.sh` tool was improved so that if the `index.html` file exists and the tool forms the exact same content, then the file `index.html` file is NOT touched. * bin/readme2index.sh VERSION="1.1 2024-01-16" We used the following command to generate `index.html` files for all winning entries: ```sh bin/all_run.sh -v 3 bin/readme2index.sh ``` NOTE: We have not (yet) built HTML files above the winner directory level (e.g., no year level nor top level HTML), nor have be built non-index HTML files for winners. NOTE: By default we are running `pandoc(1)` with: ``` --fail-if-warnings=true ``` This means that any problems with markdown to HTML generates an error. This is done to be sure that the HTML conversion is clean. We had to fix the following `README.md` files: * `2000/rince/README.md` The reference [^2] was never used. We made a guess that [^2] applies to the same spot as [^1]. Perhaps there is a better spot where [^2] applies? NOTE: For every reference, there MUST be some place where that reference is used. * 2012/vik/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". * 2018/burton1/README.md The reference [2] was duplicated. We changed the second [2] to [3]. NOTE: Every reference needs to have a unique number. * 2020/carlini/README.md The string "$...$" is assumed to be a TeX encoded string. NOTE: Every "$..$" needs to be backslashed as in "\$..\$". We also found 2 errors in the `author/author_handle.json` file set: * author/Anonymous_2001.json The `author/Anonymous_2001.json` file was missing. * author/Jari_Arkko.json The winner ID for `1989_jar.1` had a typo.
This commit is contained in:
1 parent
893cd915b6
commit
c1466f5165
350 files changed
+95242
-4217
No files matched your search
+431
-13
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
@@ -6,27 +8,443 @@
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- file: 2019/lynn/index.html created by: fake.gen_index.sh version: 1.0.5 2023-10-31 -->
|
||||
<html lang="en">
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- This file was formed by the tool: bin/readme2index.sh version: 1.1 2024-01-16 -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2019 lynn</title>
|
||||
<meta name="description" content="IOCCC year: 2019 IOCCC winner: lynn winner index page">
|
||||
<meta name="keywords" content="IOCCC,2019,lynn,winner index page">
|
||||
<link rel="stylesheet" href="/temp-test-ioccc/ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>2019/lynn</title>
|
||||
<meta name="description" content="2019 IOCCC winner lynn">
|
||||
<meta name="keywords" content="IOCCC, 2019, IOCCC 2019, IOCCC winner, lynn">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<h1>2019 lynn</h1>
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<p>XXX - fake content until readme2index is working - XXX</p>
|
||||
<div class="header">
|
||||
<img src="/temp-test-ioccc/png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>2019/lynn</h2>
|
||||
</div>
|
||||
|
||||
<hr style="width:50%;text-align:left;margin-left:0">
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||||
|
||||
<!-- Start Nu Html Checker -->
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2019%2Flynn%2Findex.html">Nu Html check https://ioccc-src.github.io/temp-test-ioccc/2019/lynn/index.html</a></p>
|
||||
<!-- End Nu Html Checker -->
|
||||
<div class="topnav">
|
||||
<a class="Left" href="../poikola/index.html">← poikola</a>
|
||||
<a class="Left" href="../index.html">↑ 2019 ↑</a>
|
||||
<a class="Left" href="../burton/index.html">burton →</a>
|
||||
<a class="Right" href="#inventory">Inventory</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.mid.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/index.html">IOCCC Home</a>
|
||||
<a href="/temp-test-ioccc/years.html">Winning Entries</a>
|
||||
<a href="/temp-test-ioccc/winners.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/news.html">IOCCC News</a>
|
||||
<a href="/temp-test-ioccc/faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="/temp-test-ioccc/faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/bugs.html">Bugs & (mis)features</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_a_winner">Fixing IOCCC winners</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="/temp-test-ioccc/faq.html#fix_author">Fixing winner info</a>
|
||||
<a href="/temp-test-ioccc/thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="/temp-test-ioccc/judges.html">The IOCCC Judges</a>
|
||||
<a href="/temp-test-ioccc/contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content generated by: bin/gen-author.sh -->
|
||||
|
||||
<p><a name="author"><strong>Author:</strong></a> <br><br>Name: <a
|
||||
href="/temp-test-ioccc/winners.html#Ben_Lynn">Ben Lynn</a><br> Location:
|
||||
<a href="/temp-test-ioccc/location.html#US">US</a></p>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-author.sh -->
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="/bugs.md#2019-lynn">2019
|
||||
lynn in bugs.md</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="ex">./prog</span></span></code></pre></div>
|
||||
<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>A fully functional compiler. The example prints out the 30th <a
|
||||
href="https://en.wikipedia.org/wiki/Fibonacci_sequence">Fibonacci
|
||||
number</a>.</p>
|
||||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||||
<h3 id="remarks">Remarks:</h3>
|
||||
<p>A Haskell compiler. Supports a subset of Haskell more than large
|
||||
enough to self-host. Like GHC with custom language extensions:</p>
|
||||
<ul>
|
||||
<li><p><code>WeDontServeYourType</code>: Compilation failing because of
|
||||
inscrutable type checking rules? Confused by the ever-growing mire of
|
||||
extensions to the type system? The solution is simple: no type checking.
|
||||
It also means no typeclasses. Just pass dictionaries
|
||||
explicitly.</p></li>
|
||||
<li><p><code>ZeroPauseGarbageCollection</code>: Instead of disruptive
|
||||
stop-the-world garbage collection, we only tidy up when the world stops
|
||||
on its own accord, that is, on program termination.</p></li>
|
||||
<li><p><code>OneHundredPercentPure</code>: Gone is the catch-all lawless
|
||||
IO monad. And no trace of those scary <code>unsafeThisAndThat</code>
|
||||
functions. All functions must be pure.</p></li>
|
||||
<li><p><code>SyntaxForTheMasses</code>: See below.</p></li>
|
||||
</ul>
|
||||
<h3 id="building">Building:</h3>
|
||||
<p>Build the compiler:</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">cc</span> <span class="at">-o</span> prog prog.c</span></code></pre></div>
|
||||
<h3 id="demos">Demos:</h3>
|
||||
<h4 id="fibonacci-numbers">Fibonacci numbers:</h4>
|
||||
<p>Test the compiler on <a href="fib.hs">fib.hs</a>:</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="kw">(</span><span class="ex">./prog</span> <span class="op"><</span> fib.hs <span class="kw">;</span> <span class="fu">cat</span> prog.c<span class="kw">)</span> <span class="op">></span> fib.c</span></code></pre></div>
|
||||
<p>Compiling the output produces a binary that prints the 30th Fibonacci
|
||||
number.</p>
|
||||
<p>The file <a href="ghcfib.hs">ghcfib.hs</a> includes <a
|
||||
href="fib.hs">fib.hs</a> with some glue code, and shows GHC also accepts
|
||||
our subset of Haskell:</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="ex">ghc</span> ghcfib.hs</span></code></pre></div>
|
||||
<h4 id="self-hosting-compiler">Self-hosting compiler:</h4>
|
||||
<p>To avoid spoiling this entry by revealing the original Haskell
|
||||
source, we instead provide <a href="hint.hs">hint.hs</a>, the output of
|
||||
a certain stage of the compiler when run on itself. This intermediate
|
||||
output is hopefully difficult to understand, yet is accepted by our
|
||||
compiler:</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="kw">(</span><span class="ex">./prog</span> <span class="op"><</span> hint.hs <span class="kw">;</span> <span class="fu">cat</span> prog.c<span class="kw">)</span> <span class="op">></span> hint.c</span>
|
||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> hint</span>
|
||||
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./hint</span></span></code></pre></div>
|
||||
<p>The output program behaves like the compiler itself.</p>
|
||||
<p>Unlike the original source from which it is derived, GHC fails to
|
||||
compile <a href="hint.hs">hint.hs</a>. This is because values have been
|
||||
replaced with their <a
|
||||
href="https://en.wikipedia.org/wiki/Mogensen-Scott_encoding">Scott
|
||||
encodings</a> by this stage, which messes up type-checks; we’d need
|
||||
<code>equirecursive</code> types for it to work.</p>
|
||||
<h4 id="regexes">Regexes:</h4>
|
||||
<p>The file <a href="lol.hs">lol.hs</a> contains an adaptation of <a
|
||||
href="https://www.cs.dartmouth.edu/~doug/nfa.pdf">Doug McIlroy’s elegant
|
||||
code from “Enumerating the strings of regular languages”</a>. We
|
||||
exercise it by showing the first entries of the length-ordered list of
|
||||
all strings consisting of the characters <code>a</code> and
|
||||
<code>b</code> that contain an even number of <code>a</code>s.</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="kw">(</span><span class="ex">./prog</span> <span class="op"><</span> lol.hs <span class="kw">;</span> <span class="fu">cat</span> prog.c<span class="kw">)</span> <span class="op">></span> lol.c</span>
|
||||
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> lol</span>
|
||||
<span id="cb9-3"><a href="#cb9-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./lol</span></span></code></pre></div>
|
||||
<p>A GHC wrapper is provided:</p>
|
||||
<div class="sourceCode" id="cb10"><pre
|
||||
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">ghc</span> ghclol.hs</span></code></pre></div>
|
||||
<h3 id="strongly-connected-components">Strongly-connected
|
||||
components:</h3>
|
||||
<p>See <a href="scc.hs">scc.hs</a> (and its GHC wrapper <a
|
||||
href="ghcscc.hs">ghcscc.hs</a>) for an elegant way to print the
|
||||
strongly-connected components of a graph in reverse topological
|
||||
order.</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="kw">(</span><span class="ex">./prog</span> <span class="op"><</span> scc.hs <span class="kw">;</span> <span class="fu">cat</span> prog.c<span class="kw">)</span> <span class="op">></span> scc.c</span></code></pre></div>
|
||||
<p>It expects the input to be in a similar format as a previous entry
|
||||
(2018 vokes). For example:</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="fu">make</span> scc</span>
|
||||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./scc</span> <span class="op"><</span> example-1.txt</span>
|
||||
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./scc</span> <span class="op"><</span> example-2.txt</span></code></pre></div>
|
||||
<p>The output should agree, though our program omits line numbers and
|
||||
does not sort entries within a line. (Also, our program only treats
|
||||
spaces as whitespace, and supports any non-space character in a vertex
|
||||
name.)</p>
|
||||
<h3 id="syntax">Syntax</h3>
|
||||
<p>Some claim Haskell syntax is frightening because braces and
|
||||
semicolons are optional. Some complain about a zoo of twisty little
|
||||
operators, all alike. Our compiler addresses such concerns by making
|
||||
braces and semicolons compulsory, disabling layout-based rules, making
|
||||
every operator left-associative with same precedence, and only defining
|
||||
6 primitive functions:</p>
|
||||
<pre><code>: + - * / <=</code></pre>
|
||||
<p>The arithmetic operations behave as they do in C on
|
||||
<code>unsigned int</code>s, and <code>(:)</code> is Haskell’s
|
||||
<code>cons</code> function. Like Haskell and unlike C,
|
||||
<code>(<=)</code> returns a <code>Bool</code> (which are Church
|
||||
booleans behind the scenes) and not an <code>Int</code>.</p>
|
||||
<p>No ifs, ands, or buts. Define them yourself. No tuples. Who needs
|
||||
them when algebraic data types delivers a better product? There is no
|
||||
do. No where. No list comprehensions. No unary operators.</p>
|
||||
<p>Let expressions and operator sections are supported.</p>
|
||||
<p>Within global scope or a let expression, each definition can only
|
||||
refer to itself or previous definitions. This implies we can only
|
||||
achieve mutual recursion by having one function pass itself to
|
||||
others.</p>
|
||||
<h3 id="caveats">Caveats</h3>
|
||||
<p>The only primitive type is <code>Int</code>. In particular, they
|
||||
represent characters. To interoperate with GHC, our compiler treats any
|
||||
undefined functions as the <code>identity</code> function, so that we
|
||||
may freely use <code>ord</code> and <code>chr</code> (or
|
||||
<code>fromEnum</code> and <code>toEnum</code>) to make our code
|
||||
acceptable to both compilers.</p>
|
||||
<p>The main function is the last function to successfully parse. It
|
||||
should have type <code>[Int] -> [Int]</code>, and our compiler treats
|
||||
this like the function passed into <code>Prelude.interact</code>, that
|
||||
is, the entire standard input is passed to this function, and the result
|
||||
is printed to standard output.</p>
|
||||
<p><code>Bool</code> must be defined as:</p>
|
||||
<pre><code>data Bool = True | False;</code></pre>
|
||||
<p>so that it matches the Scott-encoded booleans internally used by the
|
||||
primitive function <code>(<=)</code>.</p>
|
||||
<p>The alternatives in a <code>case</code> expressions must list every
|
||||
data constructor in the order they are defined. For example, if we
|
||||
have:</p>
|
||||
<pre><code>data Foo a b = Bar a | Baz | Qux Int [b]</code></pre>
|
||||
<p>then a <code>case</code> expression that examines a term of this type
|
||||
must have the form:</p>
|
||||
<pre><code>case x of
|
||||
{ Bar a -> ...
|
||||
; Baz -> ...
|
||||
; Qux n bs -> ...
|
||||
}</code></pre>
|
||||
<p>We stress braces and semicolons are required. Our fussy parser treats
|
||||
semicolons as separators, not terminators.</p>
|
||||
<p>The effect of erroneous input is undefined. It may be best to develop
|
||||
with GHC, but even then, be mindful of changes needed because of issues
|
||||
caused by the uniform operator precedence and the touchy format of
|
||||
<code>case</code> alternatives.</p>
|
||||
<h3 id="why">Why?</h3>
|
||||
<p>One-letter variable names abound in IOCCC entries, and for good
|
||||
reason. These tiny pieces of confetti are hard to read, and leave room
|
||||
for more code. Then why not go further and use zero-letter variable
|
||||
names? That is, tacit programming or point-free style.</p>
|
||||
<p>I had been playing with an algorithm devised by Oleg Kiselyov that
|
||||
effortlessly and efficiently eliminates those pesky variables, leaving
|
||||
behind terms composed from a small set of combinators. No need for
|
||||
lambda lifting or supercombinators.</p>
|
||||
<p>By adding a handful of lines of mostly parsing code, we get a Haskell
|
||||
compiler, or rather, a compiler that accepts a subset of Haskell
|
||||
sufficiently large to self-host. You might say I wrote a tool for this
|
||||
contest, then ran it on itself to make an entry for it.</p>
|
||||
<h3 id="obfuscation-techniques">Obfuscation techniques:</h3>
|
||||
<p>Even with Kiselyov’s algorithm and some term rewriting, the compiler
|
||||
only fit after compression, which naturally obfuscates the code. More
|
||||
tricks were needed to fit within the size limits.</p>
|
||||
<ul>
|
||||
<li>One-letter variables, until enough is done to banish variables
|
||||
completely.</li>
|
||||
<li>Ipse dixit. Near the end, the code declares itself to be an
|
||||
obfuscated program. (There is also an exhortation intended for the
|
||||
judges in a similar format earlier in the source.)</li>
|
||||
<li>Typical C mischief: pre- and post-increment, commutative array
|
||||
indexing, ternary operators, and so on.</li>
|
||||
<li>Huffman coding.</li>
|
||||
<li>Base-85 because high bits are frowned upon.</li>
|
||||
<li>Mixed radix encoding to game iocccsize. From a past winner (<a
|
||||
href="/2018/bellard/README.md">2018/bellard</a>), it seems 9 11 12 32
|
||||
are the only whitespace octets that may appear verbatim in string
|
||||
literals.</li>
|
||||
<li>Choosing what to encode in Huffman/base-85 and what to encode in
|
||||
mixed radix was a delicate balancing act. In the end, I only had a few
|
||||
bytes to spare, which I spent on gratuitous confusion.</li>
|
||||
<li>The effects of some functions depend on the order their arguments
|
||||
are evaluated, yet the program works either way. Why?</li>
|
||||
<li>Ugly macros for the runtime system’s jump table for lazy reduction.
|
||||
A previous winner (<a href="/2013/endoh1/README.md">2013/endoh1</a>) has
|
||||
a cuter solution, which I avoid because of originality concerns and also
|
||||
because my combinators are compressed.</li>
|
||||
<li>Relies on the inability of C comments to nest.</li>
|
||||
<li>Cheaper and more complicated to print comma-separated
|
||||
<code>int</code>s (and header and footer) in C.</li>
|
||||
<li>Primitive functions use a trick described in depth by <a
|
||||
href="https://www.cs.york.ac.uk/fp/reduceron/jfp-reduceron.pdf">Naylor
|
||||
and Runciman, “The Reduceron reconfigured and re-evaluated”</a>. We
|
||||
represent the integer <code>n</code> with a term equivalent to
|
||||
<code>Y(BT)n</code>; it works because
|
||||
<code>Y(BT)ne = e(Y(BT)n)</code>.</li>
|
||||
<li>A sentinel in the heap often confused me, so ought to confuse
|
||||
others.</li>
|
||||
</ul>
|
||||
<p>Other obfuscation techniques are better appreciated after decoding
|
||||
the compiler. See <a href="hint.hs">hint.hs</a>.</p>
|
||||
<ul>
|
||||
<li>Mercilessly point-free. Everything is a combinator.</li>
|
||||
<li>Scott encoding. Everything is a combinator.</li>
|
||||
<li>Sum types are oddly ordered and may even contain unused data
|
||||
constructors to reduce code duplication. (In C terms,
|
||||
<code>union</code>s may have extra fields, and they’re ordered in such a
|
||||
way so we can reuse code to access certain fields.)</li>
|
||||
<li>The <code>undefined</code> function compiles to the <code>(.)</code>
|
||||
function.</li>
|
||||
<li>Replaced the only <code>(&&)</code> with <code>(||)</code>
|
||||
and <code>not</code> using De Morgan’s law, which makes some comparisons
|
||||
less comprehensible.</li>
|
||||
<li><a href="http://okmij.org/ftp/tagless-final/ski.pdf">Kiselyov only
|
||||
published “λ to SKI, Semantically” last year</a>.</li>
|
||||
<li>Recursion via the fixpoint (<code>Y</code>) combinator, which is
|
||||
represented by the variable <code>""</code> during one stage of
|
||||
compilation.</li>
|
||||
<li>Involves theory that may be less familiar to C programmers: maps,
|
||||
folds, parser combinators, lambda calculus, bracket abstraction,
|
||||
denotational semantics, etc.</li>
|
||||
</ul>
|
||||
<h3 id="warnings">Warnings:</h3>
|
||||
<p>On my system, it compiles cleanly with <code>-Wall</code> with older
|
||||
standards, e.g. <code>-std=c89</code>, but less cleanly if
|
||||
<code>-pedantic</code> is also supplied.</p>
|
||||
<p>Compiling the compiler output with <code>-Wall</code> triggers a
|
||||
warning about a strange-looking comment.</p>
|
||||
<h3 id="behind-the-scenes-commentary">Behind-the-scenes commentary:</h3>
|
||||
<p><a href="https://crypto.stanford.edu/~blynn/compiler/ioccc.html">My
|
||||
website reveals how this compiler works</a>.</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>
|
||||
<!-- START: this line starts content generated by: bin/gen-inventory.sh -->
|
||||
|
||||
<h1 id="inventory-for-2019lynn"><a name="inventory"></a>Inventory for
|
||||
2019/lynn</h1>
|
||||
<h2 id="primary-files">Primary files</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">index.html</a> - winner home page</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/prog.c">prog.c</a>
|
||||
- winning source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/Makefile">Makefile</a>
|
||||
- winner Makefile</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/prog.orig.c">prog.orig.c</a>
|
||||
- original source</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/example-1.txt">example-1.txt</a>
|
||||
- sample input</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/example-2.txt">example-2.txt</a>
|
||||
- sample input</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/try.sh">try.sh</a>
|
||||
- how to run</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/fib.hs">fib.hs</a>
|
||||
- compiler macros</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/ghcfib.hs">ghcfib.hs</a>
|
||||
- compiler macros</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/ghclol.hs">ghclol.hs</a>
|
||||
- compiler macros</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/ghcscc.hs">ghcscc.hs</a>
|
||||
- compiler macros</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/lol.hs">lol.hs</a>
|
||||
- compiler macros</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/scc.hs">scc.hs</a>
|
||||
- compiler macros</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/hint.hs">hint.hs</a>
|
||||
- spoiler for compiler macros</li>
|
||||
<li><a href="2019_lynn.tar.bz2">2019_lynn.tar.bz2</a> - download winning
|
||||
source</li>
|
||||
</ul>
|
||||
<h2 id="secondary-files">Secondary files</h2>
|
||||
<ul>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/.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/2019/lynn/.winner.json">.winner.json</a>
|
||||
- description of winner in JSON</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2019/lynn/README.md">README.md</a>
|
||||
- markdown source for index.html</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/gen-inventory.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2019%2Flynn%2Findex.html">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
Reference in new issue
Block a user