Are there any chess engines written in D?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Are there any chess engines written in D?

Post by rreagan »

Are there any chess engines written in D?
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Are there any chess engines written in D?

Post by Don »

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 4:38 am
Location: Schenectady, NY

Re: Are there any chess engines written in D?

Post by Ron Murawski »

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: 291
Joined: Wed May 08, 2013 6:49 am

Re: Are there any chess engines written in D?

Post by Jhoravi »

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 4:27 pm

Re: Are there any chess engines written in D?

Post by Don »

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 6:32 am

Re: Are there any chess engines written in D?

Post by rreagan »

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 4:27 pm

Re: Are there any chess engines written in D?

Post by Don »

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: 291
Joined: Wed May 08, 2013 6:49 am

Re: Are there any chess engines written in D?

Post by Jhoravi »

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 4:27 pm

Re: Are there any chess engines written in D?

Post by Don »

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 6:32 am

Re: Are there any chess engines written in D?

Post by rreagan »

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?