Friday, February 5, 2010

A Wacky Idea

All computer languages should come with a fully parenthesized API to their syntax tree.

The semantics of other languages are nasty enough. Having to deal with quirky syntax is just rubbing salt in the wound.

Furthermore, the language reader and pretty-printer should be break-out modules that can simply be imported and linked. I'm getting sick of writing parsers just because I can't trivially hijack an existing one without bringing in the entire compiler.

Wacky idea #2: A standalone syntax-rules preprocessor could be used on the parenthesized syntax tree. This would give the language a nice hygienic (lexically scoped) macro system with no work on the language implementor's part. (The preprocessor would have to know what the native binding forms are and how to distinguish identifiers from keywords.)