writing chess engine in java or c#
Moderators: hgm, Rebel, chrisw
writing chess engine in java or c#
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++.
Re: writing chess engine in java or c#
Well, your reasoning is flawed.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++.
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.