It would allow us (uhm programmers, hackers, whatever you want to call yourself) to write logics and have some preprocessort write the actual code. ... Personally, I'd rather use some kinda preprocessable pseudo code, than code in Cobol all day long.

If we regard programming as some kind of "writing" activity, like writing English prose, then I pose the question: Would you rather like to write this XML stuff you propose above or something like COBOL? Even Cobol might be less wordy than the alternative that you propose. I could see your example as *output* of some preprocessor, but for input, I would prefer something more convenient (for a good example, have a look at the input language for GraphViz or read chapter 17 (Template Driven Code Generation) in Advanced Perl Programming).

XML (with the right DTD) would suit the purpose, and it would improve porting issues for ancient applications.

Either you are an SGML/XML genius, or I am missing something here. I don't think it will be easy to parse a programming language (even something rather simple, like COBOL) with an SGML/XML parser.

In fact, it is impossible for most contemporary programming languages, if I interpret Formalizing SGML and XML Instances and Schemata with Forest Automata Theory correctly (in short: "The fundamental problem is that context free grammars describe languages much more rich, powerful and complex than SGML can represent.").

Note: If anybody out there has a clear theoretical understanding of these issues, I would welcome a more substantial discussion very much!

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com


In reply to Re: Perl as XML by clemburg
in thread Perl as XML by Beatnik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.