Jan 16, 2009

Stratego/XT vs. TXL (Part 1: Getting started)

Lets try to launch a simple example with both tools and evaluate the difficulty of the process, see how to deploy and where to get help.

Deployment

For TXL it is quite easy to get started since prebuild binaries are available for the variety of platforms. Download, unpack and you are ready to transform the world.

With Stratego/XT one might need to obtain a bunch of packages and compile them if needed. I didn't like the Nix system, it downloaded a lot of software and required some additional efforts to see installed software. I think the best way is to compile form sources these packages. The situation with the ability to build the whole system on a Windows platform is unclear, but there was a success-story post in a mailing-list in Nov-2008.

Documentation

Both have good documentation. But I like TXL's more. It is suitable for both learning and referencing and it is convinient to use it as a book. Also it is easy to print it and put under the pillow.

Community

Stratego/XT uses a mailing list, TXL uses a forum. I think mailing lists now can be used only for one direction communication when one needs to inform a lot of people about something. For other reasons it is impractical - not possible to categorize message, hard to search and one will get all the messages.

The number of messages in the both communities seems to be comparable and non can be considered the leader. But TXL community has one serious disadvantage. It is a solo show. There is about ten times difference between the author of TXL (No. 1 top poster) and the second top poster - 800 to 80 posts and more for others. If for some reason the author will decide to quit the project the community most probably will die. May be there is a team behind but it is not seen.

Availability

Stratego/XT tools and their sources are available under LGPL and GPL licenses.

TXL is free to use but sources are promised to be probably available on 2009 summer.

First launch

Now lets try to launch some sample. Both projects are using Tiny Imperative Language for their examples. But writing this part and evaluating tools I have found that they are using different TIL grammars. The one for TXL does not have function calls.

The task will be to parse and pretty print a simple TIL program.

TXL was much easier to lunch so I will start from it. The simple parsing and printing example required 2 files - the grammar and a program. The invokation was also simple (see the example page).

Syntax Definition and Pretty-Printing page for Stratego/XT guides to do the same. During the process I met some terms: syntax definition, parse table, abstract syntax tree, regular tree grammar, signatures, pretty-print table. To reach the final goal I invoked a lot of different tools: translators, compilers, converters, checkers (pack-sdf, sdf2table, sglri, format-check, til-parenthesize, ast2text, ppgen, sdf2parenthesize, strc, sdf2rtg, rtg2sig, pp-aterm). Once I missed one operation and at the end was wondering where the file is, but easy found the missed step. Finally I successfully got my TIL program printed out after parsing.

At the introduction stage Stratego/XT has a higher entry level because of the need to operate with much more tools and new terms to understand how it is working. TXL is much more obvious at this moment. But it may be different when one will try to do some real transformations.

IDE support

In general no dedicated IDE for both. But there are modes available for 3rd party environments (Emacs, Vim, ...).

After my recent Java to Tcl and Python transformation I would say that some project support (IDE) would be great because for the large transformation one has a large amount of rules and need somehow to browse them.

Jan 15, 2009

Transformations: Stratego/XT vs. TXL (Introduction)

In program transformation Stratego/XT and TXL are among the main players on the market. They are both free so I have decided to compare them. There are a lot of other tools/languages which claim transformation functionality. But they are either don't have transformation as their main feature or not free to play with.
I am neither compiling theory scientist nor compiler developer, I am the end user of these tools. So I will not discuss the theories behind the tools. I will look at them as at products for a software developer.
There is no promise about the terms and volume of the comparison. It even can be not finished at all. Also posts might be changed during the process so don't be surprised to read something new in the old post or loosing something.
For a couple of reasons TXL has a little preference in my mind mostly because of being the first. But I will try to be unbiased.
I will compare the tools deployment, usage, communities, test on some little projects. I have not decided on which transformation exactly to compare tools. Most probably new ideas will appear during evaluation.

Jan 13, 2009

java2tcl, yava2python sources

Both java2tcl and yava2python projects source codes are available now. See projects pages.