TXL is an actively used programming language created in 1985. 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. Read more on Wikipedia...

35Years Old 20Users ?Jobs
  • TXL ranks in the top 25% of languages
  • the TXL wikipedia page
  • TXL first appeared in 1985
  • file extensions for TXL include txl
  • See also: turing, yacc, refal
  • Have a question about TXL not answered here? Email me and let me know how I can help.

Example code from Linguist:

% Calculator.Txl - simple numerical expression evaluator

% Part I.  Syntax specification
define program
end define

define expression
    |   [expression] [addop] [term]
end define

define term
    |   [term] [mulop] [primary]
end define

define primary
    |   ( [expression] )
end define

define addop
    |   '-
end define

define mulop
    |   '/
end define

% Part 2.  Transformation rules
rule main
    replace [expression]
        E [expression]
    construct NewE [expression]
        E [resolveAddition] [resolveSubtraction] [resolveMultiplication]
          [resolveDivision] [resolveParentheses]
    where not
        NewE [= E]
end rule

rule resolveAddition
    replace [expression]
        N1 [number] + N2 [number]
        N1 [+ N2]
end rule

rule resolveSubtraction
    replace [expression]
        N1 [number] - N2 [number]
        N1 [- N2]
end rule

rule resolveMultiplication
    replace [term]
        N1 [number] * N2 [number]
        N1 [* N2]
end rule

rule resolveDivision
    replace [term]
        N1 [number] / N2 [number]
        N1 [/ N2]
end rule

rule resolveParentheses
    replace [primary]
        ( N [number] )
end rule

Example code from Wikipedia:

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

Trending Repos

repo stars description

Last updated August 9th, 2020

Edit TXL on GitHub