Guy Steele in DDJ, Thoughts on Language Design: discusses going beyond the structured programming constructs of loops, if-then-else, and sequential operation:
What might a language look like in which parallelism is the default? How about data-parallel languages, in which you operate, at least conceptually, on all the elements of an array at the same time? These go back to APL in the 1960s, and there was a revival of interest in the 1980s when data-parallel computer architectures were in vogue. But they were not entirely satisfactory. I’m talking about a more general sort of language in which there are control structures, but designed for parallelism, rather than the sequential mindset of conventional structured programming. What if do loops and for loops were normally parallel, and you had to use a special declaration or keyword to indicate sequential execution? That might change your mindset a little bit.
The programming language I work on, Apex (as well as its predecessor, the RAP System), has parallelism turned
off on by default, so that, for example, in
(procedure (do something)
(step (do this))
(step (do that)))
the “do this” step and the “do that” steps are executed in parallel. This does, in fact, turn out to require a change in mindset, especially when the individual steps are themselves composed of substeps executing in parallel. The RAP system also had an interesting approach to the if-then-else: procedures can have various methods which are tried in different cases; for example:
(procedure (open door)
(method (is-automatic door))
(step (walk up to door)))
(method (has-knob door))
(step (turn knob))))
I think that the syntax for both Apex and the Rap System turns out to be a bit heavy on keywords (method, step, etc.), which are, in turn due to their roots in Lisp. (There are some advantages to the ‘everything looks like data’ approach though). Neither the Rap System nor Apex really handle looping very well, though we’re working on some new looping constructs for Apex.
In addition to the breakthroughs with respect to ‘structured programming’ constructs, both Apex and the Rap System have other important features, which like default parallelism, require some ‘changes in mindet.’ For example, conditions (such as in the methods above) can be much more richly expressed than boolean queries, but can stream bindings. Anyway, it is nice to think that Steele is working on making some of these ideas find their way into the mainstream. Here’s the latest spec for his new language Fortress, which also includes support for Unicode-based operators, for example: “A × B” instead of the traditional ASCII “A * B” to indicate multiplcation.
(via lambda the ultimate).