Prism Rationale, Part 2

Jim Little
Mon, 04 Jan 1999 22:17:10 -0700

This essay is written a LOT better than the last one.  Fear not.  :)

For those of you just tuning (ha!) in, I'm talking about Prism, a
programming technique I've been working on and recently published to the
Web.  You can find all kinds of detailed information about it at the
Sphere web site:  Or you can read on. 
I'm inflicting the Tunes mailing list with this stuff because, darn it,
you're all smart people here and I could use some smart critiques. 
Besides, I think it's kinda relevant to the stuff you guys are working

Prism Rartionale, part 2
Brother, Can You Spare A Paradigm?

Did you quickly hit the delete button while reading my last message?  If
so, you didn't miss much.  :)  But you did miss one important thing:
Prism's reason for being.  It goes like this:

* Semantic errors may be reduced by using a programmable system whose
semantics are as close as possible to the semantics of the problem

Use SQL.  Or, more simply, "Use the right tool for the job."  If you
don't, you'll deserve the bugs you'll get.

I call this philosophy "Paradigm-Independent Software Engineering"
(PISE).  The idea is that no one programming technique, be it
object-oriented programming, functional programming, or even spaghetti
programming :), is the right tool for every job.  But they're all the
right tool for some jobs (yes, even spaghetti programming... um, maybe).

There's actually a whole group of languages devoted to this concept. 
They're called "Domain-Specific Languages" -- languages which are
optomized for a particular domain (be it health care, income taxes, or
Sierra adventure games).  "DSL's", as they're called, make programming a
particular domain very easy, but they don't do much else.  As a result,
their use is pretty limited.

One of the reasons DSL's aren't very popular is because they aren't
general purpose.  You can only use them effectively in their problem
domain.  But they're useful precisely BECAUSE they're not
general-purpose tools.  See Perl for an example of what happens when a
DSL tries to act like a general-purpose language.

The PISE philosophy recognizes that the strength of DSL's comes from
their narrow focus.  It also realizes that most programs don't fit into
just one little domain.  A tax evasion program :), for example, fits
into the tax domain.  But its graphical front end fits into the GUI
domain.  And its database fits into the database domain!  No one DSL
could ever be used for the entire program.

To resolve this problem, PISE recommends using a programmable system

a) Allows you to create your own DSL's for your unique problems.
b) Allows you to use multiple DSL's to create a single program.

That's what Prism is for.  Prism is a compiler specification which
allows a single program to be compiled from multiple DSL's (or "domain
abstractions", as I call them).  Prism also allows you to create your
own domain abstractions from scratch or by reusing existing ones.

Don't believe me?  Check out the Sphere web site.

Comments, criticisms, or any acknowledgement of my existence at all
would be appreciated.  :)

Jim Little