add some humor about the build process to 1993/lmfjyh
This commit is contained in:
1 parent
a5b3a9e07b
commit
57e9ffacf3
2 files changed
+46
-40
No files matched your search
+21
-16
@@ -6,25 +6,31 @@ If you have gcc < 2.3.3 you can build this entry like:
|
||||
make all
|
||||
```
|
||||
|
||||
This will create a file called `";main(){puts("Hello World!");}char*C=".c` which
|
||||
would print `Hello World!` when compiled.
|
||||
This will try to create a file whose actual filename is literally:
|
||||
|
||||
```
|
||||
";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
|
||||
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
|
||||
because it is an unsafe filename and not doing so would cause problems for
|
||||
anyone running `make`.
|
||||
NOTE: We delete the temporary file as part of `make all` whether
|
||||
or not the compilation succeeds. This is a Makefile **feature**
|
||||
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
|
||||
fixed in gcc 2.3.3 which was fixed a very long time ago now. There is an
|
||||
alternate version for [those of
|
||||
us](https://www.collinsdictionary.com/dictionary/english/everyone) with gcc >=
|
||||
2.3.3. See [Alternate code](#alternate-code) section below for more details.
|
||||
This entry will not compile with gcc version >= 2.3.3 as it relied
|
||||
on a bug which was later fixed in gcc 2.3.3, and that happened
|
||||
_a long time ago_ (.. _in a galaxy far, far away_?).
|
||||
|
||||
However, there is an another version that will be compiled in the extremely
|
||||
likely case this fails. This should happen automatically. See [Alternate
|
||||
code](#alternate-code) below for more details on it.
|
||||
If `make all` fails to compile, a suggestion of compiling and running
|
||||
the alternate version is printed. This alternate version is a variant
|
||||
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:
|
||||
@@ -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
|
||||
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
|
||||
(which will happen unless you have gcc < 2.3.3.
|
||||
Nonetheless it will be compiled in case the original entry fails to compile.
|
||||
|
||||
|
||||
### Alternate build:
|
||||
|
||||
+25
-24
@@ -142,36 +142,37 @@ Location: <a href="../../location.html#FI">FI</a> - <em>Republic of Finland </em
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<p>If you have gcc < 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>
|
||||
<p>This will create a file called <code>";main(){puts("Hello World!");}char*C=".c</code> which
|
||||
would print <code>Hello World!</code> when compiled.</p>
|
||||
<p>This will try to create a file whose actual filename is literally:</p>
|
||||
<pre><code>";main(){puts("Hello World!");}char*C=".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
|
||||
of the entry itself, however, is the file name <em>itself <strong>is</strong> the code</em>.</p>
|
||||
<p>NOTE: we delete the temporary file whether or not the compilation succeeds
|
||||
because it is an unsafe filename and not doing so would cause problems for
|
||||
anyone running <code>make</code>.</p>
|
||||
<p>This entry will not compile with gcc < 2.3.3 as it relies on a bug which was
|
||||
fixed in gcc 2.3.3 which was fixed a very long time ago now. There is an
|
||||
alternate version for <a href="https://www.collinsdictionary.com/dictionary/english/everyone">those of
|
||||
us</a> with gcc >=
|
||||
2.3.3. See <a href="#alternate-code">Alternate code</a> section below for more details.</p>
|
||||
<p>However, there is an another version that will be compiled in the extremely
|
||||
likely case this fails. This should happen automatically. See <a href="#alternate-code">Alternate
|
||||
code</a> below for more details on it.</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 as part of <code>make all</code> whether
|
||||
or not the compilation succeeds. This is a Makefile <strong>feature</strong>
|
||||
that might <strong>bug</strong> anyone running the make command. :-)</p>
|
||||
<p>This entry will not compile with gcc version >= 2.3.3 as it relied
|
||||
on a bug which was later fixed in gcc 2.3.3, and that happened
|
||||
<em>a long time ago</em> (.. <em>in a galaxy far, far away</em>?).</p>
|
||||
<p>If <code>make all</code> fails to compile, a suggestion of compiling and running
|
||||
the alternate version is printed. This alternate version is a variant
|
||||
for <a href="https://www.collinsdictionary.com/dictionary/english/everyone">those of us</a>
|
||||
with gcc >= 2.3.3 or using clang. See <a href="#alternate-code">Alternate code</a>
|
||||
section below for more details.</p>
|
||||
<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.html#1993_lmfjyh">1993 lmfjyh bugs</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<p>If you have gcc < 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>
|
||||
<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.
|
||||
Nonetheless it will be compiled in case the original entry fails to compile
|
||||
(which will happen unless you have gcc < 2.3.3.</p>
|
||||
Nonetheless it will be compiled in case the original entry fails to compile.</p>
|
||||
<h3 id="alternate-build">Alternate build:</h3>
|
||||
<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>
|
||||
<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
|
||||
@@ -187,10 +188,10 @@ best with C-source code.</p>
|
||||
<p>As an example, I have taken a simple “Hello world!” program
|
||||
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>
|
||||
<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>
|
||||
<span id="cb5-2"><a href="#cb5-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">"Hello World!"</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>
|
||||
<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="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a><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">"Hello World!"</span><span class="op">);</span></span>
|
||||
<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>
|
||||
<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
|
||||
@@ -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 file.</p>
|
||||
<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>
|
||||
<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">";main(){puts("</span>Hello World<span class="op">!</span><span class="st">");}char*C="</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">";main(){puts("</span>Hello World<span class="op">!</span><span class="st">");}char*C="</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
|
||||
compression method, the example program may be squeezed to sixteen
|
||||
bytes. In the example the compression ratio is 2:1. It is evident
|
||||
|
||||
Reference in new issue
Block a user