Are there any chess engines written in D?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
rreagan
Posts: 102
Joined: Sun Sep 09, 2007 4:32 am

Are there any chess engines written in D?

Post by rreagan » Sat Oct 12, 2013 12:24 am

Are there any chess engines written in D?

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: Are there any chess engines written in D?

Post by Don » Sat Oct 12, 2013 2:32 am

rreagan wrote:Are there any chess engines written in D?
I came very close to rewriting Komodo in D. But I didn't and as far as I know there are none.

The primary reason I didn't was simply because of the huge effort involved and I'm pretty sure D is still about 10% slower than a top notch C compiler for Chess.

Don
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.

Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 3:38 am
Location: Schenectady, NY
Contact:

Re: Are there any chess engines written in D?

Post by Ron Murawski » Sat Oct 12, 2013 4:14 am

Don wrote:
rreagan wrote:Are there any chess engines written in D?
I came very close to rewriting Komodo in D. But I didn't and as far as I know there are none.

The primary reason I didn't was simply because of the huge effort involved and I'm pretty sure D is still about 10% slower than a top notch C compiler for Chess.

Don
The only engine I know of that is written in D is Rasbojnik
http://prof.beuth-hochschule.de/edlich/ ... rasbojnik/

Ron

Jhoravi
Posts: 256
Joined: Wed May 08, 2013 4:49 am

Re: Are there any chess engines written in D?

Post by Jhoravi » Thu Oct 17, 2013 3:42 pm

Don wrote:
rreagan wrote:Are there any chess engines written in D?
I came very close to rewriting Komodo in D. But I didn't and as far as I know there are none.

The primary reason I didn't was simply because of the huge effort involved and I'm pretty sure D is still about 10% slower than a top notch C compiler for Chess.

Don
Don, Assuming the 10% slowdon is not a factor, do you think D as a language is more ideal than C or C++ for chess?

Jhor

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: Are there any chess engines written in D?

Post by Don » Fri Oct 18, 2013 12:12 am

Jhoravi wrote:
Don wrote:
rreagan wrote:Are there any chess engines written in D?
I came very close to rewriting Komodo in D. But I didn't and as far as I know there are none.

The primary reason I didn't was simply because of the huge effort involved and I'm pretty sure D is still about 10% slower than a top notch C compiler for Chess.

Don
Don, Assuming the 10% slowdon is not a factor, do you think D as a language is more ideal than C or C++ for chess?

Jhor
Yes.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.

rreagan
Posts: 102
Joined: Sun Sep 09, 2007 4:32 am

Re: Are there any chess engines written in D?

Post by rreagan » Fri Oct 18, 2013 2:20 am

Don wrote:
Jhoravi wrote: Don, Assuming the 10% slowdon is not a factor, do you think D as a language is more ideal than C or C++ for chess?

Jhor
Yes.
Okay, assume D, Go, and C/C++ are equally fast. Would you prefer D or Go?

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: Are there any chess engines written in D?

Post by Don » Fri Oct 18, 2013 1:51 pm

rreagan wrote:
Don wrote:
Jhoravi wrote: Don, Assuming the 10% slowdon is not a factor, do you think D as a language is more ideal than C or C++ for chess?

Jhor
Yes.
Okay, assume D, Go, and C/C++ are equally fast. Would you prefer D or Go?
I would probably prefer Go simply because it really feels light. However, D is superb and much was done to clean up the warts that exist in C and C++.

If I was forced to write a chess program today in one or the other however it would have to be D. I think a D program could still be competitive with a C program and although Go is fast and native I have my doubts it will every rival C in performance. When I say "rival" I don't mean within 20 or 30% but I mean really fast, like within 5% and not with cherry picked examples but program very much like chess, heavy logic and such.

I don't know that this will never happen but I just have my doubts.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.

Jhoravi
Posts: 256
Joined: Wed May 08, 2013 4:49 am

Re: Are there any chess engines written in D?

Post by Jhoravi » Fri Oct 18, 2013 3:19 pm

Don wrote: I would probably prefer Go simply because it really feels light.
So Go's automatic Memory Management is good for chess?

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 2:27 pm

Re: Are there any chess engines written in D?

Post by Don » Fri Oct 18, 2013 3:34 pm

Jhoravi wrote:
Don wrote: I would probably prefer Go simply because it really feels light.
So Go's automatic Memory Management is good for chess?
Where did I say that? The question was this:

Okay, assume D, Go, and C/C++ are equally fast. Would you prefer D or Go?

If Go was just as fast I would prefer Go.

Automatic memory management is probably something you could work around because you don't want that for "pedal to the medal" programming. The question is what would the code look like if you were to complete avoid it, assuming you can? Then go programs might not look so nice or be some nice to work with. I don't really know because I don't know the intimate details and internals of the go language and to what extent you would have to write ugly code to avoid automatic memory management.

I C chess programs you can pretty much completely avoid malloc and free - except perhaps for sizing the tables which is a one-off thing - not something that is constantly being done during a search.

Don
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.

rreagan
Posts: 102
Joined: Sun Sep 09, 2007 4:32 am

Re: Are there any chess engines written in D?

Post by rreagan » Sat Oct 19, 2013 2:29 am

Don wrote:I think a D program could still be competitive with a C program and although Go is fast and native I have my doubts it will every rival C in performance. When I say "rival" I don't mean within 20 or 30% but I mean really fast, like within 5%...
Don, do you think this linear performance difference is that significant? If your engine was 10% slower, doesn't that amount to about 5 ELO? I have often wondered if it would be better to sacrifice some raw speed for an easier time programming. For instance, would you sacrifice 10% NPS speed if you could test twice as many ideas per year? Or is the answer different when you're competing for #1 compared to the rest of us hobbyists?

Post Reply