add some humor about the build process to 1993/lmfjyh

This commit is contained in:
Landon Curt Noll committed 2024-03-20 13:34:02 -07:00
1 parent a5b3a9e07b
commit 57e9ffacf3
2 files changed
+46 -40

No files matched your search

+21 -16
View File
@@ -6,25 +6,31 @@ If you have gcc < 2.3.3 you can build this entry like:
make all make all
``` ```
This will create a file called `";main(){puts("Hello World!");}char*C=".c` which This will try to create a file whose actual filename is literally:
would print `Hello World!` when compiled.
```
";main(){puts("Hello World!");}char*C=".c
```
When that file is compiled, it will greet the world in the
traditional fashion of C.
For an explanation of why and how this works see the author's remarks. The gist For an explanation of why and how this works see the author's remarks. The gist
of the entry itself, however, is the file name _itself **is** the code_. of the entry itself, however, is the file name _itself_ **is** _part of the code_.
NOTE: we delete the temporary file whether or not the compilation succeeds NOTE: We delete the temporary file as part of `make all` whether
because it is an unsafe filename and not doing so would cause problems for or not the compilation succeeds. This is a Makefile **feature**
anyone running `make`. that might **bug** anyone running the make command. :-)
This entry will not compile with gcc < 2.3.3 as it relies on a bug which was This entry will not compile with gcc version >= 2.3.3 as it relied
fixed in gcc 2.3.3 which was fixed a very long time ago now. There is an on a bug which was later fixed in gcc 2.3.3, and that happened
alternate version for [those of _a long time ago_ (.. _in a galaxy far, far away_?).
us](https://www.collinsdictionary.com/dictionary/english/everyone) with gcc >=
2.3.3. See [Alternate code](#alternate-code) section below for more details.
However, there is an another version that will be compiled in the extremely If `make all` fails to compile, a suggestion of compiling and running
likely case this fails. This should happen automatically. See [Alternate the alternate version is printed. This alternate version is a variant
code](#alternate-code) below for more details on it. for [those of us](https://www.collinsdictionary.com/dictionary/english/everyone)
with gcc >= 2.3.3 or using clang. See [Alternate code](#alternate-code)
section below for more details.
### Bugs and (Mis)features: ### Bugs and (Mis)features:
@@ -51,8 +57,7 @@ If you have gcc < 2.3.3 (i.e. the entry can compile):
This version does what the code did but in a way that will work with modern This version does what the code did but in a way that will work with modern
compilers. We'd like to say there's something special about it but there isn't. compilers. We'd like to say there's something special about it but there isn't.
Nonetheless it will be compiled in case the original entry fails to compile Nonetheless it will be compiled in case the original entry fails to compile.
(which will happen unless you have gcc < 2.3.3.
### Alternate build: ### Alternate build:
+25 -24
View File
@@ -142,36 +142,37 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
<h2 id="to-build">To build:</h2> <h2 id="to-build">To build:</h2>
<p>If you have gcc &lt; 2.3.3 you can build this entry like:</p> <p>If you have gcc &lt; 2.3.3 you can build this entry like:</p>
<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> all</span></code></pre></div> <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> all</span></code></pre></div>
<p>This will create a file called <code>";main(){puts("Hello World!");}char*C=".c</code> which <p>This will try to create a file whose actual filename is literally:</p>
would print <code>Hello World!</code> when compiled.</p> <pre><code>&quot;;main(){puts(&quot;Hello World!&quot;);}char*C=&quot;.c</code></pre>
<p>When that file is compiled, it will greet the world in the
traditional fashion of C.</p>
<p>For an explanation of why and how this works see the author’s remarks. The gist <p>For an explanation of why and how this works see the author’s remarks. The gist
of the entry itself, however, is the file name <em>itself <strong>is</strong> the code</em>.</p> of the entry itself, however, is the file name <em>itself</em> <strong>is</strong> <em>part of the code</em>.</p>
<p>NOTE: we delete the temporary file whether or not the compilation succeeds <p>NOTE: We delete the temporary file as part of <code>make all</code> whether
because it is an unsafe filename and not doing so would cause problems for or not the compilation succeeds. This is a Makefile <strong>feature</strong>
anyone running <code>make</code>.</p> that might <strong>bug</strong> anyone running the make command. :-)</p>
<p>This entry will not compile with gcc &lt; 2.3.3 as it relies on a bug which was <p>This entry will not compile with gcc version &gt;= 2.3.3 as it relied
fixed in gcc 2.3.3 which was fixed a very long time ago now. There is an on a bug which was later fixed in gcc 2.3.3, and that happened
alternate version for <a href="https://www.collinsdictionary.com/dictionary/english/everyone">those of <em>a long time ago</em> (.. <em>in a galaxy far, far away</em>?).</p>
us</a> with gcc &gt;= <p>If <code>make all</code> fails to compile, a suggestion of compiling and running
2.3.3. See <a href="#alternate-code">Alternate code</a> section below for more details.</p> the alternate version is printed. This alternate version is a variant
<p>However, there is an another version that will be compiled in the extremely for <a href="https://www.collinsdictionary.com/dictionary/english/everyone">those of us</a>
likely case this fails. This should happen automatically. See <a href="#alternate-code">Alternate with gcc &gt;= 2.3.3 or using clang. See <a href="#alternate-code">Alternate code</a>
code</a> below for more details on it.</p> section below for more details.</p>
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3> <h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
<p>The current status of this entry is:</p> <p>The current status of this entry is:</p>
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre> <pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
<p>For more detailed information see <a href="../../bugs.html#1993_lmfjyh">1993 lmfjyh bugs</a>.</p> <p>For more detailed information see <a href="../../bugs.html#1993_lmfjyh">1993 lmfjyh bugs</a>.</p>
<h2 id="to-use">To use:</h2> <h2 id="to-use">To use:</h2>
<p>If you have gcc &lt; 2.3.3 (i.e. the entry can compile):</p> <p>If you have gcc &lt; 2.3.3 (i.e. the entry can compile):</p>
<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">./lmfjyh</span></span></code></pre></div> <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">./lmfjyh</span></span></code></pre></div>
<h2 id="alternate-code">Alternate code:</h2> <h2 id="alternate-code">Alternate code:</h2>
<p>This version does what the code did but in a way that will work with modern <p>This version does what the code did but in a way that will work with modern
compilers. We’d like to say there’s something special about it but there isn’t. compilers. We’d like to say there’s something special about it but there isn’t.
Nonetheless it will be compiled in case the original entry fails to compile Nonetheless it will be compiled in case the original entry fails to compile.</p>
(which will happen unless you have gcc &lt; 2.3.3.</p>
<h3 id="alternate-build">Alternate build:</h3> <h3 id="alternate-build">Alternate build:</h3>
<p>Should you wish to build this version manually:</p> <p>Should you wish to build this version manually:</p>
<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="fu">make</span> alt</span></code></pre></div> <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> alt</span></code></pre></div>
<h3 id="alternate-use">Alternate use:</h3> <h3 id="alternate-use">Alternate use:</h3>
<p>Use <code>lmfjyh.alt</code> as you would <code>lmfjyh</code> above. Note that other code could also be <p>Use <code>lmfjyh.alt</code> as you would <code>lmfjyh</code> above. Note that other code could also be
done with the bug that the entry abuses but that would have to be manually done with the bug that the entry abuses but that would have to be manually
@@ -187,10 +188,10 @@ best with C-source code.</p>
<p>As an example, I have taken a simple “Hello world!” program <p>As an example, I have taken a simple “Hello world!” program
that should be familiar to all C-programmers.</p> that should be familiar to all C-programmers.</p>
<h4 id="listing-1-a-simple-hello-world-program">Listing 1: A simple “Hello World” program</h4> <h4 id="listing-1-a-simple-hello-world-program">Listing 1: A simple “Hello World” program</h4>
<div class="sourceCode" id="cb5"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>main<span class="op">()</span></span> <div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>main<span class="op">()</span></span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> <span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a> puts<span class="op">(</span><span class="st">&quot;Hello World!&quot;</span><span class="op">);</span></span> <span id="cb6-3"><a href="#cb6-3" aria-hidden="true" tabindex="-1"></a> puts<span class="op">(</span><span class="st">&quot;Hello World!&quot;</span><span class="op">);</span></span>
<span id="cb5-4"><a href="#cb5-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> <span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<h3 id="packing-method">Packing method</h3> <h3 id="packing-method">Packing method</h3>
<p>Normally a file name is used only to identify the file, but this new <p>Normally a file name is used only to identify the file, but this new
revolutionary method introduces a totally new concept: <strong>THE FILE NAME <em>IS</em> THE revolutionary method introduces a totally new concept: <strong>THE FILE NAME <em>IS</em> THE
@@ -198,9 +199,9 @@ PROGRAM</strong>. There is no need to waste valuable disk space to store source
The program is embedded in the file name, only a minor portion of it is inside The program is embedded in the file name, only a minor portion of it is inside
the file.</p> the file.</p>
<h4 id="listing-2-compressed-hello-world">Listing 2: Compressed “Hello world”</h4> <h4 id="listing-2-compressed-hello-world">Listing 2: Compressed “Hello world”</h4>
<div class="sourceCode" id="cb6"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span><span class="op">*</span>_<span class="op">=</span>__FILE__<span class="op">;</span></span></code></pre></div> <div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span><span class="op">*</span>_<span class="op">=</span>__FILE__<span class="op">;</span></span></code></pre></div>
<h4 id="listing-3-code-embedded-in-the-file-name">Listing 3: Code embedded in the file name</h4> <h4 id="listing-3-code-embedded-in-the-file-name">Listing 3: Code embedded in the file name</h4>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;;main(){puts(&quot;</span>Hello World<span class="op">!</span><span class="st">&quot;);}char*C=&quot;</span><span class="op">.</span>c</span></code></pre></div> <div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="st">&quot;;main(){puts(&quot;</span>Hello World<span class="op">!</span><span class="st">&quot;);}char*C=&quot;</span><span class="op">.</span>c</span></code></pre></div>
<p>The sample program in listing 1 is 36 bytes long. By using the new <p>The sample program in listing 1 is 36 bytes long. By using the new
compression method, the example program may be squeezed to sixteen compression method, the example program may be squeezed to sixteen
bytes. In the example the compression ratio is 2:1. It is evident bytes. In the example the compression ratio is 2:1. It is evident