[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] integration w/ GNU Guile

From: Gunnar Farnebäck
Subject: Re: [gnugo-devel] integration w/ GNU Guile
Date: Sun, 07 Apr 2013 12:31:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 04/06/2013 01:10 PM, Thien-Thi Nguyen wrote:
I'm (idly) interested in "lifting" some of the SGF / GTP stuff from C to
(Guile) Scheme, and then hacking at that level to add rectangular board
support.  Depending on how amenable the internals are (i haven't looked
closely in a number of years), maybe a side-effect could be the exposure
of some modules to Scheme, too.  Could be useful for testing, and other
runtime experiments (switching algorithms, tuning heuristics, etc).

The SGF format doesn't support rectangular boards, although the only thing really missing is a property to specify a rectangular size. The SGF code in GNU Go internally works with strings and x/y coordinates, so there's no additional complications at that layer.

GTP is similar. There's no standard way to specify a rectangular board but there's nothing complicated about adding a private command for that.

GNU Go engine internals is a different matter though. The 1D board representation is flexible enough to easily handle a rectangular board but anywhere there are 2D loops these need to be rewritten with separate width and height. Basically every occurrence of board_size in the code is potential trouble.

Then there is pattern matching. I really don't know whether any part of that relies on the board being quadratic. The fuseki code definitely does but that should be okay to disable for rectangular boards.

Does this sound interesting?  What are the chances that such an effort
could find its way into the GNU Go code repo proper?

In case it actually works and doesn't substantially negatively affect the maintainability I'd be happy to merge it in.

Changes to only SGF or GTP code is unlikely to be very interesting though. There's not much that can be done there anyway and without support from the engine internals there's no substance to it.

Just to be preempt the obvious suggestion, i'm NOT interested in hacking
C (more than necessary) in GNU Go for this (rectangular board support)
or any other itch.  Life's too short...

I haven't done anything in Scheme for 20 years and never looked at Guile but if it has any kind of builtin high level data structures you are probably better off implementing SGF support natively. I would guess it takes more code just to interface to a C library. Depending on what you want to do with GTP in Scheme the situation may be the same. If you're looking into a way to drive GNU Go code generation from a high level language the main obstacle is probably everything that happens in the main() function before control is handed over to the GTP main loop.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]