Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Idea] - OpenRC with XML?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon May 12, 2008 7:14 pm    Post subject: Reply with quote

Sparky Bluefang wrote:
I think this discussion is pretty moot. Systems like OpenRC will never implement it because they don't want/can't have the dependencies. And your idea of side-by-side config files would just end up being much more confusing and adding much unneeded complexity. Plus, you are forgetting that to have it side-by-side, you still have the compile/run time dependencies of he XML library, even if you aren't using it.

This is also why I suggested the API direction at the end of my post. An application linked against the library would not result in having to manage both, hence no side-by-side configuration data.

Sparky Bluefang wrote:
XML does have its uses. It's great for representing documents (DOM) and hierarchical data. But it is horrible for tables and large amounts of data. there is a degree of overhead with the XML structure and it can easily get extremely messy.

I'm also persuaded that XML representations aren't necessarily messy all the time. It's also quite possible to do things perfectly and provide XML representations that are perfectly readable.

Sparky Bluefang wrote:
I also do not know where people get off on saying that it's "human readable". They've evidently never dealt with extremely large amounts of data or data in tables. In fact, I'm currently employed by IBM to develop and write software so they don't have to deal with XML by hand because it is a nightmare when you have a 150 X 150 table of characters representing wafer/chip locations and you have to change one character in that table to deselect a chip (along with pushing that data, and more, back a forth between various formats).

Hence my "chapter" :wink: about XML databases in one of my posts. There are situations where XML doesn't fit, like dealing with large amounts of data - if things must remain readable and usable, XML files must remain rather small, i.e. no larger than about 50 KB. There are also recommendations on using XML and not everybody follows them - for many reasons.

Sparky Bluefang wrote:
Config files are neither documents or (generally) hierarchical data, so I don't see how XML can do anything other than get in the way of the actual data.

Maybe I'm suggesting this too early, don't know. In fact such a feature would probably be best implemented in GUI appllications first rather than inside the system. I still think however there are too many configuration styles, which will need to be harmonized, standardized some way. So, yes, maybe OpenRC is not the best spot to start implementing this in the first place.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
AllenJB
Veteran
Veteran


Joined: 02 Sep 2005
Posts: 1285

PostPosted: Mon May 12, 2008 8:34 pm    Post subject: Reply with quote

You still haven't answered the question of support. Who's going to support this software once you've thrown your XML/XSLT configuration in front of its normal configuration handling?

You go into $software channel ask for some support, they then ask you to show them your configuration at which point you put this new XML format they've never seen before and as far as they know doesn't work with their software in front of them and they are just going to laugh at you and tell you to use a distro which doesn't mangle their perfectly good config files.

Your arguments are also extremely confusing because you keep advocating that this new format will either be usable side-by-side with the current configuration formats or will use XSLT to transform the XML into the format the application recognises, then you say that there would be no side-by-side usability. Which is it?

If there is side-by-side usability, you're going to increase the size and complexity of packages, which isn't going to:
a) bode well for maintainability
b) be popular with people who have severe restrictions (eg. embedded)

Either way, many applications are little more than shell scripts calling other applications. How do you link a shell script against a C library?

As for my opinion, you're suggesting this before the end of time, so yeah, you're suggesting it far too early.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Mon May 12, 2008 8:54 pm    Post subject: Reply with quote

AllenJB wrote:
You still haven't answered the question of support. Who's going to support this software once you've thrown your XML/XSLT configuration in front of its normal configuration handling?

Support is for when there is a project that lives, I'd say. Given the current state of the discussion, it's far from beginning ;) .

AllenJB wrote:
Your arguments are also extremely confusing because you keep advocating that this new format will either be usable side-by-side with the current configuration formats or will use XSLT to transform the XML into the format the application recognises, then you say that there would be no side-by-side usability. Which is it?

Right, I'm sorry for that. I haven't been quite clear but, pardon me, that's how I often get off an idea and try to discuss it with friends or colleagues. I was in fact developping two ideas: one side-by-side (mainly from OpenRC) and lastly a replacement with proper APIs, more targeted against compiled applications.

