Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > "Functional"

Reply
Thread Tools

"Functional"

 
 
Willem
Guest
Posts: n/a
 
      10-07-2013
Ian Collins wrote:
) Malcolm McLean wrote:
)> The alternative to using xml is to declare a specific syntax, as used by
)> the Microsoft resource compiler, which pre-dates xml.
)
) Or use a simple, well known and supported format such as JSON. My
) "full" JSON parser is about 200 lines of code.

YAML is also a very good choice, a better choice if you want user-editability.


The big problem with XML is that it's a *markup* language, never meant for
and not very suited for data transport. The mind boggles as to why it
became the defacto standard.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      10-07-2013
In article <(E-Mail Removed)>,
Willem <(E-Mail Removed)> wrote:
>Ian Collins wrote:
>) Malcolm McLean wrote:
>)> The alternative to using xml is to declare a specific syntax, as used by
>)> the Microsoft resource compiler, which pre-dates xml.
>)
>) Or use a simple, well known and supported format such as JSON. My
>) "full" JSON parser is about 200 lines of code.
>
>YAML is also a very good choice, a better choice if you want user-editability.
>
>
>The big problem with XML is that it's a *markup* language, never meant for
>and not very suited for data transport. The mind boggles as to why it
>became the defacto standard.


One assumes it is because of the mindshare already attained for things that
end in "ML".

--
Modern Christian: Someone who can take time out from
complaining about "welfare mothers popping out babies we
have to feed" to complain about welfare mothers getting
abortions that PREVENT more babies to be raised at public
expense.
 
Reply With Quote
 
 
 
 
Roberto Waltman
Guest
Posts: n/a
 
      10-08-2013
Robert Wessel wrote:
>In many cases it would satisfy the most important requirement: you can
>tick the "uses XML" checkbox. Unfortunately there is never a "uses
>XML well" checkbox...


I have that check box between "Gives clear and unambiguous error
messages" and "Handles failures gracefully", above the "does not
invoke undefined behavior" box.

Doesn't everybody else have the same?

>IMO, XML is probably the wrong solution for many of those simple
>tasks. Which often does lead people to implement an XML-like coding
>for the data. Which is fine, except that people keep trying to pass
>it off as actual XML (or as I somewhat cynically said earlier, to
>manage to tick that currently fashionable checklist item).


"So, the essence of XML is this: the problem it solves is not hard,
and it does not solve the problem well."
(Simeon and Wadler, "The Essence of XML")

"XML is homomorphic to s-expressions where the first element is
atomic." (From memory, could not find a reference to the original.)
And s-expressions have been with us much longer than XML.
--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]
 
Reply With Quote
 
Roberto Waltman
Guest
Posts: n/a
 
      10-08-2013
Les Cargill wrote:
>I was directed to ezXML at one point, and it's a nice, simple XML
>parser. It only gets you to "leaf nodes" and then you have to interpret
>it into a coherent whole by traversing child/sibling pointer
>relationships.
>
>Just in case you are interested in/tired of maintaining your own.
>
>http://ezxml.sourceforge.net/


For similar reasons, (nice, simple, light-weight, small-is-beautiful,)
I used tinyxml:

http://www.grinninglizard.com/tinyxml/
--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      10-09-2013
On Wednesday, October 9, 2013 4:00:51 AM UTC+1, (E-Mail Removed) wrote:
> On Tue, 08 Oct 2013 10:01:09 -0400, Roberto Waltman
>
> They do overstate the case a bit. XML is far from perfect, but it
> *is* a standard that covers a lot of useful area. Sorta like C.
>
>
> Nor is XML all that hard to use with one of the several available
> toolkits, although none of those are trivial in size (and only a few
> are well suited for C). The major problem I was referring too was
> people using a half baked implementation instead of one of the
> toolkits, and creating something that looks like XML, but really
> isn't. Many of those applications could have used a much simpler
> non-XML format than the XML-like non-XML implementation they did use.
>

It's a legitimate criticism.

