users-prolog
[Top][All Lists]
Advanced

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

Re: GNU Prolog documentation


From: Daniel Diaz
Subject: Re: GNU Prolog documentation
Date: Tue, 25 Jun 2013 22:47:04 +0200

Le 25 juin 2013 à 11:56, emacstheviking <address@hidden> a écrit :

> Hi,
> 
> Does anybody know what would be the *best* way to slice and dice the 
> documentation source files to produce "nuggets" per predicate?
> 
> As far as I can see, the gprolog runtime doesn't have apropos or help 
> predicates like some other implementations so I have decided that as an aid 
> to learning more I am going to try to implement them but of course they need 
> access to the underlying documentation for the meat of the output.
> 
> I can see from the source distribution that the documentation is written 
> using .tex files (I have used LaTeX for many many years) BUT would it be 
> *easier* to pick apart the large single HTML file instead. The H4 tags carry 
> the predicate name which is useful as a starting point.
> 
> I would like to have something like this:
> 
>     help(predicate).
> 
> Dump the relevant part of the help file to the console.
> 
> 

Hi

Thank you for your interest for GNU Prolog and for your proposal to contribute 
to the doc. Contributions are always welcome :-)

As explained by Lindsay in another mail, the doc is written in LaTeX. PDF is 
obtained with pdflatex, HTML with HeVeA. The solution proposed by Lindsay, ie. 
extracting doc from pl-bips.tex (BTW, FD constraint predicates are in 
fd-cstr.tex) is doable and should work for most predicates. However, when 
several predicates are grouped in a same subsubsection you will obtain the help 
for all involved predicates (eg. var, nonvar, atom,…).

A preferable solution would consist in extracting once for all the doc from the 
tex file and to put once for all in the corresponding source files (ala Javadoc 
or pldoc). I never had enough time for this… Recently the Prolog Commons group 
discussed a syntax for the literate doc of the commons predicates (the syntax 
is close to markdown): it would be a good idea to use/extend this syntax for 
the gprolog built-ins too. Let me know if you are interested in participating 
to this.


> I have written a "C" extension that wraps the dynamic link library calls 
> (dlopen,dlcose etc) and so far that seems to show promise.

BTW: I'm interested on your experience. We have also done this for ix86/linux 
(easy architecture). For x86_64/linux I thing it is needed to produce PIC code 
so I have recently added this option to compiler (gplc and the ma2asm 
sub-compiler). But it is not yet really used (the idea with the module support 
is to load/unload a module with dlopen/dlclose). On which architecture do you 
use libld (dlopen,…) ?

> I was toying with writing the actual implementation in C using libxml or 
> something to scour the HTML file, on demand. My other approach would be to 
> produce a "database" (bunch of files called predicatename.txt) and then just 
> interpolate the filename from the help argument and do it that way. Whatever, 
> with all programs it comes down to defining the data first!
> 
> I really like GNU Prolog, I started with SWIPL but it's too big a dung-ball 
> for me right now. Ciao seems "ok" but again, too big a dung-ball. I like the 
> lean and mean approach with GNU Prolog plus the opportunity to make it better 
> with my own extensions.

Thank you for those kind words !

Daniel


-- 
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.




reply via email to

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