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

Re: Asm or C (was: Re: New Web browser for MiNT)



On Mon, 30 Mar 1998, Konrad Kokoszkiewicz wrote:

> totally in assembler would be a bad idea. Even if written in C, it would
> be practically not portable to anywhere, but slow/big/unefficient for
> sure. When things come to a browser, we already have one written in a
> "portable" language for more than one operating system and more than one
> TCP stack. Well, CAB is compact and lightspeed when compared to a
> Netscape, but I believe a browser may be even more compact and
> efficient, and this is the point.

CAB is written in object-oriented Pascal, which is a ugly, nasty hack
of a "language" which isn't portable at all. It generates ugly,
bloated and inefficient code, it's even worse than C++.

If it was properly coded in C it would have been *a lot* faster, a
hand-optimised assembly-version would probably have been only
marginally faster. The only part you can really speed up with assembly
is things like table-calculations etc, small parts that could be
written in assembly.

> For larger programs I noticed that the time of development for asm
> programs is really much longer than for C programs. But I also noticed,
> that the most of this time is spent on optimization, which part is mostly
> missing for C development.

Naturally, since that's one of the things the compiler is supposed to
do :-) Most of them do it quite well too.

> Yes. There are two points of view. From one hand, if you want to deal with
> complex data structures, a high level language may be easier for you to
> code ideas. At the other hand, no compiler has an ability to do miracles
> and a code based on an abstract data structure won't be fast. Even worse,

All universities that teach computer-science has a course called
"Algorithm and data structures", where you learn presisely this.

> > I am quite aware of these points. The second point was slightly vague,
> > however: why on earth would a C compiler only use 2 registers???
> 
> I always wondered the same. A register is an important resource, and it
> seems you're not able to use this resource in a big extent while
> programming in C on Atari. That's very bad.

E.g. Pure C pass arguments in registers, and AFAIK all decent
compilers use as many registers as possible. You can also use the
'register'-specifier, although this doesn't guarantee the use of a
register. There's no difference in using registers on Atari than on
any other platform. 


/*
** Jo Even Skarstein    http://www.stud.ntnu.no/~josk/
**
**    beer - maria mckee - atari falcon - babylon 5
*/