Beastie design notes
====================

Beastie is implemented in [s7 Scheme][s7].  This is a single-file
Scheme implementation, distributed as part of Beastie.  s7 is
primarily intended as an extension language, but it's also happy to be
essentially the main program, and that's how I'm using it here.

All the logic after this is implemented in Scheme, with the help of
some lex/yacc based parsers for various input types.  That said, the
author-name and `.bib` parsers are implemented in the parser-generator
framework implemented in `klipspringer.scm`.

There are a number of built-in modules which can be loaded
with `(module 'foo)`; these generally correspond to the same-named
`.scm` files in the distribution.

The C main program loads `runtime.scm`, and invokes the `main`
procedure there.

The main program branches based on the type of input expected, based
on either file extensions in the command-line arguments, or the value
of the `-I` command-line option.  If the program has been given an
`.aux` file, then it acts like BibTeX: it reads the `.aux` file,
finds the corresponding `.bib` and `.bst` files, and runs the `.bst`
program in the same way that BibTeX does.  The `.bst` language is
implemented in `(module 'bst)`.


[s7]: https://ccrma.stanford.edu/software/s7/

----
SPDX-FileCopyrightText: 2026 Norman Gray <https://nxg.me.uk>
SPDX-License-Identifier: BSD-2-Clause
