3
3
Fork
You've already forked ps-workbench
0
Tools for hacking on the Pre-Scheme compiler
  • Scheme 97.5%
  • Shell 1.9%
  • Emacs Lisp 0.6%
2024年11月11日 16:37:18 +10:00
bin Update to use s48-r7rs autotools build 2024年11月11日 16:37:18 +10:00
elisp Add scsh-mode for Emacs 2024年07月16日 10:39:39 +10:00
guix Update to use s48-r7rs autotools build 2024年11月11日 16:37:18 +10:00
patches Add a patch and package to fix char comparisons 2024年10月16日 20:58:53 +10:00
prescheme @701e61e922 Update prescheme, s48-r7rs, scheme48 to latest 2024年10月01日 17:09:47 +10:00
s48-r7rs @4745f327d8 Update to use s48-r7rs autotools build 2024年11月11日 16:37:18 +10:00
scheme-index @34357b96d8 Update scheme-index for fixed srfi-128 data 2024年10月16日 14:44:23 +10:00
scheme48 @424c22c5ca Update to use s48-r7rs autotools build 2024年11月11日 16:37:18 +10:00
scripts Prevent generating empty include clause 2024年09月11日 16:35:24 +10:00
scsh-lib Move srfi-69 implementation to s48-r7rs 2024年10月16日 15:06:57 +10:00
share Update completions to use r7rs-small 2024年08月13日 16:38:25 +10:00
unsyntax @144772eeef Add unsyntax submodule to the workspace 2024年10月01日 17:33:13 +10:00
.envrc Update to use s48-r7rs autotools build 2024年11月11日 16:37:18 +10:00
.gitmodules Add unsyntax submodule to the workspace 2024年10月01日 17:33:13 +10:00
COPYING Add READMEs and COPYING 2024年07月05日 16:44:54 +10:00
manifest.scm Update to use s48-r7rs autotools build 2024年11月11日 16:37:18 +10:00
README.md Replace r7rs-packages with s48-r7rs submodule 2024年08月13日 15:47:04 +10:00

Pre-Scheme Workbench

This repository provides a workspace and tools for hacking on the Pre-Scheme compiler codebase as part of the Pre-Scheme Restoration project. It consists of the following:

  • manifest.scm: A guix manifest which sets up the necessary external tools, including applying patches to some of those.
  • .envrc: A direnv script which prepares the shell environment; applying the guix manifest, adding local tools to PATH, and setting useful variables like PRESCHEME_DIR.
  • bin/run-scsh: A shell wrapper for scsh which pre-loads the scsh library described below, and uses rlwrap to provide a convenient command-line experience with history and tab-completion.
  • scsh-lib/: A set of scsh modules providing a variety of useful functionality for this project, including reflection tools for digging through Scheme 48 modules and the Pre-Scheme compiler codebase.
  • scripts/: A collection of scripts for performing various tasks related to this project, such as generating dependency graphs & library definitions for the Pre-Scheme compiler.
  • patches/: A set of patches for external tools which are necessary for the correct functioning of this repository, automatically applied by the guix manifest.
  • elisp/: Useful Emacs extensions for working with this repository, currently just scsh-mode which fixes highlighting issues when working with Scsh.
  • share/: Shared data files, currently used for identifier completion lists.
  • prescheme/: A git submodule containing a checkout of the Pre-Scheme compiler codebase, which is assumed to be the target of the various scripts and utilities.
  • scheme-index/: A git submodule containing a checkout of the Scheme Index codebase, which contains R5/6/7RS and SRFI procedure metadata.
  • scheme48/: A git submodule containing a checkout of the Scheme 48 source code, which contains the Pre-Scheme implementation of the Scheme 48 virtual machine and garbage collectors.
  • s48-r7rs/: A git submodule containing a checkout of the Scheme 48 R7RS compatibility library, which can be used to load the R7RS port of the Pre-Scheme compiler into Scheme 48.

Additional READMEs can be found in the subdirectories, providing more detailed descriptions of their contents.

Using Scsh in (current-year)

The choice of scsh as the platform for these tools might seem anachronistic; these days pragmatic Schemers tend to use one of the many other excellent Scheme implementations. For the purposes of this project, scsh offers a "killer feature": the ability to load and run the Pre-Scheme compiler in its original form. This enables introspection of the codebase which is essential for taking a systematic approach to the porting effort.

The run-scsh wrapper is the main way to work with these tools. When run from a terminal, it loads a REPL with an extended scsh environment and access to the utility libraries. During development, scripts can be loaded into the REPL with ,load path/to/script.scm which will make all procedures (including main) available for interactive use.

If you're using Emacs, you might notice that some Scsh scripts are incorrectly highlighted when using the | operator, due to an incompatibility with R7RS identifier literal syntax. The provided scsh-mode uses a modified syntax table which fixes this issue.

Using Guix (or not)

This repository relies on guix to set up the requisite development environment, including patched versions of scheme48 and scsh. It should be possible to reproduce this environment by applying patches and building dependencies manually, but that use-case is not currently supported.

Copying

This code is licensed under BSD-3-Clause, the same as Scheme 48, Scsh, and the Pre-Scheme compiler. See COPYING for details.