Complete.Org: Mailing Lists: Archives: freeciv-dev: September 1999:
Re: [Freeciv-Dev] Adding scripting language
Home

Re: [Freeciv-Dev] Adding scripting language

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Martin Willemoes Hansen <mwh@xxxxxxxxxxxx>
Cc: Artur Biesiadowski <abies@xxxxxxxxx>, Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] Adding scripting language
From: Jules Bean <jmlb2@xxxxxxxxxxxxxxxx>
Date: Wed, 01 Sep 1999 22:04:14 +0100

Martin Willemoes Hansen wrote:
> 
> Umh this is just an gennerel idea.
> 
> Could it be posible to have more than one scripting language? Like using
> some kind of binding scheme?

Yup, it could be done.

The standard way to do this would be to externalise all the functions we
plan to make available to the scripting language as a
dynamically-loadable C library.  Then all the major players (python,
perl, guile, tcl) have different, but well-known, ways of 'wrapping' a C
library with the language.

The more complex bit is 'genericising' the interface for actually
plugging in the appropriate virtual machine.  If we really wanted to be
clever, we could instead have a separate perl/python/guile process which
communicates (using the above mentioned C library) with the civserver
process by (for example) a unix-domain socket.

In fact, one of the main design points of guile is supposed to be the
simplicity with which other languages can be implemented in it - so, the
theory went, once you've embedded guile in your app, you've embedded
them all.  Sadly, there aren't many languages implemented 'in-guile' in
this way (that I know of).

Jules

-- 
/----------------+-------------------------------+---------------------\
|  Jelibean aka  | jules@xxxxxxxxxxxxxxx         |  6 Evelyn Rd        |
|  Jules aka     |                               |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@xxxxxxxxxxxxxxxx        |  TW9 2TF *UK*       |
+----------------+-------------------------------+---------------------+
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |
\----------------------------------------------------------------------/

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