开发者

Is there any XML like programming lanuage?

Is there any XML like programming lanuage?

For example this code in C:

int add(int a, int b)
{
  int result;
  result = a+b;
  return result;
}

Write like this:

<function name="add">

  <parameters>
    <parameter name="a" type="int" />
    <parameter name="b" type="int" />
  </parameters>

  <body>

    <variables>
      <variable name="result" type="int" />
    </variables>

    <statements>

      <statement>
        result = a+b
      </statement>

    </statements>

  </body>

  <return>result</return>

</f开发者_如何转开发unction>


Yes there are. Jelly is an XML based java language. I often cite it during talks, I use it as an example of a terrible idea. It is a disaster.


XSLT is Turing Complete


I'm surprised nobody mentioned Lisp since it's literally programming in an abstract syntax tree (AST). It's not XML but it's substantially less verbose.

(defun add (a, b)
  (+ a b))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