users-prolog
[Top][All Lists]
Advanced

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

Re: GNU Prolog documentation


From: Sean Charles
Subject: Re: GNU Prolog documentation
Date: Tue, 25 Jun 2013 22:02:41 +0100

Hi Daniel,

Today I tried using "pandoc" to translate the documentation into various 
formats to see what I could leverage from it. I looked at the HTML, DocBook, 
RST and a few others to see if I could use an XML library or something but as 
you have confirmed, the structure of the documentation "isn't quite right" and 
it would seem that the real solution is for somebody (me?) to do a manual 
labour one-time conversion of the predicate documentation into something that 
could then re-produce the existing documentation as well as be used in any 
other format.

A markdown format would probably be OK to parse but I think that (and I can't 
bee live I am saying this) just for once an XML structure might be good. I 
wouldn't go so far as to say use DocBook (I've used that before) but maybe 
something home-grown (including a DTD) that could then be used to produce all 
sorts of interesting things via XSLT or <insert-programming-language-here>.

As usual it is down to the data; once you have the essence of the thing that 
the possibilities are endless.

I have to brush up on Scala again for the next few weeks but I will commit to 
start taking the version that I have (1.4.4) and start to convert it into a 
structured XML data source that can be re-used by whoever for whatever purpose.

I will keep you informed of my progress on that.

As for the dlopen() work, I currently have it working on OSX, 64-bit 10.8.4 and 
so far no problems. The same code also runs on Linux Mint in VirtualBox. 
Currently all I am doing is loading and unloading, the dlsym() is nearly done 
but as usual I don't have enough hours in the day.. I have all sorts going on 
including a PIC micro project with Haskell driving the client side and it's all 
mad right now.

I will def. start on the documentation soon though… and maybe some emacs code 
as a test of being able to pull in the help on demand.

You have really captured the "spirit" of the early 80-s pioneering days for me, 
I shall be 48 this year and I have been "programming" since the age of eleven 
and messing with gprolog feels like it did way back but with the benefit of 
great technology and all your efforts so far!

:)
Thanks again,
Sean Charles.


On 25 Jun 2013, at 21:47, Daniel Diaz <address@hidden> wrote:

> 
> 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]