recursive Scheme shield http://people.csail.mit.edu/jaffer/Work/SCM-vs-C

SCM versus C


Periodically, a manager will mandate that I perform my work using some particular language or technique (buzzword). I usually comply by writing (adapting) a translator from SCM to that language (see schlep and SIMSYNCH:).

My high productivity and the quality of my work should be justification enough for whichever methods I adopt. But for those interested in the reasons, here is a typical email on the subject.


Date: Tue, 13 Jul 1999
From: Aubrey Jaffer
Subject: Let a thousand flowers bloom [was Re: Some technical background ...]
   Sent:	12 July, 1999
   From:	...

   Now for C++ as opposed to C:

   Engineering arguments:

	- C++ is a safer language, more and stricter error checking,
	  better language definitions.
I have designed hardware and software for 20 years. I frequently make off-by-one and polarity errors in both types of work and always have. About 10 years ago I realized that C was severely limiting my ability to program and succeed.

I switched to a programming environment which provides bounds checking and distinct not-to-be-mistaken-for-numbers truth values. Each datum in Scheme has an explicit type which the SCM implementation checks for nearly every operation. Error messages and warnings are usually informative; mysterious SIGSEGVs are avoided.

Standard C++ provides neither bounds checking nor distinct logic values. For me, it is no improvement over C; and C is clearly inadequate.

	- C++ is a language better suited for large scale software
	  development, it allows defining better APIs, better
	  interfaces, more encapsulation than C.
Saying that C++ is better than C merely justifies one poor choice over another. Scheme is superior to C and C++ in each of these categories.
	- C++ allows the use of the Standard Template Library, which
	  is a huge collection of tested and debugged algorithms and
	  data structures.
Looking for 'Standard Template Library' I found STL Algorithm Datasheets, which pales in comparison to the breadth and depth of the Scheme library SLIB.

SLIB includes a relational database, HTML and HTTP support, root-finders, function tracing and breakpoints, Cyclic Checksums, FFT, ...

	- C++ is the logical continuation after C, much of the new
	  developments in compilers, tools, and software development
	  is done in C++.
A subset of Scheme can be compiled to C. A half-Megabyte of our driver software is written and maintained using schlep.
	- Embedded software can now be developed in C++, using a
	  subset of C++.
Like JAVA? Scheme runs in JAVA (KAWA or SLIK); and JAVA runs in Scheme.

You mentioned GNOME in regards to Linux. GNOME is based on Guile, which is built around SCM version 4. The GNOME FAQ says:

Guile is the GNU project's implementation of Scheme, a Lisp dialect. Find out more at http://www.gnu.org/software/guile/guile.html.

The Guile docs are pretty good, but the Scheme standard (the wonderfully, obscurely named R5RS) can be found at: http://people.csail.mit.edu/jaffer/r5rs_toc.html.

Guile is the scripting or "glue" language for the GNOME project. From the original announcement:

We plan to use GTK/Scheme bindings for coding small utilities and applications. When these bindings are more mature, it should be possible to write complete applications in Scheme.

Think of SCM as a C development environment!

Copyright 1999 Aubrey Jaffer

I am a guest and not a member of the MIT Computer Science and Artificial Intelligence Laboratory.  My actions and comments do not reflect in any way on MIT.
SCM for Engineering
agj @ alum.mit.edu
Go Figure!