Complete.Org: Mailing Lists: Archives: freeciv-dev: September 1999:
Re: [Freeciv-Dev] Script implementation
Home

Re: [Freeciv-Dev] Script implementation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Artur Biesiadowski <abies@xxxxxxxxx>
Cc: Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] Script implementation
From: Jules Bean <jmlb2@xxxxxxxxxxxxxxxx>
Date: Thu, 02 Sep 1999 22:18:16 +0100

> Scripts will be mostly embedded into rulesets.
> 
> [building_hydro_plant]
> name        = "Hydro Plant"
> tech_req    = "Electronics"
> obsolete_by = "None"
> is_wonder   = 0
> build_cost  = 240
> upkeep      = 4
> can_build = SCRIPT guile
> (
> .. script
> )
> ENDSCRIPT
> 
> Normal parser will real ruleset, when it will spot script keyword in
> correct place, it passes stream/text to SVM.  As we may want to have few
> dialects translating to same VM, type of script is next - but this is
> resolved by SVM. Call will be something like

OK.  Let me interject here to say that this is a very different solution
from the one I am thinking about.  I'm *definitely* not actually
claiming that mine is superior - I can see many advantages to Artur's -
but I want to outline the alternative approach.  To emphasise that I
don't speak for the project, and that this is just a personal project of
mine, I will call it 'jules-freeciv' below :)

I will be completely (but gradually) removing the ruleset files.  There
will be no parser in jules-freeciv at all.  Instead, jules-freeciv will
load object files in my bytecode, and the object files will include
both  the data and the scripts - which I prefer to call code.

This is good, in the jules-freeciv doesn't need to have the hooks to be
a parser/compiler, but bad in that an external compiler is necessary, so
working with jules-freeciv rule-objects requires an extra compile step.

My VM was originally conceived for another game, and the goal was to
provide what is predominantly a data format (and OO data format), and
secondarily can include simple code for cases when constant data isn't
appropriate.

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]