Functional PostScript Poring Notes Functional PostScript Porting Notes

It should not be difficult to port FPS to another Scheme implementation. The source code is well-commented and not large. If you start with a standard R4RS Scheme implementation, you will have to handle the following issues:

R5RS features: We use R5RS multi-value return forms: VALUES, CALL-WITH-VALUES, and RECEIVE.

Scheme 48 features: You will have to port the DEFINE-RECORD macro that FPS uses to define its record types, or rewrite FPS's uses of this macro.

Dynamic variables -- FPS uses these to establish default styles.

Scsh features: FPS uses GETENV to look up the value of the $AFMPATH process environment variable. You must provide some way to implement search for AFM files.

FPS's AFM code uses a special call to open a file that doesn't raise an error if the file doesn't exist, but simply returns #F.

FPS uses scsh's regexp package and field parsers to split $AFMPATH at colons into a list of directories and to parse AFM files. You will have to rewrite this code.

Other: The function that prints Scheme numbers out in PS format for the PS-text backend may need to be re-done for your Scheme.

FPS is designed to be neutral wrt the character set provided by the underlying Scheme. However, our implementation assumes ASCII chars and some relatedJ procedures (ASCII->CHAR and CHAR->ASCII). If your Scheme is, say, implemented on top of Unicode, you'll have to redo the char-map implementation. If your Scheme is ASCII, things are easy.

The whole system isn't that big, so you should probably print the whole thing out first, read it over, and get an idea of the big picture.

If you stumble over any other portability issues, please tell us about it for inclusion in this section.

A Note on Copyright:

FPS is copyright the authors, Wandy Sae-tan and Olin Shivers. Don't worry about this too much. We advocate open use of the system and provide sources in our releases. We retain copyright mostly as a means of controlling the specific interface named by the term "FPS." We want there to be a reliable interface spec on which programmers can depend, so we are centralising control of that interface.

If you want to use FPS for a commercial system, send us email. There should be no trouble.

If you want to extend the system, and want to fold your changes back in to the shipped design, send us mail at and

FPS Home