Roly Perera offers a critique of Subtext: Why syntax wonâ€™t go away. Itâ€™s great to get this kind of feedback. I like Rolyâ€™s visionary thinking â€“ I hope grad school doesnâ€™t pound it out of him. Overall, we are in violent agreement on many issues.
All I am saying is, letâ€™s give programs the same respect we give all our other information artifacts. Letâ€™s say you are designing a system to automate a video rental store. You will analyze what information needs to be recorded, like videos and customers. You will analyze what operations need to be performed, like renting and returning. You will then design data structures that encode the information state while making it easy to specify the necessary operations. You might choose to use a relational model or an object-oriented one, but you would never decide to encode everything into text strings with embedded keywords, and use repeated occurrences of unique names to represent all pointers and relationships. Why is it that programs, the most complex information artifacts known to man, are restricted to one of the weakest of all data models? One reason is that when programming languages were first invented we didnâ€™t know very much about data structures, and the only UI was a keypunch.
Roly and I agree that metaprogramming is central to the future of programming, and that our current adhoc refactoring techniques offer a clue to that future. That is exactly why syntax must die. Syntax makes machine manipulation of programs terribly difficult, often impossible. If we do a classical data analysis of programming as an application domain, we must surely treat refactorings as primary operations that should be straightforward to represent in the data model of a program. I think that is what Roly means when he says that refactorings should be as â€œformally reliable as the kind of batch-mode transformations that a … optimising compiler might implementâ€. The mother of all refactorings, Rename, is undecidable in a language with dynamic binding or reflection. Reductio ad absurdum. If Rename is undecidable, you are using the wrong model of programs. Subtext makes Rename trivial.
Roly rightly objects to the lack of a concise formal definition of most Visual Programming Languages, which impedes metaprogramming. Subtext does have a formal model of programs underlying it, and making that model as simple and as clean as possible has been a major goal. Unfortunately the model is still in a formative state, rapidly shifting with each iteration. My first attempt to present the key ideas of the model was rejected by OOPSLA last year, so I published it as a tech report.
Roly suggests that the textual comments attached to explicit linkages within Subtext might emerge as names in disguise, through the use of textual conventions to encode structure outside the program. I hope that Subtext will have sufficiently expressive annotation and reflection features to make that unnecessary.
Roly and I are largely in agreement if you take his use of the word â€˜syntaxâ€™ to mean any constructive mathematical structure. I take syntax to mean only the use of a grammar to specify a formal language. Syntax is fundamentally about parsing strings. Syntax is a great way to represent trees. When you need a more complex topology you fall back on the universal hack of names. We invent subtle and mysterious name-binding semantics in order to encode structure beyond the parse tree. I hate names because they are semantic black holes that hide much of the interesting structure of our programs from human sight, and sometimes even from automated analysis because of undecidable run-time semantics. Roly objects to my ruling out names â€œa prioriâ€. I am indeed taking an extreme position, but I justify it as a form of intellectual self-discipline. We are so well trained in the habitual syntactic tricks that it is sometimes difficult to see the alternatives. I find I need to banish syntax utterly in order to think clearly about what a program really is. I am just starting to feel confident enough to consider reintroducing textual representations for Subtext programs. But they would only be partial renderings, not a source artifact that can be parsed by a grammar into a program. Syntax must die!
I firmly believe that within 30 years the practice of encoding programs into text strings will be seen as a barbaric relic of the stone age of programming. My ambition is to hasten that day.