The side-by-side idea looks quite compromised, AFAICS, although I liked the principle of providing kind of a transition towards configuration data inside XML files, especially for OpenRC. I imagined at first a transformation of XML config data to provide the legacy configuration file. The next would have been OpenRC ready for reading directly from XML configuration files.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue May 13, 2008 1:57 am    Post subject: Reply with quote

VinzC wrote:
steveL wrote:
XML sucks for config info (and a lot of the other uses it's put to imo.)

I retain the sentences
Quote:
It is not human-readable.

Quote:
It is not efficient.

This is completely untrue since that assertion is in absolute contradiction with the XML specifications.

Oh please you don't really think specs are reality do you?
Quote:
XML is by definition human-readable *and* machine-readable.

It's human-readable; that doesn't mean it's easy to read. It's machine-readable. That doesn't mean it's efficient.
Quote:
However it is true, like with HTML, that it's possible to provide badly designed or written XML. XML doesn't necessarily mean human-readable if one doesn't take the required precautions.

It does actually, just not very easy to read. And there's way too much cruft nowadays: XML as it was originally designed was cool; principally as a means of data interchange. Everything else is just chasing a buzzword imo. GuideXML is a great example of how XML should be used for documents, and it's miles away from what goes on with XML most other places, and indeed your own suggestion.
Quote:
It's also true that there are good and bad usages of XML. I've always fought the idea of XML databases for instance. But this is only an extension of what I wrote previously about the length of a good XML file.

That's not really that important imo; the simple fact is it's awfully easy to write crap XML, and since it rarely gets eyeballed (we just bung into the machine remember, it's machine-readable and then you see a nice tree that's taken 20 years of tech just to display when you could have shown, represented and manipulated the same thing with tech from 30 years ago) it's not maintained except by machines. Most people who work with it do so at a remove and when they do go to look at the file directly it's a nightmare to parse.

Quote:
Saying XML sucks is like assuming nobody can write proper XML. I don't subscribe to this point of view.

No it's just saying the format got taken over (principally by M$ and Sun) to maintain their "competitive advantage" and now you see people who can't accept that the whole thing was frankly a pile of crap. There was the germ of a good idea, but it was too simple. But hey, Windoze has been a pile of crap for even longer, go figure. Yet people have spent their entire lives within that ecosystem; scary outside eh? ;)

FWIW you should look at Natural language processing imo. Far more interesting than a format that was meant as a temporary flow between databases. Yeah the structure was supposed to be more fixed, but it was only that: plumbing to get round SQL incompatibilities and vendor lock-in (ironically enough). SGML was far more extensible, XML was a dumbed-down version for this purpose. You're much better off with latex or docbook rst for the interesting stuff, and plaintext config files.

Keeping it simple doesn't mean stupidity or lack of evolution: it's about not adding complexity that doesn't improve anything.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9525
Location: beyond the rim

PostPosted: Tue May 13, 2008 3:52 am    Post subject: Reply with quote

Is this really about getting XML support in config files, or is there a more generic goal behind this idea?
IMO it's usually a good idea to define the problem you're trying to solve before you start to look at possible solutions. And somehow I don't think that the problem here is really "lack of XML support".
Back to top
View user's profile Send private message
AllenJB
Veteran
Veteran


Joined: 02 Sep 2005
Posts: 1285

PostPosted: Tue May 13, 2008 8:12 am    Post subject: Reply with quote

Excellent article on XML from IBM: http://www.ibm.com/developerworks/xml/library/x-sbxml.html
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue May 13, 2008 10:51 am    Post subject: Reply with quote

VinzC wrote:
I retain the sentences
Quote:
It is not human-readable.

Quote:
It is not efficient.

This is completely untrue since that assertion is in absolute contradiction with the XML specifications.
steveL wrote:
Oh please you don't really think specs are reality do you?

Well, sorry, I should have rephrased myself: the reason for the existence of XML :oops: .
steveL wrote:
GuideXML is a great example of how XML should be used for documents, and it's miles away from what goes on with XML most other places, and indeed your own suggestion.

