@@ -1,17 +1,33 @@
1−# purs-backend-chez
1+# purescm - Chez Scheme backend for PureScript
2+
3+## Installation
4+
5+```
6+npm i --global purescm@next
7+```
28
39## Usage
410
5−To compile PureScript corefn files to scheme:
11+The best way to use `purescm` is to use the [spago](https://github.com/purescript/spago) integration for alternative PureScript backends. In `spago.yaml` use the `backend` config like so:
12+
13+```
14+workspace:
15+ backend:
16+ cmd: purescm
17+ args:
18+ - "build"
19+```
20+
21+Then to compile your `purescm` project you can run:
622
723```
8−purs-backend-chez build
24+spago build
925```
1026
1127This will produce output under `output/`. You can then further precompile the scheme files to a single Chez program:
1228
1329```
14−purs-backend-chez bundle-app --main Main
30+purescm bundle-app --main Main
1531```
1632
1733which generates a single file `output/main`. To run the compiled program:
@@ -52,4 +68,4 @@ Copyright 1984-2022 Cisco Systems, Inc.
5268To run snapshots, run `npm run test`.
5369To overwrite old snapshots with the latest output, run `npm run test -- -a "--accept"`.
5470To add a new snapshot, create a file called `Snapshot.X.purs` where `X` indicates what is being tested.
55−If a snapshot needs a dependency, install it by running `spago -x test-snapshots/spago.dhall install <packages...>`. The snapshots have their own `spago.dhall` file so as not to pollute the `purs-backend-chez` binary with unneeded dependencies.
71+If a snapshot needs a dependency, install it by running `spago -x test-snapshots/spago.dhall install <packages...>`. The snapshots have their own `spago.dhall` file so as not to pollute the `purescm` binary with unneeded dependencies.