esolang

XPML17

A programming language in XML, made by someone who hates XML.

actuallyallama, 2017 · Turing complete: unknown · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello, World!

The idea

actuallyallama made XPML17 in 2017. The specification says it was designed because its creator hates XML. Every statement is a tag, every operand an attribute, and a loop is an element with the loop's body inside it. Even x += 1 takes a whole tag, <do l="x" op="+" rlit="1"/>.

Read the story

The specification is a stub and its implementation is gone. This implementation runs what the specification describes, which is enough for its two programs.

The machine

TagDoes
<program> <main>The program and its entry point
<print var="x" literal="text"/>Print the variable, then the text
<do l="x" op="+" rlit="1"/>x += 1, with + - * / %
<if l="x" op="!=" rlit="1">Run the body if the comparison holds
<while l="x" op=">" rlit="1">Run the body while it holds
<!-- text -->A comment

A comparison is one of == != < > <= >=, with a literal always on the right. Nothing prints a line break by itself; &#10; in a literal is one.

The specification gives no way to make a variable. Its 99 bottles takes arg0 as an argument of main, and this implementation takes each argument of main takes the next whole number from the input.

Example

A countdown from the input, with while and do.

A countdown from the input, with while and do.

Expected: 5 4 3 2 1

The 99 bottles is included too. Given 99 it prints 199 lines. Its if adds the s of bottles everywhere but at 1.

Patterns it teaches

  • Camouflage: a program that is also a well formed XML document.

Further

Also in Jokes

Write your own in Run Convert a program from XPML17

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: xpml17.

Command line

shib run xpml17 -e '<program>
    <main>
        <print literal="Hello, World!"/>
    </main>
</program>'
shib manual xpml17

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/xpml17.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org