Saturday, April 29, 2006

Language Influences Architecture?

Peter Seibel started to give an interesting talk on "How Implementation Language Influences Architecture" at the recent SDForum Software Architecture and Modeling SIG. Peter started with three theories. The Sapir-Whorf theory is a long standing theory of natural language. It claims that language determines thought. The current common consensus is on the weak form of this thesis. (I will give you my opinion of Sapir-Whorf on another day.)

The second theory is the Blub paradox. This theory starts from the assumption that everybody has a favorite programming language that controls how they think about programming, which is where it loses me. The theory itself is too complicated and tenuous to sum up in an elevator pitch, so it may as well be forgotten.

The final theory is Turing equivalence. This is the idea that all programming languages are capable of expressing any computation and are therefore equivalent. The Turing tarpit is the idea that while all computationally complete languages are in theory equivalent, in practice some programming languages are just so much better and easier to use that the notion of equivalence is moot.

Unfortunately, after this strong start, Peter degenerated into a less satisfactory discussion of design patterns. The descent continued as Peter showed some particular problems with Java and claimed that they are better solved in Common Lisp. My experience with Lisp is confined to maintaining my emacs configuration file, something I have to do far too often. However, I think that the problems Peter highlighted were the usual problems with static versus dynamic checking. Java has some restrictions because it tries to detect and eliminate problems at compile time. Lisp has little compile time checking so problems are only discovered at run time. As it is better to discover problems sooner than later, compile time checking beats run time checking any day.

My view is that programming languages are tools. Just as I have four different hammers in my garage for different types of hammering tasks, so I use several different programming languages for different types of programming tasks. The issue is not that the language influences the architecture, rather that the software architecture influences the choice of implementation language.

1 comment:

jmay said...

I had a different impression of Peter's presentation. I would have liked to have seen much less time spent on Sapir-Whorf, Blub & Turing and more on the specific examples. I agree with you that there's a big issue with static vs dynamic typing, and I would have liked to have had a discussion on architecture impact of picking a language on one side or the other of that divide.