I'll take a look at that. Thanks for the info.
steveL wrote:
FWIW you should look at Natural language processing imo. Far more interesting than a format that was meant as a temporary flow between databases. Yeah the structure was supposed to be more fixed, but it was only that: plumbing to get round SQL incompatibilities and vendor lock-in (ironically enough). SGML was far more extensible, XML was a dumbed-down version for this purpose. You're much better off with latex or docbook rst for the interesting stuff, and plaintext config files.

Keeping it simple doesn't mean stupidity or lack of evolution: it's about not adding complexity that doesn't improve anything.

You're probably right. The matter is that XML was my only idea at that moment. However, should I have suggested Latex or whatever language, the answer would all have been the same about OpenRC, wouldn't it? (aka no external dependency, only what a POSIX shell supplies.) I guess your suggestion for a natural language goes with my second suggestion, i.e. harmonize application configuration languages?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue May 13, 2008 10:59 am    Post subject: Reply with quote

Genone wrote:
Is this really about getting XML support in config files, or is there a more generic goal behind this idea?
IMO it's usually a good idea to define the problem you're trying to solve before you start to look at possible solutions. And somehow I don't think that the problem here is really "lack of XML support".

It started from simplifying OpenRC [becoming horrible] configuration syntax by using another language (like XML from my first suggestion). Then, thinking further, I also suggested to harmonize application configuration syntaxes - including OpenRC or not. So I'd like in fact to discuss the problems I initially raised: syntax ugliness and the need for uniform configuration syntax, coming with API's and the like. Though it started from OpenRC configuration files, it has nothing to do with that anymore in fact. Start another thread?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
dnadesign
Apprentice
Apprentice


Joined: 23 Dec 2006
Posts: 172
Location: Poland

PostPosted: Tue May 13, 2008 11:34 am    Post subject: Reply with quote

I went into the topic for as much as checking the possible dependencies for implementing XML parsing abilities in OpenRC. Well, it seems that if one would use dev-libs/libxml2 in OpenRC it wouldn't make any problems regarding to the restrictiveness of OpenRC dependencies (as the first process run by init).
The main dependencies for libxml2 are python (which is almost default on Gentoo... portage, etc. :P ) and readline, so getting OpenRC to use libxml2 wouldn't be a problem. The questions are:
- Would it really be a better option?
- How would that influence OpenRC's efficiency?
_________________
MacBook Pro 5.1
Intel C2D 2.53 GHz, 4GB RAM DDR3, GF 9400M and 9600M GT 512MB
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue May 13, 2008 12:24 pm    Post subject: Reply with quote

AllenJB wrote:
Excellent article on XML from IBM: http://www.ibm.com/developerworks/xml/library/x-sbxml.html

I'd like to make a short parenthesis here.

While I agree on that Humans do have an innate ability to put structure markers all over the place, including the worst and most horrible ways, I disagree on some terms used, mostly the terms "the XML equivalent". There are more than one XML equivalent, whatever we need to put into XML. And that's also what I wanted to denounce: bad examples are used to demonstrate how XML is bad - I don't want to disagree XML is bad in this case but just that the examples were *not* the only ones that could apply.

The XML example about the math formula is not *the* XML equivalent but *one* XML equivalent.

The XML example about the SQL query is not *the* XML equivalent but again *one* XML equivalent.

The XML example about the Java course is not *the* XML equivalent but once more just *one* XML equivalent.

Representations do *not* always need to be modeled using elements. It all depends on what you choose. You (the modeler) decide whether to use attributes, elements or both. Ok, agreed, mixing both might make the XML <insert your prefered attribute here>. This is not my point.

Having worked with XML schemas for quite a long time now, I'd have prefered the following:
SQL query:
<person:query xmlns:person="..." props="email firstname lastname" cond="EID &gt; 100"/>

But it wouldn't have demonstrated the author's purpose. Although... But here, what's obvious is the &gt; which is required by the XML syntax. But I'm not trying to demonstrate anything here but there can be bad and better ways to use XML. Curiously enough, I see here only bad (but veeeeeery bad) examples, which serve, granted, the author's purpose.

