Notes by Ed Kademan <firstname.lastname@example.org>
The March 2003 meeting of Scheme Boston took place at Northeastern University Monday night March 10, 2003. Approximately 20 people showed up to hear Dorai Sitaram give a talk about his scmxlate system for semiautomatically translating Scheme/Lisp programs from one dialect to another. (In what follows I will use phrases like "Scheme" and "Scheme dialects" for simplicity, but these are meant to include Common Lisp as well.)
The problem that scmxlate addresses arises from the fact that in practice Scheme is more like a family of languages than it is a single one. Dorai had written important programs in Scheme but found that other people had substantial problems with them because the particular versions of the language they used were different enough from his to prevent those programs from running. He remarked that there were four different options a developer could adopt in the face of this problem:
In order to use an scmxlate-enabled package all an end user has to do is start up Scheme in that package's directory, load scmxlate, and then answer a very small number of questions---such as "What is your dialect?" and "What is your operating system?" Scmxlate takes the input files written in the developer's dialect and translates them into output files written in the user's dialect. They are now ready to run.
That translation was able to proceed because of a series of files that the developer added to his package. Two general files list the dialects supported and the source files that need translating. All the other scmxlate files are known as dialect and user configuration files and are specific to the source files. That is, a source file named "apple.scm" might have a corresponding dialect configuration file named "guile-apple" and a user configuration file named "scmxlate-apple.scm." These configuration files give more detailed information on how to transform the source. (Dialect configuration files direct the main work. User configuration files contain defaults for things like global variables that the end user may want to specify and that the developer cannot be expected to know.)
For the most part the contents of the configuration files get added to the beginning of the corresponding source file. Any user configuration content comes first followed by dialect configuration content. But there exist directives that override this order. These directives accomplish a host of other chores as well such as:
Dorai said that the output the system generates is not necessarily beautiful, especially when translating to Common Lisp, and that it might be awkward to try transforming packages that are written as something other than a series of top level forms. But scmxlate is a practical tool that he has been using extensively. It is available at http://www.ccs.neu.edu/~dorai/scmxlate/scmxlate.html.