SMP, first shot at implementation

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

BlueStar
Posts: 30
Joined: Fri Apr 10, 2020 2:41 am
Full name: Craig Hoibakk

Re: SMP, first shot at implementation

Post by BlueStar »

Joost Buijs wrote: Tue Sep 15, 2020 6:48 am
It is true that you can write a strong engine in a slow language, but why should you throw away Elo by not using the fastest language there is?

I've been busy with this stuff for 43 years and used all Borland/Embarcadero languages from Turbo Pascal/Turbo C to Delphi and C++ Builder, these compilers always generate slower code than a modern C/C++ compiler like GCC or CLang. Maybe the differences are small (20% or so), but still so large that I'm not going to use it.

Of course it is possible to develop a Pascal compiler with the same quality of code generation and optimization as current C/C++ compilers have, it doesn't have to to anything with the language by itself, it's just that the compilers are worse.
Its funny, the compiler I am using started as "Turbo Prolog" that I picked up in the 80's. As you say, you have been doing this for 43 years (I'm not much younger than you :D ), so you could probably write a new engine in the back of your head in speudo-code. But if you are writing an engine for the very first time (from scratch--not cut/copy/pasters), the chances of being competitive with the high end engines right away is unlikely--even if your using the fastest compiler known. So a higher level, strict, type safe language might be beneficial to creating an actual first working engine.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: SMP, first shot at implementation

Post by Joost Buijs »

BlueStar wrote: Wed Sep 16, 2020 1:24 am
Joost Buijs wrote: Tue Sep 15, 2020 6:48 am
It is true that you can write a strong engine in a slow language, but why should you throw away Elo by not using the fastest language there is?

I've been busy with this stuff for 43 years and used all Borland/Embarcadero languages from Turbo Pascal/Turbo C to Delphi and C++ Builder, these compilers always generate slower code than a modern C/C++ compiler like GCC or CLang. Maybe the differences are small (20% or so), but still so large that I'm not going to use it.

Of course it is possible to develop a Pascal compiler with the same quality of code generation and optimization as current C/C++ compilers have, it doesn't have to to anything with the language by itself, it's just that the compilers are worse.
Its funny, the compiler I am using started as "Turbo Prolog" that I picked up in the 80's. As you say, you have been doing this for 43 years (I'm not much younger than you :D ), so you could probably write a new engine in the back of your head in speudo-code. But if you are writing an engine for the very first time (from scratch--not cut/copy/pasters), the chances of being competitive with the high end engines right away is unlikely--even if your using the fastest compiler known. So a higher level, strict, type safe language might be beneficial to creating an actual first working engine.
The first C compiler I used on MSDOS was Datalight/Zortech C made by the company of Walter Bright, this was around 1983. I also used Lattice C for a while.

I always write my engines from scratch, my current engine is the 7th incarnation, the only code it uses from somebody else is Nalimovs EGTB code because it would be too much work to write this from scratch.

Next week I'll be 68 and I notice that programming goes much slower than in the past, things that I used to do in 2 weeks now take 2 months. I have a totally new version of my engine almost ready, somehow I can't make myself finishing it. It's also because I'm getting a bit Chess tired, 15 years ago I stopped actively playing Chess in clubs myself.
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: SMP, first shot at implementation

Post by Dann Corbit »

Joost Buijs wrote: Wed Sep 16, 2020 8:07 am The first C compiler I used on MSDOS was Datalight/Zortech C made by the company of Walter Bright, this was around 1983. I also used Lattice C for a while.
I used both of those. Also Manx C and the Microsoft C compiler.
Those were all before the days of ANSI/ISO C, when the vendors did whatever they liked.
The header files you had to include were all different.

Code was full of #ifdef <some_darn_thing>
to handle all the craziness.
You might have to link in a special object if you were using compiler <x> instead of >y>

When the ANSI/ISO C standard came out, it was such a relief. I immediately fell in love with language standards.

On the other hand, the C code I wrote for font manipulation totally smoked the Fortran stuff it replaced.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: SMP, first shot at implementation

Post by Joost Buijs »

Dann Corbit wrote: Wed Sep 16, 2020 12:22 pm I used both of those. Also Manx C and the Microsoft C compiler.
Those were all before the days of ANSI/ISO C, when the vendors did whatever they liked.
The header files you had to include were all different.
It's a pity that I lost all these ancient compilers, they came on floppy disks and at some time they were not readable anymore.
The oldest ones I stilll have on the original CD's are Visual C++ 4.2, Watcom C++ 10.5 and Microsoft Fortran Powerstation Pro, these are all from the mid 90s. I also have an old version of Borland Turbo-C somewhere in a backup, this one is from the late 80s.