Boost logo

Boost :

From: John Max Skaller (skaller_at_[hidden])
Date: 2001-06-22 12:09:07


> In my opinion we have two alternatives, either write something from scratch
> which is standard (portable) and boostified, but following closely the above
> libraries; or we find a way to get some people porting some of these
> packages so they can be included in boost; but can't tell which is harder.

        FYI: my one published work is an unlimited precision
integer library written in ISO Standard C: see my chapter in

        Software Solutions in C
        Ed Dale Schumacher
        Academic Press

I don't have the ISBN, since an academic borrowed my only
copy ...

The system is written to emulate C++ featues including
exception handling (which would need to be converted
to real exception handling). It also uses polymorphism
to allow user defined control of resizing the arrays.

The implementation follows the textbook (Knuth for division).
It also demonstrates what a lousy language C89 is:
there is a large performance loss because there is no
way to multiply _any_ integral types without loss of precision.
It is necessary to use half words, resulting in over 6 times
more operations than necessary on most machines.

This package has two major benefits: it is exhaustively
documented in the above book (including every single
line of code), and it is uncompromisingly ISO Standard C89.

Sigh. The code was developed from a C++ version I don't
have any more :-)

Long and short: if you want a high performance
implementation, forget about it being 'Standard'.
This doesn't apply to the _interface_.

Developing a good interface is not easy.
The obvious operations are easy, but for good
performance you need the big integers to work
with small ones too. Choosing which routines
to provide is hard, and even harder if you
want both performance and also ability
to wrap one of many available implementations.

The best solution is probably to provide
a LOT of routines (some of which will
be slow for a given package).

Another solution is two levels of interface:
basic and advanced.

-- 
John (Max) Skaller, mailto:skaller_at_[hidden]
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk