Author: Christophe Theron
Date: 10:08:05 10/23/03
Go up one level in this thread
On October 23, 2003 at 07:04:17, José de Jesús García Ruvalcaba wrote: >On October 23, 2003 at 05:55:12, Daniel Clausen wrote: > >>On October 23, 2003 at 05:31:26, José de Jesús García Ruvalcaba wrote: >> >>>In a programming course (several years ago) we had to write the final project >>>for two different plattforms (in my case an old HP9000 and a PC under FreeBSD), >>>and the source code had to be identical, no changes allowed. I agree that it is >>>not really difficult, only some discipline is needed. >> >>It really depends on the program. >> >>The GUI-part is easily platform-dependent. > >Yes, of course. In our case, we were allowed to use #IFDEF statements to check >the environmental variables, but the source files had to be identical (strictly >speaking the source code was not identical for both compilers, but you get what >the teacher meant). Disciplined students (like me) had a strict separation >between platform-dependent and platform-independent code. > >>(like Arena, xboard, winboard etc) >>There are toolkits around, which are available for multiple platforms, but most >>aren't. >> > >Correct. But even if you use these toolkits, it still makes sense to keep the >platform-dependent code to a minimum. > >>The engine itself could easily be platform-independent, except for a small part. > >A chess engine is a good example for a program that can be written almost >completely portable. > >>(like multi-threading etc) Of course, as soon as you write something in Asm it >>looks different, but if it's just a tiny part, that's easy to port too. >> >>Sargon > >Portable code has some performance issues. It is probably not the best idea for >performance critical tasks. In case somebody writes non-portable but faster code >(or even assembler), I think it is a good idea to keep a portable (slower) >version of the same functions. But I have self not written any code line in >years, so do not take me too seriously (: >José. The source code of Chess Tiger is portable (using #if in some places) and can be compiled for the following platforms * DOS (several compilers) * Windows * PalmOS * Linux (not completely finished, but close) I don't use ASM and I don't want to use ASM, that's why achieving portability has been possible. I view portability and readability as more important than the few percent performance I could get from writing some parts in ASM. Christophe
This page took 0.01 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.