A collection of example programs in Pre-Scheme

Andrew Whatson 0b497c3567 Experiment with increasing the inlining threshold hace 1 año
lib bb2985632c Add zero-seed variant of vector-unfold hace 1 año
.envrc 1426f12be4 Improve the build system using Guix and Make hace 1 año
.gitignore 9d94360997 Add ps-vector library and a vector demo hace 1 año
COPYING febe0e7ae6 Add a license, BSD-3 just like Scheme 48 hace 1 año
Makefile 0b497c3567 Experiment with increasing the inlining threshold hace 1 año
README.org 1426f12be4 Improve the build system using Guix and Make hace 1 año
append.c 0b497c3567 Experiment with increasing the inlining threshold hace 1 año
append.scm 1f1a9239df Add another demo, more advanced packages, generated code examples hace 1 año
hello.c 1f1a9239df Add another demo, more advanced packages, generated code examples hace 1 año
hello.scm 1f1a9239df Add another demo, more advanced packages, generated code examples hace 1 año
manifest.scm 1426f12be4 Improve the build system using Guix and Make hace 1 año
packages.scm f4a20db117 Export string-append to prevent inlining hace 1 año
vecfun.c 0b497c3567 Experiment with increasing the inlining threshold hace 1 año
vecfun.scm 1426f12be4 Improve the build system using Guix and Make hace 1 año

README.org

Pre-Scheme Demo Code

This repository contains some basic examples of Pre-Scheme code, and a simple Makefile for compiling these into native executables.

These examples are based on the one provided in "The Nearly Complete Scheme48 PreScheme Reference Manual" by Taylor Campbell: https://groups.scheme.org/prescheme/1.3/

Source files

  • packages.scm - package definitions
  • lib/ps-string.scm - string utility functions
  • lib/ps-vector.scm - vector functions based on SRFI-43
  • hello.scm - "Hello World" in Pre-Scheme, from the manual
  • append.scm - Yes, you can string-append in Pre-Scheme
  • vecfun.scm - Showing off Pre-Scheme polymorphism with vectors

The generated C for each of the demo programs is also included, so you can review the code generation without needing to build anything.

How to build

The Guix manifest sets up all prerequisites for building the demos, and compilation is handled by the Makefile.

To build the demos yourself:


git clone https://gitlab.com/flatwhatson/prescheme-demo.git
cd prescheme-demo
guix shell -m manifest.scm
make

License

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