Note again: I'm not trying to demonstrate the author's views are wrong, please note that.

I'm not trying to demonstrate my very own example is best or better, no. I'm just trying to demonstrate there are various ways to represent data in XML. The example I gave, of course, is linked to a schema that I've kept for myself because it doesn't have anything to do with what I'm demonstrating.

Another example:
Java Course:
<course xmlns:jvars="..." title="..." caption="..." mmlvers="2" intro="intro.mml" jvars:useApplets="false" ... modules="JavaIntro.mod vsCOBOL.mod" />


Again, I'm not trying to demonstrate the author's wrong, just the example he gave is *not* the only valid XML example. Valid XML examples depend on what you need to model and the XML techniques you use to provide variable content containers (yes, I'm coming back with that because it's always what comes to the scene, just like C++ polymorphism, believe me).

In fact no one but the author can tell whether the examples I gave do apply to the scenario he thought of. However, believe me, having spent years studying how to model objects using XML, how to use XML schemas best practices have made me pay much more attention than ordinary to such kinds of things.

I always use a schema when doing XML modeling. I always design my schemas carefully. I design my schemas and documents in a way that they can always be edited by humans in cases things go wrong. Hence, the shorter the better, for instance. Not sure everybody who uses XML for modeling does the same.

Again, I'm not attempting to write the apology of XML - listen, the last example the author gave is critical for demonstrating his point and I fully agree with him. Just that anybody doing XML without further thinking generally leads to a complete disaster.

I'm no longer trying to demonstrate XML *is* readable and *should* be used and groked by humans. I'm just oposing other kinds of examples to the ones the author chosed. It belongs to you to determine whether you like them more or not but again, this was not my point. And surely not the author's...

The last example from the author illustrates best what he wanted to demonstrate. Surely, XML put anywhere anyway is no good. There are matters for which XML applies. And yet even if XML applies, it should be designed with care.

Revisiting my own judgement from my very first post, I understand why XML shouldn't be used as an interface between human and machines - I recall the terms "useless noise". I agree with the author somehow.

Hope I've made it clear :D .
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Sparky Bluefang
n00b
n00b


Joined: 05 Jan 2008
Posts: 13
Location: Vermont, USA

PostPosted: Tue May 13, 2008 2:33 pm    Post subject: Reply with quote

@dnadesign
Those may be default on standard Gentoo systems, but OpenRC is designed to be run on other distros and (I think) on embedded systems. Not all of which have those dependencies or the space to have them.

@VinzC
That IBM article brings up a few interesting points:

Quote:

XML is just another data format, albeit an important and sophisticated standard format. In most cases, it makes sense to store or transmit your data in XML format with a few exceptions:

* When your problem is very simple
* When it would generate humongous files
* When your app is a "one-off"
* When you need to use Unix line-oriented text processing tools


I think at least half of those apply directly to this problem. Config files are generally very simple, and I don't think it's worth the overhead of the parser to do such a simple task. Likewise, they should be easily interacted with via command line tools, even if they are config files for GUI applications.

I agree, it would be very nice to have a standardized format, but I don't think XML is the answer. Personally, I think the NAME = VALUE scheme in some syntax or another is simple and straight forward enough.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9525
Location: beyond the rim

PostPosted: Tue May 13, 2008 3:57 pm    Post subject: Reply with quote

1) for OpenRC dependencies, one major aspect is that it resides in /bin, /sbin and /lib, and no file in there should depend on files located in /usr (as /usr could be on a separate filesystem that's not mounted when OpenRC starts)
2) It would be really a good idea to separate the different problems (uniform config syntax/API vs. ugly syntax in OpenRC config files) in different threads if you still want to discuss both, otherwise please make clear which problem is discussed in this thread. I've got comments on both aspects, but I'll wait until I know where I should post them ;)
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Tue May 13, 2008 6:27 pm    Post subject: Reply with quote

