Archive: Sort-of a poll


Sort-of a poll
Hiya,

My question doesn't have any real bearing to the near future (NSIS 2), and I don't have any personal interest, and yet I'd still like to hear what you people think about it.. :D

As you all know, NSIS currently uses simple ASCII text scripts. These scripts are easy to read and easy to write. And aside from specific NSIS errors, there's very little that can break a compilation (unclosed string for example).

However, it's possible that in the end of the day, this flexibility actually has some damage: the syntax of NSIS commands is wide open, without a real standard "mode of operation". Also, it's very easy to use bad coding practices and write extremely ugly scripts in this way.

As a possible alternative, let's examine XML for a minute...
XML scripts in general are nothing new, and I think the idea even popped up shortly in this forum in several contexts.

Here's a list of why XML can be a Good Thing(TM):
- Flexible text encoding (not only ASCII), supports non-English chars
- Ordered structure (elements, attributes, etc.)
- Standards for data validation and file inclusion
- Better "intelligent" parsing capabilities
- Can be turned into user-readable documents (HTML, PDF, etc.) quite simply

On the other side, a pure text script offers the following
advantages:
- Smaller file size
- Less chances for syntax errors (XML validity more sensitive)
- More suitable for beginners
- Simpler parsing code by software?
- Back compatibility, DOH!

A problematic issue is whether XML is really humanly-readble or not - that's a philosophical debate (and sometimes a holy war). There are NSIS GUIs, but the script file itself is still manipulated directly in almost every case, so dealing with the file's contents must be convenient. In my personal opinion, it's better than regular text, but only up to a certain file size.

But anyway - What do you think? What would you prefer if you had the option to choose? And why?


Trying to code a complete installer in XML would be very complex. Especially when dealing with functions and callbacks.

However, its just a personal preference, and since NSIS has always used a script based approach switching now would mean current users would have to learn a completely new format. I think it would be nice if it was in XML format, but I don't think the development time is worth it since I don't see that much of a gain performance or feature wise.


On a related note (although the idea scares me) I know of at least one (but the name escapes me) programming language written *in* XML! Mad idea huh... but very portable.


Well I've personally worked with VoiceXML. I guess you could call it some sort of weird programming...? And of course there's XHTML but calling that thing programming is like comparing a VT100 with a Pentium 4. :cool:

XML is used in a lot of areas, for many diverse uses - for some reason it was considered as "cool", and consequently there are a lot of nifty tools and uses for it. 'Cause, like, it's something to write in a resume.

And as a reply to Rainwater: I can think of several vastly popular products that use XML scripts. Take Jakarta Ant for example - the de facto standard for Java-oriented project building - it uses XML scripts very successfully in both private and enterprise projects alike. And it deals with functions very well. All you need is a well defined methodology.

Personally I actually agree that NSIS won't quite benefit from XML (too much effort, not enough value) but it's nonetheless interesting to see the rationale of other people.


Its always possible from someone to create a XML schema that could then be transformed to nsi script format.


Oh I'm sure writing a schema will be very easy, and even if not there are tools that can do it for you.

My guess is that the hard part will be designing that schema, and convincing people that it's worth a spit. ;)


Originally posted by Daab
Oh I'm sure writing a schema will be very easy, and even if not there are tools that can do it for you.

My guess is that the hard part will be designing that schema, and convincing people that it's worth a spit. ;)
The only real use I see, would be for a NSIS development tool to use such an xml schema. A tool like that would need an format that is easily parsable. None of this would really need to be implemented in NSIS, but in some type of external library.