TXL question (Attn: Gene)

K

Kenny McCormack

Note that TXL was (AFAICT) written in C, so it is on topic here.

I've started playing with TXL - and yes, the hard part is wrapping your
mind around its way of doing things. The first thing I tried to
implement was an identity filter - i.e., the equivalent of simple "cat".
It seems to me that an identity filter should be to filter languages/programs
what "hello, world" is to straight-up procedural languages.

However, the problem is that it seems to have a concept of line length.
I am using the "-char" option, but there are still problems.

Very long lines in the input are output correctly (that's good; they are
not truncated or wrapped), but an extra empty line is output after the
very long (I think "very long" can be read as "greater than about 100").
Also, an extra blank line is output at the end of the file.

Thus, it seems not possible to write the "IF". Is it?
 
L

Lew Pitcher

Note that TXL was (AFAICT) written in C, so it is on topic here.

Perhaps. If you ask questions about specific parts of the C code that
implements TXL, then yes, in all probability, those questions would be
on-topic here. However, if you ask questions about TXL itself, then no,
those questions would not be on-topic.

Now, what is TXL? According to http://www.txl.ca/nabouttxl.html,
"TXL is a unique programming language specifically designed to support
computer software analysis and source transformation tasks. It is the
evolving result of more than fifteen years of concentrated research on
rule-based structural transformation as a paradigm for the rapid solution
of complex computing problems.

The TXL programming language is a hybrid functional / rule-based language
with unification, implied iteration and deep pattern match."


[snip]
The rest of your post deals with writing programs in TXL, and with the TXL
language itself. Sorry, but TXL isn't C, and we can't answer TXL questions
with any authority here. You best find a TXL-specific forum, such as "The
TXL Forum" (http://www.txl.ca/forum/) to ask your questions in.

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
 
L

Lew Pitcher

Consider who made the post. I think you will find that you have been
trolled.

Yes and no. I recognized the OP, and his purpose.

OTOH, I also knew that some answer was necessary, both to point those who
google for TXL to the right place, and to reassert the subject matter of
the group. I, for one, do not appreciate the side-tracking of topicality
that some of the posters in this group perform.

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
 
G

Gene

Note that TXL was (AFAICT) written in C, so it is on topic here.

I've started playing with TXL - and yes, the hard part is wrapping your
mind around its way of doing things.  The first thing I tried to
implement was an identity filter - i.e., the equivalent of simple "cat".
It seems to me that an identity filter should be to filter languages/programs
what "hello, world" is to straight-up procedural languages.

However, the problem is that it seems to have a concept of line length.
I am using the "-char" option, but there are still problems.

Very long lines in the input are output correctly (that's good; they are
not truncated or wrapped), but an extra empty line is output after the
very long (I think "very long" can be read as "greater than about 100").
Also, an extra blank line is output at the end of the file.

Thus, it seems not possible to write the "IF".  Is it?

I'd say it's on topic not because TXL is written in C (I don't know if
that's true. It's original intent was to transform Turing, so I
guessed it was written in Turing.), but rather because there it's an
excellent tool for transforming C. E.g. I've used it to implement a
"near C" language that supports exact garbage collection by making the
C stack accessible to a gc root-finding algorithm.

Anyway, Jim Cordy--the PI for the txl project--was very kind,
answering all my questions as I did the "Practical Introduction"
problems on the web site, in which he urges you to submit your
answers. I recommend you do this and ask your questions of him.

FWIW, I don't think TXL gives a whit for matching input line numbers
to output. I've had to debug while inspecting the TXL output rather
than input for that reason.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top