Static vs Dynamic

I was thinking about Mandelbrot sets again today, as a metaphor for the difference between the static and dynamic aspects of programming. The static equation of the Mandelbrot set (Z <- Z2 + C) is relatively simple, while the dynamic behavior (a fractal) is relatively complicated.


Suppose you wanted to write a program to calculate a Mandelbrot set. It's a lot easier to just write down the static equation in your program than it is to try to write down what the resulting fractal should look like. "Well it's symmetric, of course, and it also has lots of spirals and branches and tendrils, and they're all connected to each other, and... well... it's hard to describe".

On the other hand, sometimes it's easier to describe the dynamic behavior instead of the static behavior. For example, if you're dealing with a client-server system, it's easy to say "no request should ever cause it to crash or hang". But it's difficult to write code in such a way that this is guaranteed.

In other words, fractals have simple specifications but complex behavior. In contrast, distributed systems have simple behavior, but complex specifications.

A holy grail of programming would be to be able to work on whichever side of the static/dynamic divide is most appropriate for the problem you're trying to solve. Sometimes it's easier to just write the code in some imperative language than it is to specify the emergent behavior. Other times you want to specify constraints on the emergent behavior without bothering with the implementation details. And in most programs, you'd like to be able to do both, and have both sides influence each other.

I think it would be interesting to explore the interplay between these two ways of seeing programs. The yin and the yang, as it were. I find it intriguing that most of the successes in CS so far seem to be based on describing the dynamic behavior of a program by examining the static code. Type theory fits into this category, as does static optimization, formal verification, etc.

We've had much less success (or maybe just less research effort) going the other direction: specifying constraints that the dynamic behavior of a program should fulfill, and then deriving a static implementation automatically. This category includes logic programming, constraint programming, etc.

It's not obvious to me why it seems to be easier to deduce dynamic behavior from a static specification, than it is to interpolate a static specification from dynamic requirements.

Posted on November 28, 2003 12:21 AM
More programming articles

Comments

Interesting thought. Pardon the levity of my response, as I'd really like to give it a little more thought, but the first thing that came to mind was a parallel with the logical process: producing dynamic behaviour from a static specification is a process of deduction, ideally an isomorphism (well, barring compiler bugs, language ambiguities, environment interactions and so forth); producing a static specification from dynamic requirements, though, is an inductive process, isn't it? Wouldn't the largest difficulty come from automating the creation of a potentially ambiguous static specification, then incrementally refining that into a state of workability (if not unambiguous representation - but, as noted above, even the result of the inverse process is not free of potential misinterpretation in practice)?

This seems similar to the theme explorered in the book "Watch What I Do", a book about programming by demonstration (the full text of which is available at the above link) which I picked up some months back but which has remained unread since then. Have you looked into this at all?

Posted by: Gnomon at November 29, 2003 02:36 AM

You're right, it is a matter of induction versus deduction. And I suppose it's always possible to handle deduction -- if you don't have a theory of how a set of rules will play out, you can simply brute-force it by running them manually, and find out. And computers are really good at that.

Induction, on the other hand, requires that you come up with some theory of how to proceed. In the general case, it requires creativity and inspiration. And computers are really bad at that :)

As for programming by demonstration, I have come across it a couple times but never really gotten interested. I think I just haven't seen any applications of it that are sufficiently general, and sufficiently powerful, to cross my threshold of interest.

Posted by: kim at December 9, 2003 12:58 PM

Laptop Battery Laptop Battery Laptop Batteries
Laptop Batteries discount laptop battery
discount laptop battery
notebook battery notebook battery
computer battery computer battery
replacement laptop battery replacement laptop battery
notebook batteries notebook batteries

Posted by: Laptop Battery at November 24, 2009 10:10 PM

chaoying nfl jerseys
Giants Jerseys
Patriots Jerseys

Posted by: jerseysleague at November 29, 2009 04:09 AM

Paul Smith has been collaborating with a few different organizations recently and his latest venture sees him teaming up with Japanese bicycle saddle, Paul Smith bag, on a limited edition leather saddle. The release features Smith’s signature stripes where only 20 will be available at Paul Smith Clothing store in Japan and 8 at the Floral Street store in London. Get on it quick

Posted by: dasf at November 29, 2009 11:49 AM

Just wanted to say great job with the blog, today is my first visit here and I’ve enjoyed reading your posts so far
ugg bailey button
Wow, my ugg classic mini will not be coming off now! I’ve had them on for 12hrs strait and I do not want to take them off. Thanks for everything, well worth the wait.

Posted by: ugg bailey button boots at November 30, 2009 06:28 AM

ugg boots sale at a time when large heat has set off a winter 08/09 to Ewha.Outlines the

warm wool winter fashion degree to wool crocheted wool ugg boots uk to join after the

body does not stimulate your skin soft, soft comfort UP. Fashion can not without
ugg boots presence in Winter.and ugg boots have many series.such as:
ugg classic
UGG Bailey Button boots
ugg nightfall
ugg kids

Posted by: uggboots at December 2, 2009 08:46 PM
Post a comment









Remember info?




Prove you're human. Type "human":