archives

Turing Extender Language (TXL)

TXL has been mentioned briefly before on LTU. There is a recent paper in the LTDA Proceedings 2004 about the motivations of TXL, where the language designers iteratively modified their grammar to suit the intuitive expectations of their users.

Turing uses an asterisk (*) to denote the upper bound of a parameter array (as in array 1..* of int). Users therefore began to write s(3..*) to mean the substring from position 3 to the end of the string, s(1..*-1) to mean the substring from the first position to the second last, s(*-1..*) to mean the substring consisting of the last two characters, and so on. As these forms evolved, the language was modified to adapt to the users’ expectations.

The approach above does sound fruitful, if we want to achieve higher programmer productivity, rapid iterative design of the tools used has a radical chance of making an impact, instead of the path of taking tens of years before a language becomes a productive medium.

Incidentally, TXL allows more than rapid prototyping of the Turing language itself though. Here is an example of how one can override the Pascal grammar.

% Trivial coalesced addition dialect of Pascal
% Based on standard Pascal grammar
include "Pascal.Grm"
% Overrides to allow new statement forms
redefine statement
...
| [reference] += [expression]
end redefine
% Transform new forms to old
rule main
replace [statement]
V [reference] += E [expression]
by
V := V + (E)
end rule

The designers of TXL chose Lisp as the model for the underlying semantics, and uses functional programming with full backtracking for both parser and transformer.

Denotational semantics of a DSL?

I am really at a loss here... I was just trying to understand if one can define more or less formally what is a DSL.

Is it semantics of DSLs that differentiates them from GP PLs? Or is it only pragmatics ("you can do the same in any GP but it's easier/faster/cheaper to do in this DSL")?

In other words, can we define as DSLs those PLs whose semantic domains are, uh, domain specific? By a semantic domain here I mean the range (or codomain) of a semantic function, and the domain of this function is a syntactic domain... All these puns are not really intended :-(

...

After several unsuccessful attempts to pursue this path, I came to another "definition" - DSLs are the PLs with the pragmatics massively dominating the semantics :-)

PS: I would be very interested in seeing any references to papers on denotational semantics of some DSL.

Chris Coyne's Context Free Design Grammar, and SCIgen - Randomly generated CS papers.

Chris Coyne's Context Free Design Grammar was just mentioned by Perry Wagle on the #haskell irc channel. It's a beautiful use of simple concepts in a surprising manner. If you haven't seen the examples, you're missing out.

Chris mentions on the download page that's he's gotten a lot of hits because he's linked from SCIgen, the recently slashdotted automatic CS paper generation project at MIT. Even more amazing, One of their randomly generated papers was accepted.