From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,48610c7d031e8a3c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!o10g2000yqa.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Yannick_Duch=EAne_Hibou57?= Newsgroups: comp.lang.ada Subject: Re: Literate Programming Date: Mon, 7 Sep 2009 20:51:08 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 86.75.149.163 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1252381869 9666 127.0.0.1 (8 Sep 2009 03:51:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Sep 2009 03:51:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o10g2000yqa.googlegroups.com; posting-host=86.75.149.163; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8221 Date: 2009-09-07T20:51:08-07:00 List-Id: Thanks for this constructive reply Before I go on, I have to say that I exploring solutions in the same spirit of a previous thread I've opened about Ada and UML. After some attempts, I did not felt fully at ease with UML and Ada for the time, so I'm still trying to evaluate and envisage other possible solutions. On 7 sep, 10:38, Stephen Leake wrote: > As I understand it, that can be considered a meta-language, that mixes > LaTeX and Ada source in one file, and provides tools to split them out > into files that the relevant compilers will accept. Yes and no, not exactly. This split a program in parts with markups, and makes multiple views on an overall. Multiple views are possible because of the ability to make reference to these parts. I.e. a view is made of a particular organization of some parts which are introduced into it via references (a part does not belong to a particular view, except with CodeBrowser which is different). The basic idea in literate, is that the implementation approach is not the same as the understanding approach. A quick image could be to point that when one figure out how something works, his/her wordings may introduce B before A, while the implementation may requires A to be defined before B (different process, different requirements). This is just an example, just think about the idea that the understanding process is not the same as the implementation process. A fundamental function of literate, is called tangling. This is the function which take one view which purpose is to be the implementation view and combines parts as referenced in this view, to make up the implementation. It produce an output which is the implementation expected by the language. Let say you have two parts in you program (to keep it simple), which are A and B. There may be one ore more understanding view making references to A and B, and there is an implementation view, which stand for the program construction. This view will make reference to A and B in the desired order, I mean the order expected by the language and the compiler. The tangling command appends content of A and B to create the program construct. But there are other way to do. Leo does that in that way, while CodeBrowser does that in a different way, which does not requires tangling (I don't wish to tell more about differences between Leo and CodeBrowser, to keep these wordings enough short). > > So I was wondering if someone has ever heard about some extentions to > > GPS which would give it literate programming facilities. > > What, exactly, is missing from GPS? Markup driven folding (nodes), that's all, and may be the ability to follow links to these folders/nodes This is just a matter of layout and UI, not at all a matter of GPS functionalities targeting Ada and the build process. > You have the ability to run external tools, to do the splitting. This is exactly the opposite which is needed. > I guess syntax colorization is confused; it needs to know when to > apply LaTeX, when to apply Ada. Dear, you can keep simple minds and forget about LaTex formatting ;) This is just one particular folk, basically, human readable documentations in literate is just comments, and weither or not it is formated, is not a particular focus. This can simply be Ada comments. There is not requirement at all for it to be LaTex. This can range from raw text to anything one may wish. > You can't preserve the navigation facilities, treating the > literate file as the source; pragma Source_Reference only changes the > file name, not the line numbers. That's a GNAT limitation; you could > petition them for a more powerful Source_Reference pragma (but you'd > probably have to come up with some money to get it). I don't bother about it and I'm not requiring anything any way, I'm just talking and seeking for knowledge about a particular subject (and seeking for solutions). > I prefer using separate LaTeX and Ada files, and referencing one from > the other appropriately. That preserves all the navigation facilities > in both languages. If you include the relative file name in a comment, > Emacs can easily navigate between the files; I don't know if GPS will > do that. You bring something very interesting in the area. I was also precisely too thinking about how to make reference to a document from GPS in an Ada source. I was wondering if there is already a standardized comment syntax for it. I've noticed that in GPS, comments whose content does start start with a space (or the two spaces which the Ada world seems to prefer), then it is colorized differently. So I was thinking there may be some convention for type of comments (or perhaps this is only intended to SPARK language shipped in comments and to nothing else). If there is a way to give a reference to a document and to be able to open it from GPS with a simple click or menu command, this may be nice. I was thinking this is perhaps possible with scripting, although I do not know a lot about scripting GPS. But I was mainly wondering about what the format of this kind of comments should and weither or not such a kind of comments (standing for an URI to a document) has already been standardized of not. > As you say, one of the prime features of literate programming is > providing structure for unstructured languages. Ada doesn't need that :). The same way Ada is not only useful for very big project and project where preserving humans life matter and can be useful as well for smaller project, the same way, literate is not only useful for flawed languages (I apologize, I mean targeting some area only). As I said before, I was back to this idea I was not fully satisfied with UML (which I did not already left anyway... I'm still seeking). > I don't know for sure, but I bet there's an Emacs mode for literate > programming :). I know there is support in general for "multiple modes > in a single buffer", for JavaScript embedded in html. I'm not running UNIX. > > -- > -- Stephe Thanks Stephe