> I'll suggest that people head to Google Groups, and search for: > "pierre mai xml trivial expat"
Thanx, I've got the code to work but I've face a strange problem... Which Common Lisp implementation did you use?
I have modified Pierre's code to get a file as input but when I run it in CMUCL with (ext:run-program ""), it gets freezed and I'm unable to get a stream from it whereas the program runs perfectly from bash (and pipes)! :(
-- Frederic Brunel Software Engineer In-Fusio, The Mobile Fun Connection
In article <3224536475989...@naggum.net>, Erik Naggum wrote: > That XML has continued to make this mistake, despite strong > arguments against this view over many years from several people, > who even influenced the design of XML, is one of those tragedies > that history books are for. I am just sorry I live in a time > and work with stuff that they will write about, eventually. > But at least I jumped ship before XML was born, so it was not > my fault. I have deniability, at the very least. Whew!
Germans used to call this ``Die Gnade der spaeten Geburt'', something like ``The grace of late birth'' or some such...
Regards, -- Nils Goesche "The sooner all the animals are dead, the sooner we'll find their money." -- Ed Bluestone PGP key ID 0x42B32FC9
* james anderson <james.ander...@setf.de> | on the other hand, lisp programmers share with their counterparts the | trait that, how did that go, they "know the value for everything, but | the cost of nothing."
You had a point?
/// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.
james anderson <james.ander...@setf.de> writes: > Erik Naggum wrote:
> > ...
> > People with Common Lisp experience understand that you can parse just > > about anything into any sort of internal memory representation you want,
> ... including xml.
> > and use a _different_ mapping from internal to external representation > > than from external to internal if you need or want to. People without > > such experience seem to believe that there is somehow only _one_ of those > > representations that really matter, while the other matters not.
> on the other hand, lisp programmers share with their counterparts the > trait that, how did that go, they "know the value for everything, but > the cost of nothing."
That's a troll around these parts, and I think there is a two beer minimum before everyone has sufficient levity to appreciate the comment as it was intended.
I had two beers late last night, and had just one cup of coffee this morning, so I'm qualified to reply.
When you get down to it, the tools for evaluating the cost of operations in a CL implementation are more than adequate for determining the real cost of an operation. That said, not only do I as a CL hacker understand the VALUES (remember this is CL so we can have more than one) of everything, but I can determine the cost of an operation or set of operations or a design decision quicker than C or Java hackers. Not only can I try out multiple approaches faster, but my profiling, call recording, memeory monitoring, code stepping and call statistics tools are boffo!
> decoding configuration decriptions which are encoded as xml is not > the problem. the "problem" would be to determine how these > expressions fit into a process outside of the > application-as-implemented-in-lisp and what needs to be encoded in > them. it is hard to tell from the description whether the > "political" reasons did, in fact, have technical ramifications.
Yah, that accursed lack of a brick wall properly seperating data from code is such a burden for us CL haxors. That is not a cost, that is a value, and just because other people don't have the vaue that you do does not turn it into a cost. It's really all those XML/Java/C++ headz that don't understand the cost of their languages failures and the cost of the band-aids they try to patch things up with.
XML is a great example, lame ass programmerdweebz getting weak in the knees at the thought of writing a parser see XML as their savior. Then once they get that done they graduate to the net circle of hell, err I mean level of competence, and suddenly since everyone has a parser that understands their sin tax they figure that everything shoudl be encoded in that and it would like make it all inter-operable and be a great big synchronicity win!
So, for the VALUE of not writing a parser they incur billions of dollars worth of marketing, re-engineering, training, support, and mental health maintenance COSTS.
Ok, I lied, Ihad one cup of coffee last night and two beers this morning. Or was it three? Damn, time to check the empy CAR and CDR slots in my SIXPACK. Look out world, I'm a drunk industrial CL programmer here to improve your productivity apps!
james anderson <james.ander...@setf.de> writes: > on the other hand, lisp programmers share with their counterparts the > trait that, how did that go, they "know the value for everything, but > the cost of nothing."
In the modern lisp community, I often see evidence to the opposite. Macro- and sometimes micro-efficiency are very common topics of discussion.
-- -> -/- - Rahul Jain - -\- <- -> -\- http://linux.rice.edu/~rahul -=- mailto:rj...@techie.com -/- <- -> -/- "I never could get the hang of Thursdays." - HHGTTG by DNA -\- <- |--|--------|--------------|----|-------------|------|---------|-----|-| Version 11.423.999.221020101.23.50110101.042 (c)1996-2002, All rights reserved. Disclaimer available upon request.
Is there anyone here who thinks they cannot /generate/ legal XML? (cake)
Is there anyone here with a requirement to /read/ legal but otherwise unspecified XML? (ouch)
Is anyone aware of a standardized domain-specific XML representation that is unreadable by an app to which the domain-specific XML representation is known? (not)
These are /my/ sticking points in this discussion. I do not think I could read arbitrary XML, nor do I think arbitrary XML is meant to be readable. That's why folks in different domains are standardizing. (hello?)
Craig Brozefsky <cr...@red-bean.com> writes: > Then once they get that done they graduate to the net circle of hell, > err I mean level of competence, and suddenly since everyone has a > parser that understands their sin tax they figure that everything > shoudl be encoded in that and it would like make it all inter-operable > and be a great big synchronicity win!
* Kenny Tilton <ktil...@nyc.rr.com> | Is there anyone here who thinks they cannot /generate/ legal XML? (cake) | | Is there anyone here with a requirement to /read/ legal but otherwise | unspecified XML? (ouch) | | Is anyone aware of a standardized domain-specific XML representation | that is unreadable by an app to which the domain-specific XML | representation is known? (not) | | These are /my/ sticking points in this discussion. I do not think I | could read arbitrary XML, nor do I think arbitrary XML is meant to be | readable. That's why folks in different domains are standardizing. | (hello?)
I have some problem getting at your rhetorical style, but it seems that you are not arguing, only positing and stipulating.
There are _many_ people who cannot generate valid (legal is something else :) XML if their life depends on it. The problem is the moronic DTD and/or schema cruft. Getting both of these right is a nightmare that the people who could have been trained for it do not want to do and those who do it are not trained to handle that kind of programmer-level design.
XML _is_ readable without having a DTD and having a clue what the data "means" -- that was the primary design goal. The problem with SGML was that you would not know whether some element had CDATA or RCDATA declared contents, meaning that only an end-tag would be recognized (and it better be for the only open element, in the spirit of redundant redundancy), not a start-tag for some other element, which would throw a naive parser off, as well as a lot of other minor stateful parsing problems.
The parsability of arbitrary XML is such an obvious design goal of XML that I really wonder how you arrived at your last paragraph. It is completely bogus as a rationale for standardizing elements and their structural relationship, too. What people are standardizing in XML is the same they standardize with EDIFACT or systematized nomenclature for medicine (SNOMED) or even such "simple" things as the call letters of ships, airplanes, airports, radio and TV stations, etc. People tend to want to standardize sematnics, and leave syntax to randomness. XML is standardized randomness and might therefore be chosen as the preferred random way of expressing someone's semantic constructs.
/// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.
> I have a system which currently reads an sexp based config > file syntax, for which I need to provide (and in fact have > provided) an alternative XML-based syntax for political > reasons. > > ...
I must be nuts, but there's a significant point that hasn't been brought out. I've been using XML since the days of a draft specification and am not blind to it's warts. Most (all?) of the criticisms heaped upon it by others here are quite correct.
The thing that has been lacking in the discussion is a proper placement of the technology among alternative techniques or approaches. For many of those who are using XML, the only alternative they have is OLE structured storage. That there are actually alternatives that they just don't know about because they are ignorant is beside the point. If they don't know about them or understand them, these things aren't alternatives.
An XML DTD, as ugly as it is, or a schema is a miracle of clarity and consistency in a world in which document formats change when some VB programmer makes changes to "code", saves the "code", undoes the changes, and saves again.
You can argue that people shouldn't be using tools that are that lame, and that people who can't write a proper parser shouldn't be programming, but as right as you may be they won't stop.
As bad as it is, XML allows many projects to succeed that would otherwise fail in a dustcloud of partially broken or imcompatible parsers, ever-shifting formats resulting in mis-understood hacks at the wrong layer, etc. It might have the additional benefit that for a few souls, it is the beginning of a more serious understanding of data representation.
Frederic Brunel <frederic.bru...@in-fusio.com> writes: > > I'll suggest that people head to Google Groups, and search for: > > "pierre mai xml trivial expat"
> Thanx, I've got the code to work but I've face a strange > problem... Which Common Lisp implementation did you use?
> I have modified Pierre's code to get a file as input but when I run it > in CMUCL with (ext:run-program ""), it gets freezed and I'm unable to > get a stream from it whereas the program runs perfectly from bash (and > pipes)! :(
Personally, I wouldn't modify the C code to take a file name, but rather use the ability of either your favourite shell or CMU CL's run-program to redirect standard input from a file, which is more flexible.
-- Pierre R. Mai <p...@acm.org> http://www.pmsf.de/pmai/ The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. -- Nathaniel Borenstein
Christopher Browne <cbbro...@acm.org> writes: > One suggestion I'll throw out would be for Pierre to stick it on a web > site somewhere, and maybe put in some sort of licensing statement to > remove fear from any quaking hearts. (I rather like the "If it > breaks, you get to keep both pieces; this is not the GPL" license.)
> A little blurb at the front that at least says "I wrote this; nobody > else should claim they were the author" would be a good thing...
As stated in the original posting of the code, I've explicitly placed it into the public domain, so anyone is free to do anything they like with it (including breaking it and recycling the bits)... I'll see about putting it up somewhere...
Regs, Pierre.
-- Pierre R. Mai <p...@acm.org> http://www.pmsf.de/pmai/ The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. -- Nathaniel Borenstein
Erik Naggum wrote: > The parsability of arbitrary XML is such an obvious design goal of XML...
Well, you posted early on something I recall as three different ways to say (or interpret?) the same thing. I am not an XMLer, but I had read enough to come to the same conclusion. So how could anyone parse that blind? Or did you mean the DTD would sort out the alterniative meanings, at which point the wackiness of DTDs can kill you?
i think I am lucky, we just have to generate XML and provide XSL to convert our own XML to other formats, not read arbitrary XML (for now). But I still hark back to memories of code I have seen which was a pure horror, written in a language which could have been used to write elegant code. Actually all languages fit that description...including XML.
Are y'all lookin for a language in which one cannot write bad code?
kenny tilton clinisys, inc --------------------------------------------------------------- "Be the ball...be the ball...you're not being the ball, Danny." - Ty, Caddy Shack
> The parsability of arbitrary XML is such an obvious design goal of XML...
* Kenny Tilton | Well, you posted early on something I recall as three different ways to | say (or interpret?) the same thing. I am not an XMLer, but I had read | enough to come to the same conclusion. So how could anyone parse that | blind? Or did you mean the DTD would sort out the alterniative meanings, | at which point the wackiness of DTDs can kill you?
I am still not sure what you are referring to, but the main difference between SGML and XML is precisely that you do not need the DTD to parse an XML "document".
| Are y'all lookin for a language in which one cannot write bad code?
No, just a language that has static style checking and does not stop at proven correctness, but requires proven good taste. This would take care of a lot more real-life problems than, e.g., static type checking.
Really, i just want every single professional programmer to be competent. (The difference between a hobbyist and a professional programmer should have been accountability. The difference today is whether he gets paid.)
/// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.
>>>>> "Tim" == Tim Bradshaw <t...@cley.com> writes:
Tim> However, I think that as all these overcomplex systems collapse under Tim> the weight of paper, merely sufficiently complex systems, like CL, Tim> might stand quite a good chance of doing rather well.
Lets not forget that Lisp has so far survived for more than 4 decades, allthough having been announced dead and nearly extinct numerous times.
I am personally of the firm belief (probably to be taking in the religious sense) that eventually Lisp programmers will be dancing on the grave of Java. It won't happen anytime soon, but I am prepared to wait :-)
------------------------+-------------------------------------------------- --- Christian Lynbech | ------------------------+-------------------------------------------------- --- Hit the philistines three times over the head with the Elisp reference manual. - peto...@hal.com (Michael A. Petonic)
> Personally, I wouldn't modify the C code to take a file name, but > rather use the ability of either your favourite shell or CMU CL's > run-program to redirect standard input from a file, which is more > flexible.
Thanx Pierre, I didn't get how to use :input, your example is great. Maybe my mistake is to have ommitted the (:wait nil), but I wonders why it has worked with the `ls' command, anyway I'll go using the program without making any changes!
-- Frederic Brunel Software Engineer In-Fusio, The Mobile Fun Connection
> Erik Naggum wrote: > > The parsability of arbitrary XML is such an obvious design goal of XML...
> Well, you posted early on something I recall as three different ways to > say (or interpret?) the same thing. I am not an XMLer, but I had read > enough to come to the same conclusion. So how could anyone parse that > blind? Or did you mean the DTD would sort out the alterniative meanings,
parse => syntax meaning => semantics
different kettles of fish entirely.
Even without a DTD you can see that "<m><g>Hello</g></m>" is "Hello" inside a "g" inside an "m". That's parsing and it's (relatively) easy.
With a DTD you can answer questions like "is a 'g' allowed inside an 'm', and if so, can we have text inside the 'g'?" That's still parsing, but not so easy.
You still need an application before you can discover that "Hello" isn't a valid reading for the gas meter in my house's meter-set.
> Marco Antoniotti wrote: >> operators have different "semantics" if monadic or dyadic.
> ah yes, I saw that in the K language, I was wondering what possessed > them, thx for clearing that up. :)
No, they don't. What happens is that, due to the limitations of the ASCII character set, some glyphs are overloaded to represent more than one operator.
> The XML is now only a suger-coating of syntax and the meaning of the > entire construct is determined by the contents of the form elements, > which are completely irrelevant after they have been parsed into a tree > structure, which is very close to what we do with the parentheses in > Common Lisp.
* Sverker Wiberg <sverk...@erix.ericsson.se> | So you might as well say | | <form> | (if (...condition...) | (...then...) | (...else...)) | </form> | | which would help cut down on the sugar intake.
:D Good one! Yes, it is certainly possible to defer the whole problem to what SGML and XML call "notations", but the intention with notations was actually that they should have parsers that return structured objects.
I doubt that anyone uses notations this way with the current crop of parsers, however. If someone knows, I would be happy to hear otherwise.
/// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.