lua-users home
lua-l archive

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

Hash: SHA1

2000-06-20-22:44:07 Lenny Palozzi:
> I was thinking about using Lua in a project to not only handle any
> scripting needs but also for the definition and storage of the
> structured data. Has anyone struggled with the decision of using Lua or
> XML in their project? What are your thoughts?

Just to elaborate on the remarks from Steve and Luiz, both of whom I
agree with entirely, I think what you might want to consider, if Lua
seems to be a good fit for your needs otherwise, is choosing as your
working structured data representation, actual Lua source code.
That's Luiz's major point --- using Lua source code as a structured
data representation was one of the original design purposes of Lua.
It's simple and clean and easy on the eyes, not particularly tricky
to generate and a real piece o' cake to read.

And to sorta touch on the way Steve was thinking, if you should
consider export of your structured data to other, unrelated tools to
be a valuable goal to keep in mind, perhaps as you're designing your
data format you might want to build a parallel representation in
XML. XML is also fine for representing structured data; it's just
that XML parsers tend to weigh in astonishingly much bigger than
Lua. Then, so does just about anything else, Lua is special that

So anyway, rather than inflicting the hassle of generating and
parsing XML upon yourself any time you want to touch some data, it
might be less pain all around to regard it as an external
import/export interface, and do translators. If you've kept in mind
a parallel XML representation as you've developed your Lua data
format, the translators shouldn't be too hard to build from parts
you may have lying about the workshop. I'd personally tend to reach
for a perl if I had to parse an XML, but that's just me, there are
other ways to get there.
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: For info see