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

Re: New Web browser for MiNT.



> I think this is a serious problemt. Seems like a lot of new MiNT coders
> are old scene ppl who think everything should be coded in asm because it's
> cool or something. Yes, you can optimize more intelligently in assembler
> but seriously coding a browser completely in that is a mistake. Chances
> are - if the browser is ever completed (which is slightly doubtful) -
> nobody will ever bother developing the browser further if it's written in
> asm. You can possibly optimize some critical parts like jpeg depacking and
> stuff like that in asm, but parsing, network connections etc. should most
> definitely be written in C. Also the structure should be clever enough so
> that jpeg depacking happens through clean calls so that they can be easily
> replaced with other asm code or if porting to another UNIX system,
> replaced with some neat library calls.

Well, I disagree. Having an example of myself here, I can say, that
assembler people probably don't code in asm just because it is considered
cool. They usually prefer assembler for its advantages over C or another
high level language. It is also possible, that one can know assembler
better than anything else, and it is just easier to write an assembler
program, because you know how to write such a program by intuition and
coding the same in C is a pain for you. Though I haven't been ever on the
scene, I think that scene programming experience is useful here, because
you also know most of optimal structures for data processing by heart.
Programming in assembler is as easy (or: as hard) as in other languages,
the only problem with assembler (that it is considered hard) is that
people don't know assembler. If I speak Polish by years, I know my
language very well. But I can't say, that everybody should speak Polish
just because Chinese is too hard to use it for daily speaking ;)

The advantages of the assembler are:

- assembler programs are short. A simple GEM application (cleanly written)
  takes few kilobytes including Devpac AES & VDI data structures.
- assembler programs are fast. If you have an intensive task which uses
  several variables and pointers in a loop, the assembler gives you an
  easy possibility to access 15 32-bit registers. If you put all your 
  variables there, your code will be lightspeed when compared wit a C
  compiled equivalent with 2 accessible registers and the rest of
  variables stored in the memory.

Also it is much easier (at least for me) to develop programs written
totally in assembler instead of mixed C & asm. Just because interfacing
the code from C to asm is pure pain and wastes the CPU time (you have to
push variables to the stack, then call teh assembler module with jsr, then
pull everything back, do the job, then do rts in order to be back to the 
C).

Further development of assembler programs by another programming team or
by another programmer is not a problem when the new people know the
assembler. Of course, assembler code has to be written cleanly so that it
would be readable, and it should be commented. The asm is not an exception
here, everyone can write a dirty program in C so that you won't understand
a keyword when looking at it without analysis.

The idea that assembler is particularly hard and everything should be
written in slow, but "easy" C, is a myth, especially when it applies to
m68k assembler. I would like to kick this bullshit out of people's
mentality.  Assembler is not hard by definition, it is hard if you don't
know it. The same with C and other programming languages (not easy "by
definition" but because it is taught in schools and people used to use
it). 

Konrad M.Kokoszkiewicz
mail:draco@bl.pg.gda.pl
http://www.orient.uw.edu.pl/~conradus/

** Quem Iuppiter vult perdere, dementat prius.
*******************************************************
** Kogo Jowisz chce zgubic, temu wpierw rozum odbiera.