We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
XPML17
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
XPML17 is a programming language created by User:actuallyallama in 2017. It was designed because the creator hates XML, so he decided to make a programming language based on that.
The main implementation is available on GitHub (dead link), and it also shows the example programs and standard functions.
Syntax
The syntax is based on XML.
Comments are written with <!-- comment text here --> and can have multiple lines, just like in XML and XML-based languages like HTML.
<program></program> delimits a program.
<main></main> is the main function, the entry point of the program.
<do /> is a tag that takes in three parameters, l which is the target variable, op which is the operation to apply to the variable's value, and rlit which is the literal on the right-hand side. This is equivalent to the "augmented assignment" operators in C, for example <do l="my_variable" op="+" rlit="1" /> in C would be my_variable += 1;.
<print /> prints to standard output. It may take in either a var, a literal, or both. It does not print a newline after. If both var and literal are specified, then a space is not automatically inserted between them.
Control flow
<if></if> is an if statement. It takes three parameters, l which is the variable on the left side, op which is the operation to compare with, and rlit which is the literal on the right side to compare the variable against. If the condition is true, then the code between <if> and </if> is executed.
<while></while> is a while loop. It takes in three parameters, l which is the iteration variable, op which is used to compare l and rlit, and rlit which is the literal on the right-hand side to compare the iteration variable against.
Examples
Hello, world!
<program>
<main>
<print literal="Hello, World!"/>
</main>
</program>
99 bottles of beer
<program>
<!--bottlesofbeer-->
<main arg0="int">
<while l="arg0" op=">" rlit="1">
<print var="arg0" literal=" bottles of beer on the wall, "/>
<print var="arg0" literal=" bottles of beer."/>
<print literal=" Take one down, pass it around, "/>
<do l="arg0" op="-" rlit="1"/>
<print var="arg0" literal=" bottle"/>
<if l="arg0" op="!=" rlit="1">
<print literal="s"/>
</if>
<print literal=" of beer on the wall. "/>
</while>
<print literal="1 bottle of beer on the wall, 1 bottle of beer. Take one down, pass it around, We're out of beer!"/>
</main>
</program>