XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Your XML document is a programming language

To add to peter and Mike.

Certianly XML can be used as the syntax for programming languages (xslt is one).

But your conclusions skip over the important fact that the *syntax* of a programming language, being XML

lends no value whatsoever to the more interesting  aspects you claim such as

 

e. Formal language theory can be applied programs.

 

 

Formal language theory can only be applied if you define the semantics of the program execution.

Having the syntax in XML may make parsing the program a tad easier (or LOTS easier) or harder ...

but it doesnt give you any benifit at all  with formal language theory.

 

Simple example.   Please analyze the following "program" in the programming language "xml"

 

 

<a>program</a>

 

 

Does it run in finite time ?

Does it take inputs ?

Does it produce a finite set of outputs ?

 

 

 

 

 

 

----------------------------------------

David A. Lee

dlee@calldei.com

http://www.xmlsh.org

 

From: Peter Hunsberger [mailto:peter.hunsberger@gmail.com]
Sent: Monday, September 09, 2013 5:32 PM
To: Costello, Roger L.
Cc: xml-dev@lists.xml.org
Subject: Re: [xml-dev] Your XML document is a programming language

 

Roger,

 

Tell me, just how am I supposed to run your "program"?  Where do I find this "Interpreter" you mention? 


Peter Hunsberger

 

On Mon, Sep 9, 2013 at 4:20 PM, Costello, Roger L. <costello@mitre.org> wrote:

Michael Kay wrote:

> you can certainly design a programming language
> in which your <Book>..</Book> sample is a program.
> It only becomes an interesting programming language
> if it is suitable for writing a sufficiently general class of
> programs, and that's something you have yet to
> demonstrate.

Thanks Michael. Very nicely put.

Please permit me to explore this a bit further. I am convinced that it is useful to view XML vocabularies as programming languages and XML instances as programs.

Although it is very simple, with my Book programming language I can create an infinite number of programs. In my first message I showed one program. Here is another

<Book>
    <Title>XSLT 2.0 and XPath 2.0</Title>
    <Author>Michael Kay</Author>
</Book>

When I execute that program my interpreter outputs

    XSLT 2.0 and XPath 2.0
    Michael Kay

I will grant you that my Book programming language is not a very exciting one and it limited. Nonetheless, it is a programming language -- there are constructs (markup) with specific semantics, there are variable parts (data), and the program instructs the computer what to do.

You may have noticed that in the Book programming language the programs had no input. The programs were standalone.

In the next programming language the programs take an input. This is a program

<Item name="Date">
    <Action>Remove</Action>
</Item>

and it has the following meaning

        Remove from the input the element
        with the name, Date.

Here is sample input

<Email>
    <To>Roger Costello</To>
    <From>John Doe</From>
    <Date>September 9, 2013</Date>
</Email>

My interpreter, when given the program and input will output this

<Email>
    <To>Roger Costello</To>
    <From>John Doe</From>
</Email>

I think that you will agree that this programming language is simple yet surprisingly powerful.

Okay, what is the benefit of viewing XML vocabularies as programming languages and XML instances as programs? Answer: we can apply formal language theory to XML. We can ask questions such as

        Will all programs (XML instances) halt on
        their inputs?

or

        Are all the programs decidable?
        (that is, stop and return yes or no)

This article [1] is fantastic and discusses the idea of applying formal language theory to inputs. The inputs are treated as programs that act upon a passive computer/silicon.

RECAP

In this message I have attempted to persuade you that

a. An XML vocabulary is a programming language (where the semantics of the markup is defined).

b. XML instances are programs.

c. A program is executed by an interpreter (an application) which outputs the result of running the program.

d. A program may have inputs.

e. Formal language theory can be applied programs.

f. By applying formal language theory to these programs we gain valuable insights regarding the complexity them.

Thoughts?

/Roger

[1] http://www.cs.dartmouth.edu/~sergey/langsec/papers/Sassaman.pdf

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS