Ilya Zakharevich on Thu, 2 Mar 2000 14:45:39 -0500


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

Re: [PATCH 2.0.18] \x upgraded


On Thu, Mar 02, 2000 at 05:45:49PM +0100, Karim BELABAS wrote:
> > Right now there is a very high threshold on modifying PARI, given that
> > the vaste majority of PARI is written in C-like assembler.
> 
> This is not quite true. The code is generally lacking comments (that's an
> understatement), but this is not due to minute word-by-word manipulations.

I strongly disagree.  C-like code would 

  a) work with struct* instead of long*;

  b) would allocate new things by macros parameterized by the type of
     the allocated thing;

thus would completely clear the code from the dependence on the
details of internal representation of the PARI types.

These are two things addressed by my patch of the last year.  I do not
think that you can get a serious involvement with PARI without these
changes.

My (short) patch was rejected since it broke systems with
sizeof(ulong) > sizeof(ulong*).  The idea of the patch was to
introduce structures and macros which are binary compatible with the
current layout, thus one would be able to *gradually* migrate the
current corpus of code to the new layout.

Apparently, if this patch is wanted for 2.1.infty, one should either
forgo systems with sizeof(ulong) > sizeof(ulong*) for the duration of
the translation period, or bite the bullet and change all the code at
once.

> 1) basic functions that are ubiquitous and should be as fast as possible
> (includes multiprecision kernel, all basic arithmetic, and part of linear
> algebra), whatever the cost in code ugliness.

There is no indication that the change to a typed system would change
the assembler generated from the C code.  Thus the questions of
performance should not appear here.

Ilya