writing chess engine in java or c#

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

kaustubh

writing chess engine in java or c#

Post by kaustubh »

I think we can write a chess engine in java or c# and convert it to native windows or linux code by available compilers . Since native code is faster than VM code the engine will give same performance as other engines written in c or c++.
nczempin

Re: writing chess engine in java or c#

Post by nczempin »

kaustubh wrote:I think we can write a chess engine in java or c# and convert it to native windows or linux code by available compilers . Since native code is faster than VM code the engine will give same performance as other engines written in c or c++.
Well, your reasoning is flawed.

Your assumption is: "available compilers that compile Java code will produce code equivalent to hand-coded C". To support all the Java features such as Garbage collection and Array Bounds Checking, the compiled code will have to have libraries to support all that.

In the end, the difference is not all that significant.

I encourage you to try playing Eden 0.0.11 "JA version" (compiled by Jim Ablett in exactly the way you propose) against the Eden 0.0.11 "server" version, which uses the "Just-in-time" Virtual Machine.

You should not see a major difference in strength.


Edit: Oh, and as regards the general competitiveness of Java engines vs. native engines, please to a search in this forum on the keyword "Java". The subject has been beaten to death IMHO.