TXL (programming language)

TXL (programming language)

Infobox programming language
name = TXL
logo =
paradigm = Pattern-matching and Term-rewriting
designer = Charles Halpern-Hamu and James Cordy
developer = Charles Halpern-Hamu and James Cordy

TXL is a special-purpose programming language originally designed by Charles Halpern-Hamu and James Cordy at the University of Toronto in 1985. The acronym "TXL" originally stood for "Turing eXtender Language" after the language's original purpose, the specification and rapid prototyping of variants and extensions of the Turing programming language, but no longer has any meaningful interpretation.

Modern TXL is specifically designed for creating, manipulating and rapidly prototyping language-based descriptions, tools and applications using source transformation. It is a hybrid functional / rule-based language using first order functional programming at the higher level and term rewriting at the lower level. The formal semantics and implementation of TXL are based on formal term rewriting, but the term structures are largely hidden from the user due to the example-like style of pattern specification.

Each TXL program has two components, a description of the source structures to be transformed, specified as a BNF-like grammar in context-free ambiguous form, and a set of structural source transformation rules, specified using pattern / replacement pairs combined using first order functional programming. TXL is designed to allow explicit programmer control over the interpretation, application, order and backtracking of both parsing and rewriting rules, allowing for expression of a wide range of grammar-based techniques such as agile parsing.

The first component does the same job as Lex does but on a higher level, i.e It extracts the tree representation of the input expression using Pattern-matching. The second component uses Term-rewriting in a manner similar to Yacc to produce the transformed output.

TXL is most commonly used in software analysis and reengineering tasks such as design recovery, and in rapid prototyping of new programming languages and dialects.

Examples

BubbleSort [http://star.itc.it/ricca/swat/SORT/Sort.Txl]

%Syntax specification define program [repeat number] end define

%Transformation rules rule main replace $ [repeat number] N1 [number] N2 [number] Rest [repeat number] where N1 [> N2] by N2 N1 Rest end rule

Factorial [http://star.itc.it/ricca/swatII/Esercizi/factorial.txl]

%Syntax specification define program [number] end define

%Transformation rules function main replace [program] p [number] by p [fact] [fact0] end function

function fact replace [number] n [number] construct nMinusOne [number] n [- 1] where n [> 1] construct factMinusOne [number] nMinusOne [fact] by n [* factMinusOne] end function function fact0 replace [number] 0 by 1 end function

References

* [http://portal.acm.org/citation.cfm?id=114627.115074 J.R. Cordy, C.D. Halpern and E. Promislow, 1991. TXL: A Rapid Prototyping System for Programming Language Dialects. Computer Languages 16,1 (January 1991), 97-107.]
* [http://portal.acm.org/citation.cfm?id=1149672 J.R. Cordy, 2006. The TXL Source Transformation Language. Science of Computer Programming 61,3 (August 2006), 190-210.]

See also

* Turing (programming language)
* Refal (programming language)

External links

* [http://www.txl.ca/ TXL website]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Turing Plus (programming language) — Turing+ (Turing Plus) is a concurrent systems programming language based the Turing programming language designed by James Cordy and Ric Holt, then at the University of Toronto, in 1987. Some, but not all, of the features of Turing Plus were… …   Wikipedia

  • Turing (programming language) — Turing is a Pascal like programming language developed in 1982 by Ric Holt and James Cordy, then of University of Toronto, Canada. Turing is a descendant of Euclid, Pascal and SP/k that features a clean syntax and precise machine independent… …   Wikipedia

  • TXL — may refer to:* IATA airport code for Berlin Tegel International Airport * Name of a character in Today s Special * TXL programming language …   Wikipedia

  • Tree programming — refers to the use of a programming language to analyze data trees, in a way unique from conventional programming languages. This should not be confused with list based programming languages like Lisp and Scheme. Related languages *Linda… …   Wikipedia

  • List of programming languages — Programming language lists Alphabetical Categorical Chronological Generational The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and historical ones, in… …   Wikipedia

  • Transformation language — A transformation language is a computer language designed to transform some input text in a certain formal language into a modified output text that meets some specific goal.Program transformation systems such as Stratego/XT, TXL, DMS, and… …   Wikipedia

  • James Cordy — James R. (Jim) Cordy is a computer scientist and an educator from Canada whose accomplishments include developing the first Euclid compiler, the TXL programming language, the Turing programming language family, SP/k, Concurrent Euclid, and… …   Wikipedia

  • Data transformation — Data transformation/Source transformation Concepts metadata · data mapping data transformation · model transf …   Wikipedia

  • Список языков программирования — Списки языков программирования Алфавитный По категориям Хронологический Генеалогический Цель этого алфавитного списка языков программирования состоит в том, чтобы дать полный перечень всех существующих языков программирования, как используемых в… …   Википедия

  • Liste des langages de programmation — Le but de cette Liste des langages de programmation est d inclure tous les langages de programmation existants, qu ils soient actuellement utilisés ou historiques, par ordre alphabétique. Ne sont pas listés ici les langages informatiques de… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”