My aim is to, via pattern analysis and statistics, (as well as piece mobility and position) build a chess position evaluation analyzer (rather than simply going brute force ply-searching).
Id like to hear some thoughts a language that will be interesting/fun/challenging to learn and reason with. Ideally the language would have be well suited for:
- Statistical Analysis
- Pattern Analysis
- Native Array and Vector Operations
- Native Mathematical Functions
Note:
- I have no need for a GUI, and may not even get to the point of a ‘move engine’ but simply stop at a position evaluation engine
- I am not interested in speed.
- I am personally most comfortable with Python but I might be interested in trying something else. (though feel free to suggest this if you think it fits).
- I am particularly curious about how good a fit a functional language would be in this context.
5
When I read your requirements, I immediately thought of using R, like @JimmyHoffa. In addition, I have done a great deal of programming in R (and Python). I think R is ideal for this kind of work because of:
- The large amount of statistical tools readily available. Think of Princple Component Analysis (PCA), all kinds of optimization techniques, etc. And if it is not already available there are many, many more packages available on the Comprehensive R Archive Network (CRAN), there are more than 3000 packages there. A nice way to explore these packages theme wise (e.g. econometrics, spatial data analysis, etc) is to look at the different Task Views that are available here.
- It is open source, and freely available.
- A large and active community which you can use to get answers to specific questions. For example, the R-help mailing list, or the [r] tag on StackOverflow.
- All the data structures you requested (floats, matrices, arrays, tables, etc).
-
A powerful, functionally oriented, syntax that suits the data oriented nature of data analysis well. Explicit
for
loops are rarely needed (although they exist in the language), instead you useapply
style loops. This means that you apply a function over a datastructure. For example, you can apply themean
function over the rows of a matrix to get the row means:apply(matrix, 2, mean) # where 2 is the dimension over which to apply
this shares some similarities with list comprehensions in python.
- Easy incorporation of C++, Fortran etc code for when you want to replace a performance critical section by compiled code.
1
I think your problem scope falls exactly into the purpose of R, though I have never written or worked with R. I have heard good things about it, and would strongly suggest you start looking into it.
http://www.r-project.org/
Coming from python this will be a large shift I’m betting since it’s functional, but I don’t know how pure it is so it may not be too bad if it’s got good multi-paradigm facilities.
If this doesn’t come out to be in your opinion elegant, I would then suggest two other languages:
-
The one I find to be most elegant of any I’ve ever seen, Haskell, which is declarative (which sounds like what you’re asking for in the way you frame your approach) and good for processing data sets.
-
And another one which facilitates declarative programming while having meta-programming facilities that has been shown to be invaluable in writing systems that analyze things with a bit more intelligence, LISP(or Scheme).
4
I’d suggest python with numpy and scipy. Since you are already familiar with python, and numpy and scipy give you the array and math functions you need.