News for hackers. Stuff that matters.
Re:I Made a Chess Library in Java by durbat on Thursday April 02, 2020 @04:47PM (#22763607)
You need to switch your data representation to 0x88 [1] or bitbords [2] to get anything performant. You won't get anywhere with a class hierarchy

[1] https://www.chessprogramming.org/0x88 [2] https://www.chessprogramming.org/Bitboards

Re:I Made a Chess Library in Java by thom on Thursday April 02, 2020 @05:50PM (#22764270)
If someone just wants a library to power a chess UI this isn't really necessary. Either way I'd suggest the author finish off the current implementation until they can get perft and other automated tests up and running first.

That said, chess programming is a _wonderful_ education in Computer Science, and you'll be following in the footsteps of so many great figures in the industry. Understanding bitboards and how to work with them can take you all the way from the bit-twiddling chapters of The Art of Computer Programming, right up to recent advances in CPU architecture and instruction sets. Learning how search works will teach you both very low techniques and high level heuristics in performance optimisation. And of course you can go all all the way up to recent advances in evaluation from deep learning.

Re:I Made a Chess Library in Java by reitzensteinm on Thursday April 02, 2020 @10:09PM (#22765777)
You need to consider the goals of a project before giving advice.
Re:I Made a Chess Library in Java by durbat on Friday April 03, 2020 @02:33AM (#22766758)
OP mentions chess AI and game analyzer. Those would benefit from an optimized data representation.
Re:I Made a Chess Library in Java by reitzensteinm on Friday April 03, 2020 @04:52AM (#22767388)
But both can also be written optimizing for simplicity and clarity at the cost of performance.

Competing with the state of the art is not an implicit goal for every project.

Re:I Made a Chess Library in Java by saagarjha on Thursday April 02, 2020 @05:13PM (#22763933)
Perhaps they don’t need anything performant? You don’t need a bitboard for everything. (They’re also not always performant.)
Re:I Made a Chess Library in Java by blackflame7000 on Thursday April 02, 2020 @06:17PM (#22764477)
Yea and you probably also need OpenCL or CUDA and several GPUs to get anything really “performant”. The basic OO model is good for its own purposes
Re:I Made a Chess Library in Java by voz_ on Thursday April 02, 2020 @05:37PM (#22764156)
If the API is well written, this is an implementation detail.
Re:I Made a Chess Library in Java by durbat on Friday April 03, 2020 @02:41AM (#22766799)
Well, it depends on the project goals. For a GUI app I can agree but good luck writing a chess engine where data representation is hidden behind an abstract interface.
Re:I Made a Chess Library in Java by blackflame7000 on Friday April 03, 2020 @06:02AM (#22767714)
Abstract as in using bit-boards or proper abstraction as in giving a clean interface to interact with a model and let the implementation worry about itself?