We recently announced our App Inventor for Android project on the Google Research Blog. That blog entry was long on vision but short on technological details--details which we think would be of interest to our readers.
Of particular interest is our use of Scheme. Part of our development environment is a visual programming language similar to Scratch. The visual language provides a drag-and-drop interface for assembling procedures and event handlers that manipulate high-level components of Android-based phones. The components are similar to the ones in the recently announced Simple; in fact, the code bases share an ancestor.
We parse the visual programming language into an S-expression intermediate language, which is a domain-specific language expressed as a set of Scheme macros, along with a Scheme runtime library. We did this for a few reasons:
- S-expressions are easy to generate and read for both humans and machines.
- Scheme macros are a convenient (albeit sometimes arcane) way to express S-expression based syntax.
- Scheme is a small, powerful and elegant language well suited to describe and evaluate a large set of programming semantics. Additionally, it provides the flexibility that we require as our language and its semantics grow and develop.
- Scheme expertise was readily available among our team.
- A pre-existing tool (Kawa by Per Bothner) to create Android compatible output from scheme code was already available.