Created `quick-start.md` to hold the FAQ 0.0 content. Used `sgit(1)` to change: * faq.html#enter ==> quick-start.html#enter * faq.html#enter_questions ==> quick-start.html#enter_questions * faq.html#step_0 ==> quick-start.html#step_0 * faq.html#step_1 ==> quick-start.html#step_1 * faq.html#step_2 ==> quick-start.html#step_2 * faq.html#register ==> quick-start.html#register * faq.html#step_3 ==> quick-start.html#step_3 * faq.html#step_4 ==> quick-start.html#step_4 * faq.html#step_5 ==> quick-start.html#step_5 * faq.html#step_6 ==> quick-start.html#step_6 * faq.html#step_7 ==> quick-start.html#step_7 * faq.html#step_submit ==> quick-start.html#step_submit Via: ```sh sgit -e 's/faq\.html#enter/quick-start.html#enter/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#enter_questions/quick-start.html#enter_questions/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_0/quick-start.html#step_0/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_1/quick-start.html#step_1/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_2/quick-start.html#step_2/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#register/quick-start.html#register/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_3/quick-start.html#step_3/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_4/quick-start.html#step_4/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_5/quick-start.html#step_5/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_6/quick-start.html#step_6/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_7/quick-start.html#step_7/g' '*.md' '*.hdr' 'inc/*.html' sgit -e 's/faq\.html#step_submit/quick-start.html#step_submit/g' '*.md' '*.hdr' 'inc/*.html' ``` The former FAQ 0.0 section in `faq.html` now just refers to `quick-start.html`. Modified menu and non-JS menu so that "Enter the IOCCC" refers to `quick-start.html`. Changed `bin/gen-top-html.sh` VERSION from "1.4.10 2024-11-23" to "1.4.11 2025-01-09". Performed `make www` on macOS to complete the above.
749 lines
32 KiB
HTML
749 lines
32 KiB
HTML
<!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 -->
|
||
|
||
<!-- END: this line ends content from: inc/top.default.html -->
|
||
<!-- START: this line starts content from: inc/head.default.html -->
|
||
|
||
<head>
|
||
<link rel="stylesheet" href="../../ioccc.css">
|
||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap" rel="stylesheet">
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<title>1992/buzzard.2 - Best language tool</title>
|
||
<link rel="icon" type="image/x-icon" href="../../favicon.ico">
|
||
<meta name="description" content="1992 IOCCC entry buzzard.2 - Best language tool">
|
||
<meta name="keywords" content="IOCCC, 1992, IOCCC 1992, IOCCC entry, buzzard.2, Best language tool">
|
||
</head>
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- END: this line ends content from: inc/head.default.html -->
|
||
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- The content of main section of this web page came from: 1992/buzzard.2/README.md -->
|
||
<!-- -->
|
||
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 1992/buzzard.2/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 1992/buzzard.2/README.md !!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 1992/buzzard.2/README.md !!! -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
|
||
<!-- Markdown content was converted into HTML via the tool: bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content from: inc/body.default.html -->
|
||
|
||
<body>
|
||
|
||
<!-- END: this line ends content from: inc/body.default.html -->
|
||
<!-- START: this line starts content from: inc/topbar.default.html -->
|
||
|
||
<div class="theader">
|
||
<nav class="topbar">
|
||
<div class="container">
|
||
<div class="logo">
|
||
<a href="../../index.html" class="logo-link">
|
||
IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="topbar-items">
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Entries
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../years.html" class="sub-item-link">
|
||
Winning entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../authors.html" class="sub-item-link">
|
||
Winning authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../location.html" class="sub-item-link">
|
||
Location of authors
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../bugs.html" class="sub-item-link">
|
||
Bugs and (mis)features
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_an_entry" class="sub-item-link">
|
||
Fixing entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#fix_author" class="sub-item-link">
|
||
Updating author info
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
Status
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../news.html" class="sub-item-link">
|
||
News
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../status.html" class="sub-item-link">
|
||
Contest status
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../next/index.html" class="sub-item-link">
|
||
Rules and guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../markdown.html" class="sub-item-link">
|
||
Markdown guidelines
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../SECURITY.html" class="sub-item-link">
|
||
Security policy
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
FAQ
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html" class="sub-item-link">
|
||
Frequently Asked Questions
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../quick-start.html#enter" class="sub-item-link">
|
||
Enter the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#compiling" class="sub-item-link">
|
||
Compiling entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#running_entries" class="sub-item-link">
|
||
Running entries
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../faq.html#help" class="sub-item-link">
|
||
How to help
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="item">
|
||
<span class="item-header">
|
||
About
|
||
</span>
|
||
|
||
<div class="sub-item">
|
||
<div class="outfit-font">
|
||
<a href="../../index.html" class="sub-item-link">
|
||
Home page
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../about.html" class="sub-item-link">
|
||
About the IOCCC
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../judges.html" class="sub-item-link">
|
||
The Judges
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../thanks-for-help.html" class="sub-item-link">
|
||
Thanks for the help
|
||
</a>
|
||
</div>
|
||
|
||
<div class="outfit-font">
|
||
<a href="../../contact.html" class="sub-item-link">
|
||
Contact us
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<div class="header-mobile-menu">
|
||
<noscript>
|
||
<a href="../../nojs-menu.html" class="topbar-js-label">
|
||
Please Enable JavaScript
|
||
</a>
|
||
</noscript>
|
||
|
||
<button id="header-open-menu-button" class="topbar-mobile-menu">
|
||
<img
|
||
src="../../png/hamburger-icon-open.png"
|
||
alt="hamburger style menu icon - open state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<button id="header-close-menu-button" class="hide-content">
|
||
<img
|
||
src="../../png/hamburger-icon-closed.png"
|
||
alt="hamburger style menu icon - closed state"
|
||
width=48
|
||
height=48>
|
||
</button>
|
||
|
||
<div id="mobile-menu-panel" class="hide-content">
|
||
<div class="mobile-menu-container">
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
Entries
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../years.html">
|
||
Winning entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../authors.html">
|
||
Winning authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../location.html">
|
||
Location of authors
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../bugs.html">
|
||
Bugs and (mis)features
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_an_entry">
|
||
Fixing entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#fix_author">
|
||
Updating author info
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../thanks-for-help.html">
|
||
Thanks for the help
|
||
</a>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
|
||
<div class="mobile-menu-item">
|
||
Status
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../news.html">
|
||
News
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../status.html">
|
||
Contest status
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../next/index.html">
|
||
Rules and guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../markdown.html">
|
||
Markdown guidelines
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../SECURITY.html">
|
||
Security policy
|
||
</a>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
FAQ
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html">
|
||
Frequently Asked Questions
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../quick-start.html#enter">
|
||
Enter the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#compiling">
|
||
Compiling entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#running_entries">
|
||
Running entries
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../faq.html#help">
|
||
How to help
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="mobile-menu-wrapper">
|
||
<div class="mobile-menu-item">
|
||
About
|
||
</div>
|
||
<div class="mobile-submenu-wrapper">
|
||
|
||
<a class="mobile-submenu-item" href="../../index.html">
|
||
Home page
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../about.html">
|
||
About the IOCCC
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../judges.html">
|
||
The Judges
|
||
</a>
|
||
|
||
<a class="mobile-submenu-item" href="../../contact.html">
|
||
Contact us
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var headerOpenMenuButton = document.getElementById("header-open-menu-button");
|
||
var headerCloseMenuButton = document.getElementById("header-close-menu-button");
|
||
var mobileMenuPanel = document.getElementById("mobile-menu-panel");
|
||
|
||
headerOpenMenuButton.addEventListener("click", () => {
|
||
headerOpenMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.add("hide-content");
|
||
|
||
headerCloseMenuButton.classList.remove("hide-content");
|
||
headerCloseMenuButton.classList.add("topbar-mobile-menu");
|
||
|
||
mobileMenuPanel.classList.remove("hide-content");
|
||
mobileMenuPanel.classList.add("topbar-mobile-panel");
|
||
});
|
||
|
||
headerCloseMenuButton.addEventListener("click", () => {
|
||
headerCloseMenuButton.classList.remove("topbar-mobile-menu");
|
||
headerCloseMenuButton.classList.add("hide-content");
|
||
|
||
mobileMenuPanel.classList.add("hide-content");
|
||
mobileMenuPanel.classList.remove("topbar-mobile-panel");
|
||
|
||
headerOpenMenuButton.classList.add("topbar-mobile-menu");
|
||
headerOpenMenuButton.classList.remove("hide-content");
|
||
});
|
||
</script>
|
||
|
||
<!-- END: this line ends content from: inc/topbar.default.html -->
|
||
<!-- START: this line starts content from: inc/header.default.html -->
|
||
|
||
<div class="header">
|
||
<a href="../../2011/zucker/index.html">
|
||
<img src="../../png/ioccc.png"
|
||
alt="IOCCC image by Matt Zucker"
|
||
width=300
|
||
height=110>
|
||
</a>
|
||
<h1>The International Obfuscated C Code Contest</h1>
|
||
<h2>1992/buzzard.2 - Best language tool</h2>
|
||
<h3>forth-like stack machine</h3>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/navbar.mid.html -->
|
||
|
||
<div class="navbar">
|
||
<a class="Left" href="../buzzard.1/index.html">← 1992/buzzard.1</a>
|
||
<a class="Left" href="../index.html">↑ 1992 ↑</a>
|
||
<a class="Left" href="../gson/index.html">1992/gson →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
<a class="Right" href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F1992%2Fbuzzard.2%2Findex.html">✓</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/navbar.mid.html -->
|
||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||
|
||
<div class="content" id="content">
|
||
|
||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||
<!-- START: this line starts content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="author">Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#Sean_Barrett">Sean Barrett</a><br>
|
||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)</li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||
|
||
<!-- BEFORE: 1st line of markdown file: 1992/buzzard.2/README.md -->
|
||
<h2 id="to-build">To build:</h2>
|
||
<pre><code> make all</code></pre>
|
||
<p>There is an alternate version of this program. See <a href="#alternate-code">Alternate
|
||
code</a> below for details.</p>
|
||
<h2 id="to-use">To use:</h2>
|
||
<p><strong>First</strong>, you must make sure that <code>first</code> is made <strong>first</strong> (even though <code>make all</code>
|
||
should make <strong>first <em>first</em></strong> :-) ):</p>
|
||
<pre><code> make first</code></pre>
|
||
<p><strong>Second</strong>:</p>
|
||
<pre><code> # get help:
|
||
echo help | cat third help.th - | ./first
|
||
|
||
# try out a demo:
|
||
cat third demo5.th | ./first</code></pre>
|
||
<p><strong>Third</strong>:</p>
|
||
<pre><code> cat third help.th - | ./first</code></pre>
|
||
<p><strong>NOTE</strong>: Wait until <code>Ok</code> is printed and the type:</p>
|
||
<pre><code> 2 3 + . cr</code></pre>
|
||
<p>Yes you should really type the 2 letters: <code>cr</code>.</p>
|
||
<p><strong>Fourth</strong>:</p>
|
||
<pre><code> Sorry, this is third!</code></pre>
|
||
<h2 id="try">Try:</h2>
|
||
<pre><code> ./try.sh</code></pre>
|
||
<h2 id="alternate-code">Alternate code:</h2>
|
||
<p>This alternate version, <a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.alt.c">buzzard.2.alt.c</a>, does not contain a
|
||
fix that the author notes in their remarks.</p>
|
||
<h3 id="alternate-build">Alternate build:</h3>
|
||
<pre><code> make alt</code></pre>
|
||
<h3 id="alternate-use">Alternate use:</h3>
|
||
<p>Use <code>buzzard.2.alt</code> as you would <code>buzzard.2</code> above.</p>
|
||
<h3 id="alternate-try">Alternate try:</h3>
|
||
<pre><code> ./try.alt.sh</code></pre>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>Have fun!</p>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="what-it-does">What it does</h3>
|
||
<p><code>first</code> implements a relatively primitive stack machine. How
|
||
primitive? It supplies 13 visible primitives: 3 arithmetic,
|
||
1 comparison, 2 memory-access, 2 character I/O, 3 primitives
|
||
for defining new words, 1 tokenizing, and 1 special stack
|
||
operation. (There are also three internal operations for
|
||
the stack machine: ‘push this integer’, ‘call this code’,
|
||
and ‘compile a call to this code’.)</p>
|
||
<p>It is very difficult to accomplish anything with this set
|
||
of primitives, but they do have an interesting property.</p>
|
||
<p>This–what this interesting property is, or in other words
|
||
what first is good for–is the major obfuscation; there are
|
||
also minor source obfuscations, as well as some design tricks
|
||
that are effectively obfuscations. Details on the obfuscations
|
||
are below, and the interesting property is discussed much
|
||
further down.</p>
|
||
<h3 id="how-to-run-it">How to run it</h3>
|
||
<p><code>first</code> expects you to first enter the names of the 13 primitives,
|
||
separated by whitespace–it doesn’t care what you name them, but
|
||
if all the names aren’t unique, you won’t be able to use some of
|
||
them. After this you may type any sequence of valid <code>first</code> input.
|
||
Valid <code>first</code> input is defined as any sequence of whitespace-delimited
|
||
tokens which consist of primitives, new words you’ve defined, and
|
||
integers (as parsed by <code>"%d"</code>). Invalid input behaves unpredictably,
|
||
but gives no warning messages. A sample program, <code>demo1.1st</code>, is
|
||
included, but it only works on ASCII systems.</p>
|
||
<p>Do not expect to be able to do anything interesting with <code>first</code>.</p>
|
||
<p>To do something interesting, you need to feed <code>first</code> the file
|
||
<a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/third">third</a> first. In unix, you can do</p>
|
||
<pre><code> cat third help.th - | ./first</code></pre>
|
||
<p>to do this. Hopefully most operating systems will provide a way to do this. It
|
||
may take some time for this to complete (I seem to remember it taking several
|
||
minutes on an 8086 PC); <code>THIRD</code> will prompt you when it is finished. The file
|
||
<a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/third">third</a> has not been obfuscated, due to sheer kindness on the author’s
|
||
part.</p>
|
||
<p>For more information on what you can do once you’ve piped <a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/third">third</a> into
|
||
first, type <code>help</code> and consult
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a> manuals for
|
||
further reference. Six sample THIRD programs are included in the files
|
||
<code>demo1.th</code> through <code>demo6.th</code>. See <a href="buzzard.2.README.html">buzzard.2.README.html</a>
|
||
for more information.</p>
|
||
<p>Keep in mind that you are still running <code>first</code>, and are for the most part
|
||
limited by <code>first</code>’s tokenizer (notably, unknown words will attempt to be parsed
|
||
as integers.) It is possible to build a new parser that parses by hand, reading
|
||
a single character at a time; however, such a parser cannot easily use the
|
||
existing dictionary, and so would have to implement its own, thus requiring
|
||
reimplementing all of <code>first</code> and <code>third</code> a second time–I did not care to
|
||
tackle this project.</p>
|
||
<h3 id="compiling">Compiling</h3>
|
||
<p><code>first</code> is reasonably portable. You may need to adjust the size of the buffers
|
||
on smaller machines; <code>m[]</code> needs to be at least 2000 long, though.</p>
|
||
<p>I say <code>first</code> is portable mainly because it uses native types. Unlike
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a>, which
|
||
traditionally allows byte and multi-byte operations, all operations are
|
||
performed on C <code>int</code>s. That means <code>first</code> code is only as portable as the same
|
||
code would be in C. As in C, the result of dividing <code>-1</code> by <code>2</code> is machine (or
|
||
rather compiler) dependent.</p>
|
||
<h3 id="how-is-first-obfuscated">How is first obfuscated?</h3>
|
||
<p><code>first</code> is obfuscated in several ways. Some minor obfuscations like
|
||
<code>&w[&m[1]][s]</code> for <code>s+m[w+1]</code> were in the original source but are no longer
|
||
because, apparently, ANSI doesn’t allow it (<code>gcc -ansi -pedantic</code> doesn’t mind
|
||
it, though.)</p>
|
||
<p>Other related obfuscations are still present. The top of the stack is cached in
|
||
a variable, which increases performance massively if the compiler can figure out
|
||
to keep it in a register; it also obfuscates the code. (Unfortunately, the top
|
||
of stack is a global variable and neither gcc nor most bundled compilers seem to
|
||
<code>register</code> allocate it.)</p>
|
||
<p>More significant are the design obfuscations. <code>m[0]</code> is the “dictionary
|
||
pointer”, used when compiling words, and <code>m[1]</code> is the return stack index. Both
|
||
are used as integer offsets into <code>m</code>. Both are kept in <code>m</code>, instead of as
|
||
separate pointers, because they are then accessible to <code>first</code> programs, which
|
||
is a crucial property of <code>first</code>. Similarly the way words are stored in the
|
||
dictionary is not obvious, so it can be difficult to follow exactly what the
|
||
compiler words are doing.</p>
|
||
<p>Assuming you’ve waded through all that, you still have to penetrate the most
|
||
significant obfuscation. Traditionally, the question is whether a reader can
|
||
answer the question “what will this do when I run it”. A reader who has
|
||
deciphered <code>first</code> to this point may think they know the answer to this
|
||
question, but they may not know the answer to the more important question, “what
|
||
will this program do when given the right input?”
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a> aficionados,
|
||
and especially FORTH implementers, may recognize the similarity of the internal
|
||
compiler format to many FORTH internal representations, and, being aware that
|
||
FORTH interpreters can often be self-compiling, may be suspicious that this
|
||
program can compile FORTH, or a significant subset of it, or at least be capable
|
||
of doing so if fed the right input. Of course, the name “THIRD” should be a
|
||
dead giveaway, if the name “first” wasn’t. (These numbers were largely chosen
|
||
because they were five letters long, like “FORTH”, and would not require
|
||
truncation to five letters, which would be a dead giveaway. Besides, THIRD
|
||
represents a step backwards, in more ways than one.)</p>
|
||
<h3 id="what-exactly-is-first-then">What exactly is <code>first</code>, then?</h3>
|
||
<p><code>first</code> is a tiny interpreter which implements a sufficient pseudo-subset of
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a> to allow it
|
||
to bootstrap a relatively complete version of FORTH (based loosely on forth79),
|
||
which I call THIRD. Complete relative to what, I’m not sure.</p>
|
||
<p>I believe <code>first</code> is close to the smallest amount of code possible to get this
|
||
effect <em>using forth-style primitives</em>, and still have some efficiency (it is
|
||
possible to get by without multiplication if you have addition, obviously). In
|
||
the design file, design, I give a justification for why each primitive in
|
||
<code>first</code> was included.</p>
|
||
<p>THIRD is sorta slow, because <code>first</code> has so few primitives that many things that
|
||
are primitives in
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a> (like swap)
|
||
take a significant amount of time in THIRD.</p>
|
||
<p>When you get the <code>Ok.</code> message from <code>third</code>, try out some sample
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a> code
|
||
(<code>first</code> has no way of knowing if keyboard input is waiting, so it can’t actually prompt
|
||
you in a normal way. It only prints <code>'Ok.'</code> after you define a word).</p>
|
||
<pre><code> 2 3 + . cr</code></pre>
|
||
<p>(which adds 2 and 3, and print the result and a newline.)</p>
|
||
<p>THIRD responds:</p>
|
||
<pre><code> 5</code></pre>
|
||
<p>Now try:</p>
|
||
<pre><code> : test 11 1 do i . loop cr ;
|
||
test</code></pre>
|
||
<p>and THIRD responds</p>
|
||
<pre><code> 1 2 3 4 5 6 7 8 9 10</code></pre>
|
||
<p>When in <code>THIRD</code>, you can see how much space you’re currently
|
||
using by typing:</p>
|
||
<pre><code> here .</code></pre>
|
||
<p>The number THIRD replies with is the number of machine words (<code>int</code>s) that the
|
||
dictionary (the first code) takes up, plus the 512 <code>int</code>s for the return stack.
|
||
If you compile the basic THIRD system without the help word (strings take up one
|
||
<code>int</code> per character in the string!), you should find that you’re using around
|
||
1000 <code>int</code>s (plus the return stack).</p>
|
||
<p>Thus THIRD gives you a relatively complete
|
||
<a href="https://en.wikipedia.org/wiki/Forth_(programming_language)">FORTH</a> system in
|
||
less than 700 chars of C source + about 1000 <code>int</code>s of memory–and it’s portable
|
||
too (you could copy over the THIRD memory dump to another machine, in theory).
|
||
If the above numbers seem to you to be mixing apples and oranges (C source and
|
||
compiled THIRD code), note that you should in theory be able to stick the
|
||
compiled THIRD code into the C source.</p>
|
||
<p>Software Construction Company gets credit for rekindling my interest in FORTH
|
||
and thus indirectly inspiring me to write this program.</p>
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
<!-- AFTER: last line of markdown file: 1992/buzzard.2/README.md -->
|
||
|
||
<!-- 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 -->
|
||
|
||
<div id="inventory">
|
||
<h1 id="inventory-for-1992buzzard.2">Inventory for 1992/buzzard.2</h1>
|
||
</div>
|
||
<h2 id="primary-files">Primary files</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.c">buzzard.2.c</a> - entry source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.alt.c">buzzard.2.alt.c</a> - alternate source code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.orig.c">buzzard.2.orig.c</a> - original source code</li>
|
||
<li><a href="buzzard.2.README.html">buzzard.2.README.html</a> - author’s description of files</li>
|
||
<li><a href="buzzard.2.design.html">buzzard.2.design.html</a> - about the FORTH language</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/try.alt.sh">try.alt.sh</a> - script to try alternate code</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/try.sh">try.sh</a> - script to try entry</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo1.1st">demo1.1st</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo1.th">demo1.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo2.th">demo2.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo3.th">demo3.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo4.th">demo4.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo5.th">demo5.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/demo6.th">demo6.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/help.th">help.th</a> - demo FORTH source</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/third">third</a> - the third source</li>
|
||
</ul>
|
||
<h2 id="secondary-files">Secondary files</h2>
|
||
<ul>
|
||
<li><a href="1992_buzzard.2.tar.bz2">1992_buzzard.2.tar.bz2</a> - download entry tarball</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/README.md">README.md</a> - markdown source for this web page</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.README.md">buzzard.2.README.md</a> - markdown source for buzzard.2.README.html</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/buzzard.2.design.md">buzzard.2.design.md</a> - markdown source for buzzard.2.design.html</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/.entry.json">.entry.json</a> - entry summary and manifest in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
|
||
<li><a href="https://github.com/ioccc-src/winner/blob/master/1992/buzzard.2/.path">.path</a> - directory path from top level directory</li>
|
||
<li><a href="index.html">index.html</a> - this web page</li>
|
||
</ul>
|
||
<hr style="width:10%;text-align:left;margin-left:0">
|
||
<h4>
|
||
Jump to: <a href="#">top</a>
|
||
</h4>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
|
||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||
<!-- START: this line starts content from: inc/footer.inventory.html -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
|
||
<div id="copyright"><h3>Copyright © 1984-2024 by Landon Curt Noll:
|
||
<a href="https://creativecommons.org/faq/#what-does-some-rights-reserved-mean"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">Some Rights Reserved</a></h3>
|
||
<p>
|
||
This work is <b>licensed by Landon Curt Noll</b> under
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1"
|
||
target="_blank"
|
||
rel="license noopener noreferrer"
|
||
style="display:inline-block;">CC BY-SA 4.0</a></b>.
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/cc.png"
|
||
alt="cc inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/by.png"
|
||
alt="person inside circle symbol">
|
||
<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
|
||
src="../../png/sa.png"
|
||
alt="arrow looping back on itself inside circle symbol"><br>
|
||
You should <b>carefully review</b> the
|
||
<b><a href="https://creativecommons.org/licenses/by-sa/4.0/legalcode.en"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">CC BY-SA 4.0 LEGAL CODE</a></b>
|
||
before using the licensed material.<br>
|
||
You may wish to review the
|
||
<b><a href="../../license.html"
|
||
target="_blank"
|
||
rel="license noopener noreferrer">highlights of some of the key features and terms</a></b>
|
||
of <b>CC BY-SA 4.0</b>.<br>
|
||
</p>
|
||
</div>
|
||
|
||
<div id="coda"><h3>Coda</h3>
|
||
<p>
|
||
<a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.ioccc.org%2F1992%2Fbuzzard.2%2Findex.html" rel="nofollow">Nu HTML check this web page</a><br>
|
||
<a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a><br>
|
||
</p>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/footer.inventory.html -->
|
||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||
|
||
</body>
|
||
</html>
|
||
|
||
<!-- END: this line ends content from: inc/bottom.default.html -->
|