texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] literate programming for TeXmacs


From: Felix Breuer
Subject: Re: [Texmacs-dev] literate programming for TeXmacs
Date: Wed, 18 Jan 2006 14:12:09 +0000

Hello David,

On Tue, 17 Jan 2006 15:34:34 +0100
David MENTRE <address@hidden> wrote:

> What do you think of it?

I see the advantages of your suggestion. Just a couple of thoughts:

* One advantage of generating source code from documentation is that
source code snippets can be reordered in the process. And I think this
is rather important. If you are writing Java for example then you would
have a single line of code containing "class Foo {" somewhere in your
TeXmacs document, then all kind of method definitions with
corresponding documentation and finally a lone "};".

* While texmacs' markup is readable, I don't think it is *that* readable.
Having a large chunks of commented texmacs markup in source files would
make them less readable, IMO.

* Implementing lp this way does not gain anything with regard to TeXmacs
sessions.

* I don't work with IDE's or other integrated build environments, so having
a lp tool that works well with them is not important to me, personally.

The advantage I see in your approach is that it might be very easy to
implement, possibly without touching TeXmacs' interna. The biggest
obstacle to implementing the system you propose as an external tool is
that a chunk of verbatim text when saved in .tm format uses all kinds
of escape sequences and such. (< and > obviously have to be escaped)

How would you implement the system you propose? As an external tool
or as a special "export as..." format within TeXmacs?



Hm... the way I see it, the two following things might be useful to
have.

* Give TeXmacs itself the ability to rearrange snippets of verbatim
text on the fly (i.e. to tangle code snippets). This could be roughly
what I have done in LP4TeXmacs, only that it would be implemented in
TeXmacs itself, so it could be used to generate code for interactive
sessions as well.

* Implement a special import and export method that reads and writes
the entire document in .tm format with the exception that all lines
are commented (using the language specific syntax for commenting)
except for the contents of some special purpose primitves which
are exported verbatim.

The rub is that these two would _not_ work well together unless TeXmacs
also had the ability to untangle, which is where the difficulties lie.

All in all, I have to give the whole thing more thought. But it is
definitely a good idea to simply "save a document with TeXmacs markup
as comments" instead of generating source files from TeXmacs documents.


Regards,
Felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]