There is one point which was not mentioned at all: The (lack of) power of XML which is especially important for an init-system.
With an sh-based config you can write any tests you like (calling external programs, testing for "magic" files like /net-home, or whatever you want) and make the config (or parts of it) depending on these tests. This is especially useful if you use e.g. laptops in several changing environments (e.g. should the laptop go online right from the beginning, which interface/password/... to use when going online, etc). It would be extremely cumbersome to make something else that flexible and at the same time easily readable and changable.
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Tue May 13, 2008 6:29 pm    Post subject: Reply with quote

I agree everthing evvk and steveL have said (that I could understand).
God, save us from xml on gentoo for config files. It is more terricfic than a nightmare that zombies in it.
After spending two years with a zombie, I am sure you begin to enjoy from it.

VinzC, don't think this as personal attack. Because I know you from the post on forums and I do like you.
But this time you really scared me. :)

Xml is not human-readible. I am sure there are people who can even read and understand some binary formats. But that does not make it human-readible. Xml adds to much unrelated info favouring machines and it is not good for humans. Especially if the file is bigger and the definitions are a bit complex, then the human is fscked.

Who wants to examine a kernel .config file within xml format. !!!
_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Wed May 14, 2008 7:16 am    Post subject: Reply with quote

keenblade wrote:
VinzC, don't think this as personal attack. Because I know you from the post on forums and I do like you.

Oho! This is the nicest thing I've been told on this forum :-) . You made my day begin in a good mood. Thanks a lot. (No joke.)

keenblade wrote:
But this time you really scared me. :)

Sorry but this was a completely unwanted side-effect.

keenblade wrote:
Xml is not human-readible. I am sure there are people who can even read and understand some binary formats. But that does not make it human-readible. Xml adds to much unrelated info favouring machines and it is not good for humans. Especially if the file is bigger and the definitions are a bit complex, then the human is fscked.

Who wants to examine a kernel .config file within xml format. !!!

Erm, sure not for kernel .config. But again, I wasn't strictly sticking to XML, any other language would have been... well, ok.

Given the various reactions I read here, I start to understand how and why you, guys, keep a very skeptic eye upon XML. I just regret that the overall misuse of XML has made it lose quite a lot of credits. BTW, I admit, too, XML is not made for humans. Well, it should be kept away from being the only interface between Humans and machines, I agree.

So if a better interface, like an editor or a settings editor, is required to hide the ugliness of XML, that already makes too much complexity for a simple task as config files. I've understood, believe me :).
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Wed May 14, 2008 7:34 am    Post subject: Reply with quote

mv wrote:
There is one point which was not mentioned at all: The (lack of) power of XML which is especially important for an init-system.
With an sh-based config you can write any tests you like (calling external programs, testing for "magic" files like /net-home, or whatever you want) and make the config (or parts of it) depending on these tests. This is especially useful if you use e.g. laptops in several changing environments (e.g. should the laptop go online right from the beginning, which interface/password/... to use when going online, etc). It would be extremely cumbersome to make something else that flexible and at the same time easily readable and changable.

Believe me, you can make tests in XML. You can also call other applications if you like [EDIT: through XSLT, depends on the parser]. XML allows you to check and validate data through the use of schemas (RelaXNG, XML schemas, schematron,...) XSLT also allows for checks that schemas don't support, like cross dependency validations, for example. Say element A must be positive if element B exists. XML schemas can't perform such validation but XSLT can. You can embed XSLT in a schema. (I don't remember how it's called however.) There are various techniques for enforcing validation rules with XML and that's quite interresting, IMHO.

However it's true that if you only know of XML without schemas and XSLT, you can't perceive the full power of XML. It's like knowing how to compile... without linking, more or less. Another truth is this makes XML very intricate and wierd and twisted. BTW the whole set doesn't deserve the term "light"... This is probably one of the various reasons why XML is not well appreciated here.

[EDIT: Just spotted a mistake (how to compile).]
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!


Last edited by VinzC on Wed May 14, 2008 12:01 pm; edited 3 times in total
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Wed May 14, 2008 7:53 am    Post subject: Reply with quote

