[pet] PET style guide proposal

Bernd Kiefer kiefer at dfki.de
Sun Jun 20 13:04:29 CEST 2010


Hallo Helmut,

this sounds interesting, although up to now we were quite content
with cygwin/gcc compilability under Windows.

There have lots of changes been done recently, so it would be good
to know what version it was that you branched from.

I see several advantages as well as potential problems adding your
code as another branch to PET. From my view, the good things are:

- another potential developer aboard
- more compatibility with Windows (although one could argue if that's a
   good thing :))
- general code improvement using available libraries

Problems:
- We are a small community, and therefore we try to keep with a single
   strand of development as far as possible. Currently, we're in the
   process of getting back to a single main branch. A new branch that
   differs considerably from the main line but is preferred by some
   people just because of OS considerations might draw away resources
   that we desperately need for overall improvement

I'd really like to know what others would think about the addition of the
code to the central repository.

Best,
		Bernd



On 18.06.2010 17:19, Mülner, Helmut wrote:
> Hi, pet developers,
>
> I recently got interested in pet and started porting it to the Windows platform.
> In a first step I used cygwin/gcc and managed to compile and run flop and cheap
> with the exception of ECL (so I configured --with-ecl=no) using the GG grammar.
>
> Porting to the Microsoft Compilers was a little more difficult.
> There was a portability bug in chart.h that took me some time to find:
> My corrected implementation of chart_iter_adj_active::valid() now is:
>
>    inline bool valid()
>    {
>        if (at_start&&  curr == LI_start.end()) {
>            overflow();
>        }
>        if (at_start) {
>            return true;
>        }
>        return curr != LI_end.end();
>    }
>
> In the original version curr could be an iterator of LI_start and was
> always compared to LI_end.end(). This is illegal in C++ and is asserted
> by the MS compiler.
> The forallint macro also contained an error: it dereferencd the end-iterator.
>
> To increase protability I used several boost libraries:
> foreach, format, date_time, lexical_cast, algorithm/string, filesystem,
> program_options.
>
> I also converted goofy to qt4 (not yet finished).
>
> Then I got carried away a little by my enthusiam: I eliminated salloc and malloc,
> sprintf, strupper, strcasecompare etc.
>
> Instead of ICU I used QString from the Qt libraries, for compiling I generated *.pro files.
>
> I also did some profiling and discovered that flop spends more than 50% of its time in strtod.
> (Are floating point numbers really possible in TDL?)
>
>>
>> I added a ProgrammingStyleGuide Wiki page to pet.opendfki.de.
>> The content stems from the Google style guide and other
>> sources, only very little of it are my own ideas and opinions.
>>
>
> I also changed a lot of names in accordance to the new programming style guides. ;-)
>
> If anybody is interested I can provide a git repository with my changes or upload to
> a branch in the svn repository.
>
> Greating from Austria,
>
>    Helmut Mülner
>    Institute of Information Systems
>    JOANNEUM RESEARCH Forschungsgesellschaft mbH
>    Steyrergasse 17, 8010 Graz, AUSTRIA
>
>    phone:  +43-316-876-2612
>    fax: +43-316-876-1403
>    personal fax: +43-316-8769-2612
>    web:    http://www.joanneum.at/iis
>    e-mail: helmut.muelner at joanneum.at
>

-- 
----------------------------------------------------------------------
Bernd Kiefer     DFKI GmbH, Stuhlsatzenhausweg,   D-66123 Saarbruecken
kiefer at dfki.de   +49-681/85775-5301 (phone)   +49-681/85775-5338 (fax)
----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vor-
                     sitzender), Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313



More information about the pet mailing list