bart <
bc@freeuk.com> wrote:
On 14/03/2025 18:00, Scott Lurndal wrote:
bart <bc@freeuk.com> writes:
While on 1980s PC-style machines, programs were typically not huge. I
used my own fast compilers and fast loaders (to combine object files
into one program).
The last thing a Unix programmer would want is to use a 1980s PC,
then or now.
<snip 1000 lines>
This is one of the lines you snipped:
(I would love to know how long such a build process would have taken
on a 1980s machine with floppy disks! Possibly a week.)
The context is a project like GMP and its 35,000 of script which is the
first hurdle. The end result is an approx 0.5MB library, which is not
that far off being a plausible piece of software for those 1980s PCs.
I'm guessing that it would have taken an unreasonably long time on such
a machine. Ergo, it would be considered hopelessly inefficient.
You miss some points:
- one significant plus of GMP is use of advanced algorithms. On
modern machine the algoritms give gain at about 16 machine
words, that is about 150 digits,
- GMP uses specialized code (assembler or machine-specific C).
It has code for many architecures and processor variants.
- On classic 8-bitters or even 8088 based PC multiple-precision
code tends to be larger and slower than code on more modern
machines.
On classic 8-bitter GMP is clearly too large and you do not have
enough space for numbers large enough to give you substantial
gain. On 8088 you probably could be able to fit some advanced
capability info available space. But you would have to fight
with segmentation and provide optimized assembly. Beyond that
you would need to tune several paramenters.
Simply, GMP is not for 1980 era machines.
But let us look at your compiler. AFAICS it is way too large
for classic 8-bitters. On 8088 based PC you could fit the compiler
in the RAM, but you also have large statically allocated tables,
you would need to shrink them. Merely loading your compiler
from the floppy would take substantial time, so you probably
would want it to be resident, which means you would need to
add some user interface. Similarly, reading source and
writing executable to floppy takes time, so you probably
would like to keep that resident too. But then you almost
surely would run out of RAM, at least when trying to
self-compile: compiler + user interface + source code of the
compiler + generated executable code look like more than
640 kB.
So neither you nor most other developers develop for 1980 era
machines.
Concerning "hopelessly inefficient", I know about a program
for which full re-compile on a machine much more powerful than
a 8088 based PC took 3 weeks. Apparently developers coped
with this reasonably well (part of the trick was that full
re-compile was rarely needed).
So, it sounds like you're either completely missing the point, or
choosing to ignore it. Which is that the build task in this case is too
long and slow in proportion to the task.
GMP is in business of providing highest execution speed given
avaliable (limited) developement time. Given the goal, build
time has secondary importance and is actually quite reasonable.
Note that as a user I would build given version once: after
compilation it is available to all programs. Also, most PC-s
are idle most of the time, spending many compute cycles on
compilation is not good for environment, but otherwise quite
cheap. What matters more is developers time, developers
must do many compilations and they organize things to save
their time (like using 'make' but also replacing manual
effort by computer work).
I like efficient programs and in my code I am trying to avoid
wasting computer time. But it is hard to blame other people
that they save their time at expense of some extra work for
computers, computer time is much cheaper than human time so
it makes economic sense.
-- Waldek Hebisch