Welcome

  • This is the blog for Intentional Software Corporation. We keep it open for comments as we seek a dialog with the community. Each participant will be trusted to participate with integrity, decency and respect for others.
  • Visit Intentional Software Corporation

« Personal Observations from a Developer | Main | The long tail of programming languages »

April 08, 2005

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451741069e200d834238f3c53ef

Listed below are links to weblogs that reference Is programming a form of encryption?:

Comments

Michael Dynin

The "encryption" metaphor is a stretch -- the primary intent of encryption
is to obscure the message, and *hopefully* this is not the primary
intent of programming. Rather, I think of coding as compression.

The programming language can then be thought of as a
compression scheme. Two factors are important: to what extent
is the compression lossy (to what extent the intent is lost),
and what is the rate compression (how efficient is the language
at eliminating redunancy.) Obviously, less lossy and high-rate
compression is good.

Better compression is usually achieved by domain-specific languages,
just as custom compression schemes for pictures, audio and video
can leave general-purpose compression algorithms in the dust.
Language-oriented development promises a general-purpose
"compression scheme" that performs as well as domain-specific ones.

Compression algorithm can be arbitrarily complex, but there is cost
associated with the complexity of the programming language. The real
challenge is in providing a sufficiently better "compression scheme"
that is simple enough so that cost of switching is acceptable.

Magnus Christerson

Dear Michael,

Yes, the encryption metaphor is a stretch - as we said it's a "fun" way to compare the similarities. Of course no reasonable programmer intentionally tries to hide the problem statement in their code!

Your compression analogy is good and it points out the potential lossy-ness of a software program - some intentions are not only encrypted or compressed, but actually lost! This is a fact for both design information (for example an architectural decision can easily be lost in code) as well as problem domain information (today many legacy business rules are lost in the code).

However, compression is used to get a more compact format for the message. This is not usually the case when we write a computer program. As we have blogged before, the problem statement of a program can typically be expressed in a more compact form than our typical source code.

And you are right, domain specific languages, or more precisely, languages which have the appropriate level of abstractions for the problem at hand, do a better job of encoding the intentions of the software to be built. So ultimately encoding is the ideal scenario as opposed to today's processes which are more similar to encryption or even compression.

Michael Dynin

There are in fact some truely encrypted problem statements -- at Obfuscated Code Contests... :)

I agree that encoding is the ideal scenario -- with 1:1 mapping between decisions the programmer makes and constructs of the program representation.

Hans Hurvig

The analogy with encryption also holds when your move one abstraction-level down, from source code to machine code.

Machine code is essentially cipher-text, and with optimizing compilers it is very unclear which bits of machine code reflect which parts of the source code, the "image of A".

Machine code is gibberish to most programmers, and no sane person would modify machine code if you had the source code and could modify and recompile it.

Indeed, most programmers can be fully productive while being blissfully ignorant of the messy details of machine code, even its existence.

How did we attain this happy state? By having powerful tools that completely shield us from these details.

Now, of course, moving one abstraction-level back up, the trick is to attain the same level of power in your intentional framework so we can start forgetting about source code. Good luck!

Magnus Christerson

Hej Hans,

You mean that intentional code is to generated code as high level source is to machine code generated by optimizing compilers. We agree. So the optimizing compiler represents knowledge about the target machine architecture, and also some general programming tricks such as constant folding and strength reduction.

Generative programming is an extension of the programmer's power to include other domain details and specific system architecture details into the "compilation process".

Now moving up the abstraction level above the source code has been tried before, for example the current model driven tools all try to do this as they generate source code. However, many of these tools still require you to also work at the level of output of the generators i.e. the source code, for example debugging, or adding some lower level code in the source code langugage to complement the model information. Since there is much more to say about this approach, we 'll write up as a separare blog entry on this.

Thanks for your post!

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment