Pattern languages 
Author Message
 Pattern languages

Does anyone know of the existence of a "pattern language" that offers
the possibility of defining or extending programming languages through
the definition of patterns?  What I am thinking of is something more
powerful than a macro pre-processor but not as general as yacc and
lex.  The idea is to define a set of syntactic patterns and their
translations, and to then be able to program either using the patterns
alone, or to use the patterns as an extension of an existing language.

The closest examples I can think of are not general tools, but the
possibility to extend languages through overloading etc.  Smalltalk,
Prolog and Lisp all make it relatively easy to add new syntactic
patterns (within certain constraints!).

The two main reasons I would like to have such a tool are:

1. To prototype new programming languages (or language constructs).
   Since the development of a new programming language and its compiler
   is a significant effort, it would be nice to have some tools for
   doing a mock-up that can be easily changed.  A common trick is to
   implement the compiler as a translator to an existing high-level
   language like C, thus piggybacking on an existing compiler.
   A pattern language would be ideally suited to such translation.

2. To provide programmer definable language extensions (for enhancing
   software reusability).  Programming languages suffer from the
   problem that the language design must "freeze" the language,
   pretending to anticipate the needs of all future programmers.
   Programming constructs basically define the ways in which reusable
   software can be packaged.  If I discover I need generic procedures
   or object classes etc., but the language doesn't provide them, then
   I'm stuck.  A pattern language would allow a programming language to
   remain open-ended.

Examples of what you should be able to do include:
- macro substitution
- expression re-writing (e.g., translation to postfix form)
- object classes (declaration, inheritance, ...)
- control abstractions (e.g., loops, transactions, ...)
- generic functions

Since a pattern language should be a relatively simple tool (in the
spirit of, say, awk), it should not be concerned with generation of
addresses, optimization, or most of the {*filter*} things real compilers do.

The kind of functionality I believe a pattern language should provide
would be:
- definition of parameterized patterns and their semantic actions
- actions should include bookkeeping (management of scopes and
  symbol tables) and generation of output (translation)
- a primitive form of type-checking for pattern parameters
  (i.e., parameters will also be matched by patterns)
- recursive patterns

I would like to hear of any tools or languages that offer similar
functionality, and any reactions as to the feasibility or advisability
of such an animal.

Oscar Nierstrasz
C.U.I., University of Geneva, Switzerland




[Fif{*filter*} years ago, there was IMP-72 which allowed you to put BNF in the
program that extended the language's syntax.  Since it parsed with Earley's
algorithm, ambiguous syntax was OK.  It worked, and you could indeed add
marvelous new syntax.  It failed for three reasons that I could see:  Each
program was, in effect, written in a new language, making maintenance nearly
impossible.  The underlying compiler had a rather simple idea of what was
going on, making it impossible to add semantically interesting new stuff.
And, finally, Earley is an N^3 algorithm, which made the compiler so slow
that it was painful to use.  -John]
--

Plausible paths are { decvax | harvard | yale | bbn}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request



Mon, 19 Apr 1993 12:41:00 GMT  
 Pattern languages

Quote:

> .... extending languages through patterns ....

There was some work done in the early 70s on extensible languages.  The
one I remember most was Ben Wegbreit's E(xtensible) L(anguage) I.  There
was some play in the literature, but I think that the performance
was poor.  I don't have any personal experiences myself.
--

Department of Computer Science,            (803)656-5880.mabell
Clemson University, Clemson, SC 29634-1906
--

Plausible paths are { decvax | harvard | yale | bbn}!ima
Please send responses to the originator of the message -- I cannot forward
mail accidentally sent back to compilers.  Meta-mail to ima!compilers-request


Mon, 19 Apr 1993 19:30:00 GMT  
 Pattern languages
For "prototype" languages, you might check the following (which I have not
yet read):
   "The Realizable Benefits of a Langauge Prototyping Language"
      R.M. Herndon & Valdis A Berzins
      IEEE Transactions on Software Engineering, Vol.14,No.6,ppp. 803-809
      June, 1988

There are languages which provide "language modules" to extend syntax in a
fixed way.  As to the idea of user-extendable languages...I think your
comment about maintenance is the most pertinent. It's a nightmare for real
applications.

I would, however, be interested in any info you receive (e-mail addr. below)

Stewart Hill



Mon, 19 Apr 1993 16:39:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Call for Papers: 3rd Annual Conference on Pattern Languages of Programming

2. Final Call for Papers: Third Annual Conference on The Pattern Languages of Programs

3. Call for Papers: 3rd Pattern Languages of Programs

4. 3rd Annual Conference on The Pattern Languages of Programs

5. Call for Papers: 3rd Annual Conference on Pattern Languages of Programming

6. Pattern Languages and Oberon

7. Call for Papers: 3rd Pattern Languages of Programs

8. 3rd Annual Conference on The Pattern Languages of Programs

9. Call for Papers: 3rd Annual Conference on Pattern Languages of Programming

10. Final Call for Papers: Third Annual Conference on The Pattern Languages of Programs

11. Pattern Languages of Program Design

12. CFP: ECOOP'97 Workshop on Language Support for Design Patterns and Frameworks (LSDF'97)

 

 
Powered by phpBB® Forum Software