arcfide / chez-srfi

SRFIs for Chez Scheme
Other
94 stars 36 forks source link

Add an inline install script. #45

Closed akce closed 4 years ago

akce commented 4 years ago

install.chezscheme.sps will install (to a separate directory) scheme srfi lib files, pre-processing them so that (include/resolve ...) calls have the contents of the referenced files included inline, similar to #includes in C.

These install lib files are then compiled.

It allows Chezscheme to fully compile SRFI libraries and seems to catch more errors/warnings than with include/resolve.

File/directory names are also html-translated at the destination path.

This change adds:

akce commented 4 years ago

This change has been tested with chez-scheme on linux only.

I've just noticed in the closed pull requests, support for other schemes, so if other schemes do want this feature, i'd be happy to modify this PR so that chezscheme specific stuff is put into compatibility files.

arcfide commented 4 years ago

If this just adds features that are only available on Chez, that's fine, does it somehow break any of the existing systems for some reason? Otherwise I think it's a fine addition.

akce commented 4 years ago

Dear @arcfide,

Thanks for considering this PR, it makes a difference on my slow machines!

It doesn't add Chez specific features (unless you count full source compilation), but the install script and pre-processor lib both use Chez API functions not in R6RS.

Use of SRFIs under Chez scheme doesn't seem any different. I've eyeballed a diff of the output of the batch test script i've added (master vs this branch) and the differences there were only to do with record-type uuids and some compile warnings which might be addressed now.

But i'm not much of a user of SRFIs (yet) so i've only tested using the tests provided.

The pre-processed files should be compatible with currently supported schemes, but i can't guarantee that without installing and running them. This patch uses Chez's pretty-print to print the library forms to their destination files - I'd hope there isn't a problem so long as those scheme's support its output format.

I should also note that using this inline install is optional. In-place install with link-dirs still works.

Maybe i should add some installation notes to the main README.md file?

arcfide commented 4 years ago

The precompiled files don't have to be supported on all platforms, provided that those platforms can simply install with the more traditional method, and this is an optional feature for Chez only. I think the pretty-print in Chez Scheme is a variant of write and so it should maintain idempotence with a read, yes? If that's so, then I think this should be fine, and we can merge.