But since xml is a standard, people know how to write xml tags. They can
look at the file and tell you want it probably means.
However the full standard is a bit too big to support easily. It was designed
for marking up long publishing documents, not for little config files or
lists of things to process. So you need to pull in a big third party
toolkit.
I will probably extend the vanilla xml parser to make it more compliant,
but I checked the spec, and it's hard to support the whole thing.
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      10-09-2013
Malcolm McLean wrote:
> On Wednesday, October 9, 2013 4:00:51 AM UTC+1, (E-Mail Removed) wrote:
>> On Tue, 08 Oct 2013 10:01:09 -0400, Roberto Waltman
>>
>> They do overstate the case a bit. XML is far from perfect, but it
>> *is* a standard that covers a lot of useful area. Sorta like C.
>>
>>
>> Nor is XML all that hard to use with one of the several available
>> toolkits, although none of those are trivial in size (and only a few
>> are well suited for C). The major problem I was referring too was
>> people using a half baked implementation instead of one of the
>> toolkits, and creating something that looks like XML, but really
>> isn't. Many of those applications could have used a much simpler
>> non-XML format than the XML-like non-XML implementation they did use.
>>

> It's a legitimate criticism.
>
> But since xml is a standard, people know how to write xml tags. They can
> look at the file and tell you want it probably means.
> However the full standard is a bit too big to support easily. It was designed
> for marking up long publishing documents, not for little config files or
> lists of things to process. So you need to pull in a big third party
> toolkit.
> I will probably extend the vanilla xml parser to make it more compliant,
> but I checked the spec, and it's hard to support the whole thing.


It is. My parser/DOM implementation has grown to the point where it can
parse and manipulate (Open)Office documents and that took a long time!

--
Ian Collins
 
Reply With Quote
 
Phil Carmody
Guest
Posts: n/a
 
      10-11-2013
Seebs <(E-Mail Removed)> writes:
> On 2013-10-02, Robert Wessel <(E-Mail Removed)> wrote:
> > In many cases it would satisfy the most important requirement: you can
> > tick the "uses XML" checkbox. Unfortunately there is never a "uses
> > XML well" checkbox...

>
> <proprietary_data>kasflkj13912ekahdkjha</proprietary_data>
>
> I have seen some spectacular examples of that genre.


I've seen reg-/stack-/env-dumps targz-ed up and then uuencoded into
syslog. Unfortunately those dumps weren't in XML, else I could die
a happy man, knowing that I'd seen the ultimate.

Phil
--
The list of trusted root authorities in your browser included the
United Arab Emirates-based Etisalat, which was caught secretly
uploading spyware onto 100,000 customers' BlackBerries.
http://www.wired.com/threatlevel/200...ckberry-spies/
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      10-12-2013
On Wed, 2013-10-02, Robert Wessel wrote:
> On Wed, 02 Oct 2013 15:26:42 +0100, Nobody <(E-Mail Removed)> wrote:
>
>>On Mon, 30 Sep 2013 12:24:46 +0100, BartC wrote:
>>
>>> In Malcolm's case, he is parsing XML which he himself has generated. So the
>>> program can be minimal (but retaining the advantage of being in a standard
>>> format).

>>
>>The output might be in a standard format (or it might not, if it's being
>>coded to match an implementation rather than a specification). But does
>>that really help if you can't do anything with the file beside load it
>>straight back in? If the parser won't read the result of editing the file
>>with e.g. xsltproc, there isn't a great deal of point in in having it in
>>XML in the first place.

>
>
> In many cases it would satisfy the most important requirement: you can
> tick the "uses XML" checkbox. Unfortunately there is never a "uses
> XML well" checkbox...


Nor a "doesn't gratuitously use XML" one ...

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a = [ "1", "2", "3" ] v/s a = new Array ( "1", "2", "3" )identical in all ways? okey Javascript 1 08-25-2009 12:56 PM
What is the "functional" way of doing this? beginner Python 17 08-01-2007 04:16 PM
HTML Functional Equivalent Of "Include" or "CopyLib"? (Pete Cresswell) HTML 2 11-06-2004 03:39 PM
<FORM METHOD="post" onSubmit="return fieldcheck()" name="orientation" action="http://ws-kitty.BU.edu/AT/survey/orientation/script/write.asp" language="JavaScript"> Joeyej ASP .Net 0 06-04-2004 07:55 PM
["a", "b", "c", "d"] to "a, b, c, d"? Martin Ruby 3 04-07-2004 02:11 PM



Advertisments