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] XML Programming Language, specification to write


> A slightly off-subject remark:
> I think all XML-based programming languages (like XSLT) are seriously handicapped by the verbosity of XML.
> This seriously limits their acceptance by non-XML-specialists.

Isn't this too simplistic?  XSLT is not a general purpose design, it is optimized for a particular use: semi-structured documents. 
When you try to do the conversions that XSLT is good for in general languages (e.g. using iterators rather than XPath) they
are much more verbose.  And ditto with the reverse: if you are just doing toy XML with relational data the conventional
languages (and GraphQL) will be easier.

Every programming language (except pure LISP) is a mix of different notations. In XSLT this is very explicit: you have two syntaxes: the elements
and attributes including {}  as the wrappers, the XSLT as the query language including a sublanguage for regular expressions. Ditto Schematron.

Take Java: it has a mix of one syntax for infix expressions, and another for assignment, another for annotations, another for declarations, another for
regular expression, and so on. People usually like the sugar: if it looks slightly different it reminds them that it has a different purpose.  People find
pure LISP difficult because there is no sugar to differentiate different kinds of ), at the opposite extreme. 

So the designer choice is what syntaxes they use at each level of their language. For example, you could have an C#-in-XML that just had a wrapper
element and elements for regions: that would be an "XML" programing language but only just.  Personally, I think that XML is perfectly suitable for
everything at the method level (i.e. classes, regions, methods, Documentation) but not suitable at the expression level, for a general purpose language:
if you have something big that you want to call out its end, XML is fine; if you have things that don't nest then XML is indeed verbose.
And XML has a big problem, with requiring <  to be delimited, which makes it cumbersome for development in text editors.

But why not just think in terms of an external form and an internal form: define a friendly syntax, then have a reliable transformation to and from an
XML form, so you can get the best of both worlds?  (I.e. a layered version of what SGML provided built-in with SHORTREFs)

The other angle is that what is "verbose" is now up for grabs, as editors get the Language Protocol implementations.  


Cheers
Rick





On Fri, Nov 30, 2018 at 4:21 AM <jf.larvoire@free.fr> wrote:
Hello Victor,

A slightly off-subject remark:
I think all XML-based programming languages (like XSLT) are seriously handicapped by the verbosity of XML.
This seriously limits their acceptance by non-XML-specialists.

If usability is one of yours goals, you can make your language look like more traditional programming languages,
by passing any such piece of XML code through my reversible XML<->SML converter.

For example, the sample on your wiki automatically becomes:

prog:macro name="f" {
  prog:arguments {
    prog:argument name="x"
    prog:argument name="y"
  }
  prog:body {
    prog:value name="x"; "then" ;prog:value name="y"
  }
}

And then this can be converted back to the initial XML sample code.

You can even experiment with the syntax when viewed as SML, and then convert it back to XML to see what this yields.
For example if I remove the quotes around the "then" above, to make it look like the C-language then keyword instead of a C string, the SML code converts back to:

<prog:macro name="f">
  <prog:arguments>
    <prog:argument name="x"/>
    <prog:argument name="y"/>
  </prog:arguments>
  <prog:body>
    <prog:value name="x"/> <then/><prog:value name="y"/>
  </prog:body>
</prog:macro>

(Which screams for a prog:then namespace prefix.)

The source for the sml2 converter, and the sml2.exe version compiled for Windows, is available there:
https://github.com/JFLarvoire/libxml2/releases

Note that to avoid libxml2 errors about undefined namespaces, you need to use sml2 option -pE.
(I'll need to change the sml2 program to ignore such errors by default, because the goal of that conversion program is to convert any piece of XML, and not just complete valid files.)

Jean-François

----- Mail original -----
De: "Victor Porton" <porton@narod.ru>
À: xml-dev@lists.xml.org
Envoyé: Lundi 15 Octobre 2018 23:44:58
Objet: [xml-dev] XML Programming Language, specification to write

At https://en.wikiversity.org/wiki/XML_Programming_Language

I started to write specification of a Turing-complete macro language for
XML.

First, it will allow to define macroses without arguments (with use
similar to XML entities), macroses with arguments, and macroses with
full-featured programming capabilities.

Please help me to develop the specification and to implement it.


_______________________________________________________________________

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


_______________________________________________________________________

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