Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

LW Lays Down Hammer on XML in Perl 6 "Core"

by perlfan (Vicar)
on Nov 29, 2007 at 18:00 UTC ( [id://653932]=perlnews: print w/replies, xml ) Need Help??

It is not up in the thread yet in the thread at perl6-language@ archives, but LW let's his opinion be known - and provides some insight into Perl 6 (for the rest of us) all at the same time.

When I see his post up in the archives, I'll link directly do it. In the meantime:

(direct link)
On Wed, Nov 28, 2007 at 07:52:31PM +0100, James Fuller wrote: : On Nov 28, 2007 7:39 PM, Andy Armstrong <andy@hexten.net> wrote: : > On 28 Nov 2007, at 18:28, James Fuller wrote: : > : > > A few things I could imagine; native XML data type (and whatever + that : > > means at this late stage) .... : > : > What might that mean at any stage? : : from a syntactic point of view, here are 2 interesting examples of : representing XML in a programming context : : http://en.wikipedia.org/wiki/E4X : : and : : http://en.wikipedia.org/wiki/XQuery : : there is lots to learn here. There's lots to unlearn here too. You give two examples of language initiatives that attempt to mesh XML with other language. Fine, that sort of linguistic innovation has been going on since the dawn of computers. Now what if you want to use both of those languages together? How are they related to each other? What's they're pedigree, and whose rules are in operation where? How can you even consistently tell by inspection of the text which language is intended at the top? These are questions Perl 6 is addressing. It will be *trivial* to add syntax such as the above to Perl 6. But unlike the initiatives above, in Perl you always start out in Standard Perl 6 at the top and explicitly derive your new language from that by declaration. You can add a syntax like the above with a single "use" statement. Unlike the unrelated languages you mention, these syntactic variants are defined in terms of derivation from the standard Perl grammar, which merely functions as a base class of parsing methods. Let me put it this way. Not even the Standard Perl 6 syntax is core in the sense you're thinking of it. There are basically *no* reserved words in Perl 6. What appear to be keywords are only convenient sets of macros that fight it out under longest-token rules, and under those rules there are no distinctions whatsoever between built-in constructs and user-defined constructs. When you derive a new language you are merely adding to or subtracting from those sets of macros, and in the limiting case you can subtract all of them and start over. All is fair if you predeclare. Explicitly. And all of those explicitly derived languages can be considered "True Perl". Even those cluttered up with XMLisms. I'm not against use of XMLish syntax where appropriate, which will generally be when you want to send data somewhere portably. After all, I was the first to add an XML parser to Perl. But XML syntax makes a lousy programming language, and only a marginal data description language. And Perl 6 is not about getting trapped in the current fad, however popular it might be. In Perl 6 you have to declare explicitly that you want to be trapped by the current fad. :-) Larry

Replies are listed 'Best First'.
Re: LW Lays Down Hammer on XML in Perl 6 "Core"
by Jenda (Abbot) on Nov 30, 2007 at 16:52 UTC

    I could not agree more on the last two paragraphs. Let's use XML were it makes sense, not try to force everything to look like XML.

    A "native" XML data type built into the core Perl6 doesn't really make sense. It's best left for a module. Maybe one that's part of the base installation, but a module anyway. Or rather several modules providing different datatypes, different ways to look at XML and structured data generally. Let's not prevent improvement, by putting too much in the core.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlnews [id://653932]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-29 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found