[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pept:83] Stratego 0.7



Stratego release 0.7 is now available from 

  http://www.stratego-language.org

Stratego is a modular language for the specification of fully automatic program
transformation systems based on the paradigm of rewriting strategies. In
Stratego, basic transformation rules are expressed by means of labeled
conditional rewrite rules. Exhaustively applying all rewrite rules in a
collection of valid rules is often not desirable; a system of rules can be
non-terminating, or, more frequently, non-confluent. To control the application
of transformation rules, Stratego provides a language for defining rewriting
strategies based on primitives for sequential programming and abstract syntax
tree traversal. A rewriting strategy selects a number of rules from the
available rules and defines in what order these rules are applied to a program
fragment. Thus, the separation of concerns between logic (transformation rules)
and control is maintained.

Stratego can be combined with tools for parsing and pretty-printing in the XT
bundle of program transformation tools, which is available from

  http://www.program-transformation.org/Tools/XtDownload

or from the Online Package Base at

  http://www.program-transformation.org/package-base/

SUMMARY OF CHANGES

 (with respect to release 0.6.4)

 * Support for `native' ATerm lists and tuples
 * List traversal: lists considered as varyadic constructors
 * Global choice operators ++ and <++ support global backtracking
 * Bagof returns list of all possible results for ++ and <++
 * Guarded left choice s1 < s2 + s3 commits after s1 succeeds
 * Support for term annotations t1{t2}
 * Many new library strategies
 * Constant term caching in the compiler

DEPENDENCIES

 * aterm-1.6.6: aterm library with support for tuples
 
 * cpl-stratego-0.4: choice point library from INRIA (Nancy) with
   some modifications (optional)

MIGRATION

 * Existing code based on generic tuples (TCons/TNil) should be
   rewritten

MORE INFORMATION

 * http://www.stratego-language.org/Stratego/StrategoRelease07

CONTRIBUTIONS

 * Bug reports by Martin Bravenboer (<++), Dick Kieburtz
   (configuration), Otto Skrove Bagge (mapping reverse)
 * Bug fixes: Eelco Dolstra & Eelco Visser (Sun/ATmap bug)
 * Library contributions: connect.r (Hedzer Westra), getopt.r (Otto
   Bagge), restore (Martin Bravenboer)

LANGUAGE

 * The operators ++ and <++ provide global non-deterministic and
   global deterministic choice, respectively.

 * For symmetry, the choice operators +> and ++> give priority
   to their _right_ strategy argument.

 * The operator bagof(s) returns the list of all possible
   results produced by s.

 * The operator cpl-loaded (and friends) tell you whether you
   are running in an environment with the choice point library
   loaded (module cpl.r in the library).

 * The guarded left choice operator s1 < s2 + s3 is similar to
   (s1; s2) <+ s3, except that the choice is committed after s1
   has succeeded, i.e., no backtracking to s3 if s2 fails.

 * List constructors [_|_] and [] are no longer interpreted as syntactic
   sugar for Cons and Nil.

 * Tuple constructors TCons(_,_) and TNil are replaced by fixed length
   tuples (_,_,_,...). There is a tuple constructor for each arity.
   Parentheses around a term no longer represents a tuple, but the term
   itself, i.e., (t) == t. A lot of confusion arose because of <s>(t) not
   being equal to <s>t.

 * Term annotations can be used to attach information to a term without
   affecting its structure, i.e., arities or names of constructors. Syntax:
   t1 { t2 } denotes the annotation of term t1 with term t2. By making
   the annotation into a list, many different annotations can be attached
   to a term. Proposals for linguistic support for such annotation lists
   are welcome.

COMPILER

 * The translation to C has been adapted to support native lists.

 * Implementation of native tuples is handled in the front-end; tuples
   are just special constructors.

 * The C back-end has been adapted to perform constant term caching.
   This means that terms that are constant _at compile time_ are
   constructed once at program startup and cached in global variables
   for later use.

 * Compiler quits after finding a parse error instead of struggling
   on for a while.

RUN TIME SYSTEM

 * Adapted the Stratego Run-Time System to (conditionally) include the
   Nancy Choice Point Library. This provides an alternative
   implementation for choice from the current one---although it comes
   down to the same thing, i.e., setjmp and longjmp. The advantage of
   this addition is that it enables global choice. For programs only
   using local choice this extension is transparent. By choosing the
   --with-cpl switch of srts/configure the choice point library will
   be used. By default the old implementation is used. For programs
   using the new ++ and <++ operators the --with-cpl flag should be
   used.

 * Choice buffer overflow repaired (?) when using cpl

 * Include files are now installed in $prefix/include/srts to avoid 
   file name clashes with other packages.

 * There was a bug in the definition of ATmap in aterm-extension.c, which
   caused the new implementation of the generic traversal operators
   to malbehave on lists. (ED + EV)

LIBRARY

 * Include files are installed in $prefix/include/ssl to avoid 
   file name clashes with other packages.

 * cpl.r: test if Choice Point Library is installed. 
   - cpl-loaded: succeeds if CPL is loaded
   - if-cpl-loaded(s): do s when loaded, otherwise exit 0
   - if-cpl-loaded(s1, s2): do s1 when loaded, otherwise s2

 * list-set.r
   - postorder-collect(s) selects all subterms for which s 
     succeeds and returns them in post-order.

 * list-filter.r:
   - partition(s): partitions list in a list with elements for
     which s succeeds, and one for which s fails

 * integers.r: 
   - Operator log2 takes the base 2 logarithm. 
   - Constructor Infinite represents infinity, 
   - Operatorsadd-inf and lt-inf are aware of Infinite.

 * simple-traversal.r: 
   - Strategy bottomup-para(s) implements paramorphism, 
     which applies s at pair of orignal term and term in 
     which the subterms have been transformed.

 * getopt.r:
   - This module parses command line arguments and build an option table
     for convenient retrieval. Non-option arguments are returned to
     the caller. Traditional Unix / GNU option syntax is supported.
     (Otto Skrove Bagge)

 * connect.r:
   - Inter process communication for Stratego programs. (Hedzer Westra)

 * annotations.r:
   - Support for annotations

 * conditional.r:
   - restore(s, rest): call restoring operation rest when s fails
     and then still fail
   - restore-always(s, rest): also call rest when s succeeds

-- Eelco

-----------------------------------------------------------------------------
Eelco Visser                 Institute of Information and Computing Sciences
mail:visser@cs.uu.nl         Universiteit Utrecht
  or:visser@acm.org          P.O. Box 80089, 3508 TB Utrecht, The Netherlands
http://www.cs.uu.nl/~visser/ Phone: +31-30-253 4592 Fax: +31-30-251 3791
-----------------------------------------------------------------------------
NOTE: When replying to this message make sure that your email program uses 
the address in the Reply-To field, i.e., visser@cs.uu.nl, (as it should) and 
not to the address in the From field, something like visser@loempia.cs.uu.nl 
or visser@node11794.a2000.nl, which are different names for my laptop. Emails 
to these addresses will not arrive.
-----------------------------------------------------------------------------