Author: leonid
Date: 19:19:23 11/09/99
Go up one level in this thread
On November 09, 1999 at 21:03:35, Christophe Theron wrote: >On November 09, 1999 at 17:12:19, leonid wrote: > >>On November 09, 1999 at 16:52:22, Christophe Theron wrote: >> >>>On November 09, 1999 at 15:32:53, leonid wrote: >>> >>>>On November 09, 1999 at 14:05:56, Christophe Theron wrote: >>>> >>>>>On November 08, 1999 at 06:02:53, leonid wrote: >>>>> >>>>>>On November 08, 1999 at 04:40:26, Bruce Moreland wrote: >>>>>> >>>>>>>On November 07, 1999 at 22:58:55, leonid wrote: >>>>>>> >>>>>>>>If you write your chess program only for fun, use every language that you could >>>>>>>>like. But if you expect that "others" should observe your happiness, use >>>>>>>>Assembler. Only this language will give your game extra ply over others. It will >>>>>>>>naturally induce into your game some extra glamoring brillances able to capture >>>>>>>>the attention of human eyes. And since the human is a social animal that crave >>>>>>>>for attention, Assembler is the only natural language for him to express >>>>>>>>himself. >>>>>>> >>>>>>>Assembler won't yield an extra ply. >>>>>>> >>>>>>>bruce >>>>>> >>>>>>If extra ply signify game that goes five or six time more rapidly, Assembler >>>>>>give you just this. >>>>>> >>>>>>Leonid. >>>>> >>>>> >>>>>Not a chance. You'll get 20% faster, maybe 25%, and that's all. >>>>> >>>>>And you'll need 3 times more developpement time, and a lot of crazy bugs to >>>>>chase. >>>> >>>>> >>>>>It's not worth it anymore. The time you spend on assembly programming, you'd >>>>>rather spend it on algorithmic improvements. There are plenty of things to >>>>>improve in any chess program. No current chess program is so perfect that the >>>>>only thing left to do is to re-code everything in assembly. >>>>> >>>>>I even know some chess programmers who are porting from assembly to C. It's a >>>>>wise decision. >>>>> >>>>> >>>>> >>>>> Christophe >>>> >>>> >>>>Disagree with you about the time (only 25%) and bugs, but maybe we speak about >>>>two different things. About 25% the most - wrong. About writing the chess game; >>>>we can speak about two different writing. I speak about writing the game almost >>>>100% from your head, you, I presume, doing it after the theory that is already >>>>there. When you write "your own" logic it will take anyway some considerable >>>>time to achieve the final version. When you will take the logic of others the >>>>time to realize your code could be quit short. Speeding this time even more >>>>looks logical. About the bugs in Assembler. I don't think they are more prolific >>>>that in C. Beside, it is much more difficult to find your bugs in the language >>>>that is half secret to you, like C. On Assembler you see everything on the >>>>surface and you are master of your code. Forgetting about theory, I can say you >>>>that I have seen as much buggy Assembler written programs as the C one. >>>>Rewritting the game on C have sense only because of portability and easy contact >>>>with other programmers. Here, maybe, we agree. >>>> >>>>Leonid. >>> >>> >>>My statements are based on experience. I have already written a chess program in >>>assembly from scratch, and I have done the same in C. >>> >>>C is not half secret to me. If you are able to write assembly, then you are >>>easily able to read the output of the compiler and to check if it is optimal or >>>not. I do that often and sometimes rewrite pieces of code to help the compiler >>>optimize it better. >>> >>>About bugs, I stronly believe you do less of them in C. This is also based on >>>years of assembly and of C. >>> >>>A chess program is never totally stable in his design. It's a moving piece of >>>code, and being able to make deep changes rather quickly is one of the keys of >>>success, because you never know where you are going to at the beginning of your >>>project. >>> >>>Assembler keeps you focused on how you do things. C lets keep you focused on >>>what you want to do with litle impact on performances. >>> >>>In fact I consider C to be a big macro-assembler. Having an assembly chess >>>program is something that can be explained only by the history of the program >>>(the project has been initiated at a time C compilers were not so good). >>>Starting an assembly chess program nowadays is IMO a "positional mistake". :) >>> >>> >>> >>> Christophe >> >>Quit interesting. But what kind of Assembler you used? Stand alone Assembler, or >>some possibility to use assembler coding from the high language? Came your C >>package from the same compagny (Microsoft, Borland) as your Assembler? >> >>Leonid. > >I have experimented all kind of assemblers, from assembly instructions in a C >source from separate assembly modules linked with a C, Basic, Pascal or Fortran >program. > >Not all these experiments were chess related, but overall the same pattern >remains: it's hard to write, read and maintain, you are stuck with what you have >written unless you are ready to invest a lot of time whenever you want to make a >big change in your basic structures, and the best I can get with assembly will >hardly be 20% faster than the best I can get in C (provided I am allowed to have >a look at the generated code from time to time). > >With the new architectures and pipelines/parallel execution, I would not be >surprised to be unable to write an assembly program that would run faster than a >C program. > >The modern compilers know how to rearrange instructions to make the best >possible use of the superscalar architectures, but I don't. And I just don't >wanna know how to do it. There are already enough things to be worried about in >a normal chess program, this would be too much. > > > > Christophe I never wrote the same chess program on C and Assembler. This is why your experience is very useful for me. For sure you touched more languages that me and this probably more because you was forced as professional to do so and not because it is so good thing to do. Each language demand years of continuous usage to be known as "mother tongue", but with the dismay of each new language in the space of 6 years it is an impossible logic for many of us to go. I was lucky to be able to stay with the same language for many years because I am not professional. About the speed. Obviously all my observations are simple theory. I never tryed what I am saying in a real game like you. Only 25% sound to me now, as before, as too little. The only possible reason for this I see in the fact that you used Assembler code only in some modules or inline. This never as good as the game created 100% on Assembler. Actually, biggest part of chess game, just before Windows, were done on Assembler. Take, for instance, Genius, Rebel or Fritz. We have some good C games but they all are on the places after the first four. And this is not because the C written games are worst, the most probable that they are as good, or even better that Assembler written games. Only C written games stays in shadows only because they speak their mind more slowly. But once everybody else will start writing in C, only then C games will reach the bright spot and we will find what game really is the best between them. This time the "greatest chess mind" will be recognizable more after the way its logic goes that by the speed at which given brain process its ideas. Leonid.
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.