Sparky Bluefang wrote:
Personally, I think the NAME = VALUE scheme in some syntax or another is simple and straight forward enough.

Sure. But it has many limitations when considering, for instance, nested blocks. The VARIABLE = VALUE, as of now, can only be part of one single block, without further enhancement, e.g. like in most of shell config scripts.

What about brackets to distinguish blocks, like in BIND configuration files? This looks like a better compromise than XML to me, doesn't it? (Refering to "natural languages" as mentionned earlier in this thread.) Of course, I'm no longer talking about OpenRC since it would bring the same dependency problem (as opposed to strictly POSIX-compliance).
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Wed May 14, 2008 8:00 am    Post subject: Reply with quote

Genone wrote:
1) for OpenRC dependencies, one major aspect is that it resides in /bin, /sbin and /lib, and no file in there should depend on files located in /usr (as /usr could be on a separate filesystem that's not mounted when OpenRC starts)

Ah, this makes the perfect technical reason. Thanks a lot. This makes it perfectly clear now.
Genone wrote:
2) It would be really a good idea to separate the different problems (uniform config syntax/API vs. ugly syntax in OpenRC config files) in different threads if you still want to discuss both, otherwise please make clear which problem is discussed in this thread. I've got comments on both aspects, but I'll wait until I know where I should post them ;)

Agreed. I'll probably start a new thread. I'm thinking of a poll "should application configuration syntaxes be harmonized?"
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Wed May 14, 2008 8:01 am    Post subject: Reply with quote

VinzC wrote:
Believe me, you can make tests in XML. You can also call other applications if you like [EDIT: through XSLT, depends on the parser].

Sure, you might. But that's why I said "at the same time readable and easily changable". If you suddenly want to do something not planned before you have to define that task beforehand somewhere else. You cannot just insert some quick hack. It would be just a configuration nightmare: You must spend lots of effort into "how" to configure when you should really only think "what" to configure.
Quote:
It's like knowing how to compiling without linking, more or less.

This comparison is rather good: You practically have to compile a full program (having to deal with all the different config-files needed to compile a program) when all what you actually want are a few simple shell commands which in the end set some variable. Of course, the comparison is not perfect, because compiling might be worth this additional effort: You receive smaller and faster code at the end. With xml it is just the opposite: Huge resources, dependencies, and an enormous overhead are needed. So what was the point of making a simple configuration more cumbersome?
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Thu May 15, 2008 11:14 am    Post subject: Reply with quote

Genone wrote:
2) It would be really a good idea to separate the different problems (uniform config syntax/API vs. ugly syntax in OpenRC config files) in different threads if you still want to discuss both, otherwise please make clear which problem is discussed in this thread.

Here's the poll. (Should configuration syntaxes be harmonized?)
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9525
Location: beyond the rim

PostPosted: Thu May 15, 2008 10:12 pm    Post subject: Reply with quote

Well, for OpenRC the case is quite simple: The things you actually configure most of the time in OpenRC are init scripts (effectively shell scripts), and the most convenient way to configure a shell script is by sourcing another shell script. The problem with that approach, which makes the syntax ugly in some cases is that shell scripts don't support namespaces or some other way to separate groups of variables, so that information is often encoded in the variable name, which can look a bit messy.
If you think it through, OpenRC actually did follow your other suggestion and harmonized it's config syntax by eliminating the "non-standard" syntax of /etc/modules.autoload.d/*, don't you agree?

As for using XML (or some other format) as a secondary format that's only used when the primary is missing, or converted into the primary format (online or offline), that's be a huge mistake IMHO, because then you have to actively maintain, support and document two completely different formats. You make community support more difficult as most users will only know one one of the two formats (e.g. 50% know the shell-based, 50% the XML-based format) and therefore won't be able to help users that use the other format. New syntax features become more difficult to add because you have to implement/test them in both systems. You confuse new users because they aren't sure which syntax to use.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Fri May 16, 2008 8:59 am    Post subject: Reply with quote

