Re: How to add Guile support to a package

2015-01-06 Thread Hans Aberg
> On 5 Jan 2015, at 18:34, Antonio Ceballos wrote: > This is only a rough plan, but one of the things that I have in mind is > to allow users provide their own evaluation function as an Scheme > expression. That would be possible when GNU Chess is run in a > especial new mode whereby the Guile e

Re: How to add Guile support to a package

2015-01-06 Thread Antonio Ceballos
Thanks for your advice, and thanks to all of you guys for your warnings and suggestions. Definitely, I will get back for review when I have something. Regards, Antonio On Mon, Jan 5, 2015 at 8:45 PM, Ludovic Courtès wrote: > Antonio Ceballos skribis: > >> For that purpose, I think that I need

Re: How to add Guile support to a package

2015-01-05 Thread Ludovic Courtès
Antonio Ceballos skribis: > For that purpose, I think that I need both to embed Guile into Chess, > and to export some primitives that could be used as building blocks > for the Scheme evaluation function. > > Does it make sense? Yes, definitely. If you want, once you’ve settled on an API, you

Re: How to add Guile support to a package

2015-01-05 Thread Antonio Ceballos
Hi Ludo, Thanks for your support. This is only a rough plan, but one of the things that I have in mind is to allow users provide their own evaluation function as an Scheme expression. That would be possible when GNU Chess is run in a especial new mode whereby the Guile evaluation function would r

Re: How to add Guile support to a package

2015-01-05 Thread Ludovic Courtès
Hi, I think the question to ask is what you want to enable with Guile. Probably you’ll want to export some of the functions and data types of Chess to Scheme, which can be done using the libguile C interface. Another question is whether you want to embed Guile into Chess, or whether you want to e

Re: How to add Guile support to a package

2015-01-05 Thread Hans Aberg
> On 5 Jan 2015, at 17:27, Chris Vine wrote: > > On Mon, 5 Jan 2015 15:44:16 +0100 > Hans Aberg wrote: >> Guile is written entirely in C, so there is no problem. > > You referred to using C++ global objects with gc on Darwin, which is the > subject I am interested in. You did so presumably b

Re: How to add Guile support to a package

2015-01-05 Thread Chris Vine
On Mon, 5 Jan 2015 15:44:16 +0100 Hans Aberg wrote: > > On 5 Jan 2015, at 14:18, Chris Vine > > wrote: > > > > On Mon, 5 Jan 2015 11:05:31 +0100 > > Hans Aberg wrote: > > >> There is an issue when using C++ global objects having initializers > >> doing allocations, on platforms (as on OS X) wh

Re: How to add Guile support to a package

2015-01-05 Thread Hans Aberg
> On 5 Jan 2015, at 14:18, Chris Vine wrote: > > On Mon, 5 Jan 2015 11:05:31 +0100 > Hans Aberg wrote: >> There is an issue when using C++ global objects having initializers >> doing allocations, on platforms (as on OS X) where the GC initializer >> must run first. > > Does this include guile

Re: How to add Guile support to a package

2015-01-05 Thread Chris Vine
On Mon, 5 Jan 2015 11:05:31 +0100 Hans Aberg wrote: > > > On 5 Jan 2015, at 10:19, Antonio Ceballos > > wrote: > > > GNU Chess has not been using the garbage collector so far. > > There is an issue when using C++ global objects having initializers > doing allocations, on platforms (as on OS X)

Re: How to add Guile support to a package

2015-01-05 Thread Hans Aberg
> On 5 Jan 2015, at 10:19, Antonio Ceballos wrote: > GNU Chess has not been using the garbage collector so far. There is an issue when using C++ global objects having initializers doing allocations, on platforms (as on OS X) where the GC initializer must run first.

Re: How to add Guile support to a package

2015-01-05 Thread John Darrington
You might want to have a look at how this was done for Gnubik. Some years ago we added a Guile interface to that. Maybe you can get some inspiration there. J' On Sun, Jan 04, 2015 at 02:47:03PM +0100, Antonio Ceballos wrote: Hi Guile folks, I am thinking about adding guile sup

RE: How to add Guile support to a package

2015-01-05 Thread Antonio Ceballos
Hi Matt, Thanks for your reply. Yes, at the current stage maybe my question is rather concerning GNU auto tools. I have also read the sections you pointed out in the Guile manual. GNU Chess has not been using the garbage collector so far. I have added these lines in configure.ac: dnl AC_ARG_EN

Re: How to add Guile support to a package

2015-01-04 Thread Matt Wette
What you propose seems reasonable to me. Though I have not use the AC stuff enough to say how to do it. There is a section in the guile manual (Section 5, Section 6.4 of 2.0 manual) on embedding guile into your own program. I believe you will need to call scm_with_guile() to get into debug mod

How to add Guile support to a package

2015-01-04 Thread Antonio Ceballos
Hi Guile folks, I am thinking about adding guile support to GNU Chess. As it would be used as a kind of debug mode, I don't want it to have it by default, so as to avoid usually unnecessary extra dependencies. I have gone through some tutorials, and have prototyped a guile-enabled version, but it