purescm v1.12.0
purescm - Chez Scheme backend for PureScript
Installation
Install requisites:
chezscheme- you should have theschemecommand available in your$PATH.libpcre2-purescmhas a runtime dependency on the 16-bit variant of pcre2. Check your package manager forpcre2orpcre2-16or similar.icu-libicuis used for locale-aware case conversions.
You can install purescm with npm:
npm i --global purescmUsage
The best way to use purescm is to use the spago integration for alternative PureScript backends. In spago.yaml use the backend config like so:
workspace:
backend:
cmd: purescm
args:
- "build"Then to compile your purescm project you can run:
spago buildThis will produce output under output/. You can run the compiled program with:
purescm runBundling
Scheme files can be precompiled to a single Chez program:
purescm bundle-appwhich generates a single file output/main which can be run with scheme or petite:
scheme --program output/mainDevelopment
Running the tests
To run all tests, run npm run test. This will run both the scheme runtime unit tests and the snapshot tests.
To overwrite old snapshots with the latest output, run npm run test -- -a "--accept".
To add a new snapshot, create a file called Snapshot.X.purs where X indicates what is being tested.
If a snapshot needs a dependency, install it by running cd test-snapshots && spago install <packages...>.
Vendored Dependencies
In order to represent Array and record types in purescm, the backend has a runtime dependency on implementation of SRFI 214 (Flexvectors). This is due in part to how vectors are more like "arrays" than "array lists".
We vendor chez-srfi using the following steps:
Clone
chez-srfiat the project root.Navigate to
chez-srfiand run./install.chezscheme.sps ../lib.To verify, simply invoke the Scheme REPL:
$ scheme --libdirs ./lib:
Chez Scheme Version 9.5.8
Copyright 1984-2022 Cisco Systems, Inc.
> (import (srfi :125))
>10 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago