[plt-scheme] Suitability of typed scheme for replacement of c language for microcontrollers

From: Will M. Farr (wmfarr at gmail.com)
Date: Sun Feb 21 20:20:09 EST 2010

Seth,

You might want to look at the "pre-scheme" language defined by the Scheme 48 folks (I think Kelsey and Rees?).  I don't remember too much about the details.  My recollection is that it's a proper subset of scheme, carefully chosen to allow type inference and beta-substitution to transform all higher-order procedures to first-order at compile time.  In other words, if you run it in a Scheme interpreter/compiler, it works, but you can alternately transform it directly to C if you like (because all the types can be inferred, and all procedures are "really" first order).  I think it may even avoid the use of garbage collection, so it's really "C, with parens".

I think there's a compiler for pre-scheme in the standard Scheme48 distro.  My understanding is that the VM for Scheme48 was actually written in pre-scheme, and then compiled to C using this compiler.  

Hope you find this helpful,
Will

Posted on the users mailing list.