Chess programs in functional languages?

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Chess programs in functional languages?

Postby Vladimir Medvedev » 24 Mar 2006, 08:53

I am looking for chess sources in functional languages. The only one I found yet is small chess program in PicoLisp package.
Are there any other open-source chess implementations in Lisp, Scheme, *ML, maybe Haskell?
User avatar
Vladimir Medvedev
 
Posts: 129
Joined: 29 Sep 2004, 10:03
Location: Moscow, Russia


Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:31

Picolisp has a tiny Lisp chess program in it:

http://software-lab.de/down.html
Dann Corbit
 

Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:33

Dann Corbit
 

Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:35

Dann Corbit
 

Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:37

This Lisp book has a chess program in it:
http://www.amazon.com/gp/product/038797 ... e&n=283155
Dann Corbit
 

Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:39

BCE has a lisp version:
http://wiki.bowron.us/index.php/BCE
Dann Corbit
 


Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:44

Dann Corbit
 

Re: Chess programs in functional languages?

Postby Dann Corbit » 25 Mar 2006, 03:46



Here is a Haskell chess binary (but no source):
http://bryn.humberstone.id.au/computer/index.php
Dann Corbit
 

Re: Chess programs in functional languages?

Postby Jonatan Pettersson » 25 Mar 2006, 18:28

What's the pro's of functional language programming? The course I took in it left me kinda undecided, seems they're pretty good at recursion and that should be good when programming chess.

Anything else?
Jonatan Pettersson
 
Posts: 8
Joined: 26 Dec 2005, 00:10

Re: Chess programs in functional languages?

Postby Vladimir Medvedev » 27 Mar 2006, 12:42

Thank you very much!
What a rich link collection! :D
User avatar
Vladimir Medvedev
 
Posts: 129
Joined: 29 Sep 2004, 10:03
Location: Moscow, Russia

Re: Chess programs in functional languages?

Postby Tord Romstad » 27 Mar 2006, 14:32

Jonatan Pettersson wrote:What's the pro's of functional language programming? The course I took in it left me kinda undecided, seems they're pretty good at recursion and that should be good when programming chess.

Anything else?


I'm too busy to write much about the topic right now, so I will just point you to the Wikipedia page on functional programming. As everything on Wikipedia, it should be taken with a grain of salt, but after skimming through the functional programming article I didn't notice any glaring mistakes or omissions.

Andrew Fan wrote:Most functional languages uses lists or sets, their main strength is in backtracking and solving problems that cannot be described in algorithmatic fashions.

E.g. In (micro)Prolog you can ask questions like "Who are Mary's cousins" by just giving (enough) information about Mary's family tree, without specifying the direct relationship between Mary and her cousins - you need to define cousins though.

So may be the ultimate goal is to be able to ask the computer "What is the best move here?" and get an answer :)


You are confusing functional programming languages with logic programming languages, which are not the same. Prolog is a logic programming language. The most well-known functional programming languages are probably ML and Haskell.

For chess programs in functional languages, I have seen numerous simple toy programs, but never anything resembling a serious, competitive program. For efficiency reasons, I don't think a pure functional approach is likely to work well in computer chess. If we can't destructively modify the board data structure, we will have to do too much expensive copying during the search. This doesn't necessarily imply that a strong chess program cannot be written in a functional language, but only that not all parts of the program would be written in a functional style. I think it would be possible to write a strong chess program in an impure functional language like ML, although I am not sufficiently fluent in ML to do it myself. One of the countless things I would like to do some day is to write a serious chess program in Common Lisp, but it will probably mostly use imperative rather than functional techniques (contrary to popular belief, Common Lisp isn't really a functional language, but a multi-paradigm language).

Learning at least one functional programming language is well worth the effort, even if you will never use it for any serious task. It gives you a new way of thinking about programming, and can sometimes help you find original and elegant solutions to problems you encounter when programming in main-stream imperative or object-oriented languages.

Most programmers probably never see anything else than main-stream languages like Pascal, C, C++, Java, Perl and C#. I think this is a great pity. Being at least superficially familiar with the whole plethora of programming paradigms is very rewarding. A nice set of languages to study would be Haskell, Prolog, Common Lisp and SmallTalk. This is just my selection; I am sure it would be possible to come up with other, equally good selections.

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: Chess programs in functional languages?

Postby Dann Corbit » 27 Mar 2006, 20:58

Steven Edwards was working on an interesting hybrid program with C++ and lisp.

He has diabetes and other medical problems and he has not posted for a while.
Dann Corbit
 


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 9 guests