Genone wrote:
Well, for OpenRC the case is quite simple: The things you actually configure most of the time in OpenRC are init scripts (effectively shell scripts), and the most convenient way to configure a shell script is by sourcing another shell script. The problem with that approach, which makes the syntax ugly in some cases is that shell scripts don't support namespaces or some other way to separate groups of variables, so that information is often encoded in the variable name, which can look a bit messy.

I see.

Genone wrote:
If you think it through, OpenRC actually did follow your other suggestion and harmonized it's config syntax by eliminating the "non-standard" syntax of /etc/modules.autoload.d/*, don't you agree?

Sorry I didn't catch it :oops: . You are right.

Genone wrote:
As for using XML (or some other format) as a secondary format that's only used when the primary is missing, or converted into the primary format (online or offline), that's be a huge mistake IMHO, because then you have to actively maintain, support and document two completely different formats. You make community support more difficult as most users will only know one one of the two formats (e.g. 50% know the shell-based, 50% the XML-based format) and therefore won't be able to help users that use the other format. New syntax features become more difficult to add because you have to implement/test them in both systems. You confuse new users because they aren't sure which syntax to use.

That was a suggestion to provide a smarter transisition in this case, rather than switching sharply. What you say must probably be true so the best option is to not change anything for now and see how OpenRC evolves.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sun May 18, 2008 1:23 am    Post subject: Reply with quote

VinzC wrote:
I retain the sentences
Quote:
It is not human-readable.

Quote:
It is not efficient.

This is completely untrue since that assertion is in absolute contradiction with the reason for the existence of XML

The fact is that intentions don't always get carried through to reality: XML allows for all kinds of arbitrary data, which is for machine to machine transmission, but in the same way as databases are mostly made up of text and numeric data, one wouldn't expect loads of binary data in XML. The fact that it's extensible means you can do so, but it's been subverted to make it opaque: in that sense most of the XML data out there isn't human-readable. That would be fine if it wasn't touted as a storage format for that type of data.
And the format is far less efficient than eg a mySQL connection.
VinzC wrote:

steveL wrote:
FWIW you should look at Natural language processing imo. Far more interesting than a format that was meant as a temporary flow between databases. Yeah the structure was supposed to be more fixed, but it was only that: plumbing to get round SQL incompatibilities and vendor lock-in (ironically enough). SGML was far more extensible, XML was a dumbed-down version for this purpose. You're much better off with latex or docbook rst for the interesting stuff, and plaintext config files.

Keeping it simple doesn't mean stupidity or lack of evolution: it's about not adding complexity that doesn't improve anything.

You're probably right. The matter is that XML was my only idea at that moment. However, should I have suggested Latex or whatever language, the answer would all have been the same about OpenRC, wouldn't it? (aka no external dependency, only what a POSIX shell supplies.) I guess your suggestion for a natural language goes with my second suggestion, i.e. harmonize application configuration languages?

I'm all for harmonizing config files, where it's appropriate. The ideas on tuomov's site are pretty cool imo. And they are miles away from XML. I was suggesting NLP more as I think you'd find it interesting, and it's the basis of Core Computing, not because I think config files should be in natural language. I still think they should be simple and easy to grok. I like the way Gentoo uses vanilla configs, and most of them are fairly easy to work with.

When I say interesting stuff with latex et al, I mean documents, not config.
Back to top
View user's profile Send private message
Eckos
Apprentice
Apprentice


Joined: 25 Jan 2008
Posts: 197
Location: Houston, Texas, USA

PostPosted: Sun May 18, 2008 2:41 am    Post subject: Reply with quote

Well you can go with eINIT which supports XML
_________________
AMD Athlon 64 X2 3800+ | 2GB DDR2 533MHz RAM | GCC-4.3.2 | Gentoo x86_64 | KDE 4.1.2
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sun May 18, 2008 3:19 pm    Post subject: Reply with quote

Eckos wrote:
Well you can go with eINIT which supports XML

I've taken a look at eINIT XML configuration files... and I understand why somebody told me he threw it out... [EDIT: I would too...]
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum