Subject: Re: XML Parser

The answer is just that XML is easier to work with for many purposes.
XML is easily extensible as you can add features to XML DTDs without
invalidating earlier versions of the DTD or XML documents implementing
those DTDs. Debugging applications which take in or put out XML is
much easier than with many other means of serializing data.

I say use Lua to serialize your data. There are some extensions that take a
Lua table (an associative array) and serialize it in a form that it results
in valid Lua code that can be read, compiled by its parser and queried by
Lua scripts and by using its API. Lua begun as a configuration language.

I think the Lua overhead in terms of program size is less than most XML
parsers, and you even get scripting capabilities for your engine as a side
effect :slight_smile:

Cheers,

Andre________________________________________________________________
Mensagem enviada pelo Microlink Webmail 12.7.8p3

Hi,

Beware of the side effects of using a programming language as configuration
files.

I am not against it, if it fits your purposes, otherwise it might be a
source of big headaches.

When I was at CERN, the ATLAS project start using python as a configuration
language,
instead of ini or xml based files. All well and good until people started
mixing code with
configuration. Then new rules had to be set into place about what was
allowed to be
used in such files to avoid maintainance chaos.

Cheers,
PauloOn Wed, Apr 15, 2009 at 3:00 PM, Aleirade wrote:

The answer is just that XML is easier to work with for many purposes.
XML is easily extensible as you can add features to XML DTDs without
invalidating earlier versions of the DTD or XML documents implementing
those DTDs. Debugging applications which take in or put out XML is
much easier than with many other means of serializing data.

I say use Lua to serialize your data. There are some extensions that take a
Lua table (an associative array) and serialize it in a form that it results
in valid Lua code that can be read, compiled by its parser and queried by
Lua scripts and by using its API. Lua begun as a configuration language.

I think the Lua overhead in terms of program size is less than most XML
parsers, and you even get scripting capabilities for your engine as a side
effect :slight_smile:

Cheers,

Andre


Mensagem enviada pelo Microlink Webmail 12.7.8p3


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yeah, as a full-featured programming language it can certainly be abused
when used as a configuration file.

But for games, I don’t think this is an issue. The configuration is shown to
users in a UI and they never get to see the configuration file, unless
they’re looking for it.

In this case, you can hide its content by means of compression or
cryptography. Of course this won’t stop the more motivated, but running Lua
in a sandboxed environment will prevent configuration files deleting files
in the hard disk and such. It will not prevent infinite loops though.

Cheers,

Andre

--------- Mensagem Original --------De: Paulo Pinto
Para: Aleirade , A list for developers using
the SDL library. includes SDL-announce
Assunto: Re: [SDL] Subject: Re: XML Parser
Data: 15/04/09 10:11

Hi,Beware of the side effects of using a programming language as
configuration files.I am not against it, if it fits your purposes, otherwise
it might be a source of big headaches.When I was at CERN, the ATLAS project
start using python as a configuration language,
instead of ini or xml based files. All well and good until people started
mixing code withconfiguration. Then new rules had to be set into place about
what was allowed to beused in such files to avoid maintainance chaos.
Cheers,PauloOn Wed, Apr 15, 2009 at 3:00 PM, Aleirade
<aleirade at sct.microlink.com.br> wrote:

> The answer is just that XML is easier to work with for many purposes.
> XML is easily extensible as you can add features to XML DTDs without
> invalidating earlier versions of the DTD or XML documents
implementing
> those DTDs. Debugging applications which take in or put out XML is
> much easier than with many other means of serializing data.

I say use Lua to serialize your data. There are some extensions that take
a
Lua table (an associative array) and serialize it in a form that it
results
in valid Lua code that can be read, compiled by its parser and queried by
Lua scripts and by using its API. Lua begun as a configuration language.

I think the Lua overhead in terms of program size is less than most XML
parsers, and you even get scripting capabilities for your engine as a side
effect :slight_smile:

Cheers,

Andre


Mensagem enviada pelo Microlink Webmail 12.7.8p3


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Mensagem enviada pelo Microlink Webmail 12.7.8p3