I would separate Richard's query into two aspects: (1) how do we reason about and enforce semantic structure, e.g. that files are closed once (and only once) upon opening, that handshakes are completed in the correct order, etc..
(2) how do we align semantic structure with syntactic/visual/physical structure of a program, such that behavior is locally apparent upon later reviewing the code. The first aspect can be addressed independent of syntax. One approach I find interesting is substructural types, which allow us to prevent some objects from being forgotten ('relevant' types) or used more than once ('affine' types), and together with a few simple design patterns can enforce sophisticated orderings of operations (e.g. each 'step' is represented by a separate object that only provides the valid methods for that step). (Other feasible techniques include use of dependent types or algebraic effects.) To avoid the syntactic burden of defining intermediate objects for each 'step', Plaid language experimented with a notion of 'typestate' where the state of an object also controls which methods are available (and the method sets the next typestate). It's an interesting idea, at least. The second problem, aligning semantic structure with syntactic structure... IMO this will never be addressed by a general purpose programming language because, when expressed in such a language, the structure of our program is generally not well aligned with the structure of our problem. Instead, we should look to problem specific languages (aka domain specific languages). Effective support for problem-specific languages is an ongoing design issue in PL. It minimally requires both good meta-programming facilities (e.g. control over staging), and decent support for debugging, typechecking, refactoring, and linting the original code (e.g. error messages shouldn't be presented in terms of a subprogram's macro expansion, tracing of errors shouldn't stop at the DSL compiler). PL research hasn't cracked this issue yet, though there have been a lot of interesting efforts. -- You received this message because you are subscribed to the Google Groups "PPIG Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to ppig-discuss+unsubscr...@googlegroups.com. To post to this group, send an email to email@example.com. For more options, visit https://groups.google.com/d/optout.