archives

The SPIN model checker and Promela

I just happened to notice that the 13th International SPIN Workshop is coming up. While model checking is kind of off topic, it made me think about SPIN's model checking language Promela.

From the Promela Reference manual:

The language allows for the dynamic creation of concurrent processes. Communication via message channels can be defined to be synchronous (i.e., rendez-vous), or asynchronous (i.e., buffered)

Gerard J. Holzmann's excellent book: The SPIN Model Checker has a complete reference to this interesting C-like language with CSP influenced extensions.

Debug-Edit-Compile cycle

What is known about the constraints of the Debug-Edit-Compile cycles that enable to modify and reload source code within a running debug session for several languages? Is there any research about this topic or is it plain arcane practical knowledge of compiler/runtime authors?

Fission for Program Comprehension

Jeremy Gibbons (2006). Fission for Program Comprehension. Submitted for publication.

Fusion is a program transformation that combines adjacent computations, flattening structure and improving efficiency at the cost of clarity. Fission is the same transformation, in reverse: creating structure, ex nihilo. We explore the use of fission for program comprehension, that is, for reconstructing the design of a program from its implementation. We illustrate through rational reconstructions of the designs for three different C programs that count the words in a text file.

The paper works through the examples meticulously and highlights their recursion schemes. The claim is that the three different wordcount programs might all have arisen from the same high-level design, namely the composition length o words.

The more audacious claim is that [i]f one accepts the claim that design patterns in object-oriented programming correspond to recursion patterns in generic functional programming, then this is further support for Johnson’s slogan that ‘patterns document architectures’.

The C Family of Languages: Interview with Dennis Ritchie, Bjarne Stroustrup, and James Gosling

Herb Sutter's website has an interview with the main inventors of C, C++, and Java.

I think they all rightly raise the question of "C family of languages" means but I'm more interested in how the design decisions they discuss. I thought this bit by Gosling was interesting:

There have been a number of things [I would have done differently] -- like, for example, multiple return values -- that these days I kind of wish I had added. That was one where I really liked the feature and most other people just sort of went, "Huh?" Another one that sort of went that way was that I had been going down this route of having a bunch of stuff to do with preconditions and postconditions and assertions in an Eiffel-like way, and actually in the community of people who were using it at the time the average answer was, "Huh? Why would I ever want that stuff?" I think that the average developer today would say that too. But then there's a pretty reasonable crowd of people who believe in things like Design By Contract, and it's one of these things where a lot of people feel like, "If only the rest of the world was educated enough to understand what this is about, they'd be better off." And I actually kind of agree with that. The problem is that most of the world could actually care less.

Accidental Syntax

Mark-Jason Dominus writes about "accidental syntax" in Perl, and wonders if this happens in other languages. I couldn't think of any examples offhand, but I'm sure Common Lisp must have some...