Please sign in to access this page

XMLang

XMLang Used AI

15 devlogs
25h 23m
•  Ship certified
Created by GGORG

A programming language in XML!

Timeline

Ship 1

0 payouts of shell 0 shells

GGORG

19 days ago

GGORG Covers 15 devlogs and 25h 23m

I've added the <rand /> element and a navbar with links to the playground.

Update attachment

And the docs are now finished! Everything about XMLang is now extensively documented, so that it can be used by... well, anyone other than me.

Since the last devlog I've documented the <if> statement, <loop> and functions - the 3 biggest, but most critical elements of the language.

Update attachment

Even more docs!
Since the last devlog I've documented mathematical operations and logical operations. That was a lot of work, especially with the mathematical operations, as I documented the behavior of every operation with every type combination - some of my choices might not be so obvious!

Update attachment
GGORG
GGORG
1h 14m 24 days ago

More docs! I've documented blocks, specials, errors and variables.
Maths, loops, functions, logic operations and the if statement coming soon.

Update attachment

I've started work on the documentation! It's made using Markdown and mdBook, and is available at https://xmlang.ggorg.xyz/docs

Update attachment
GGORG
GGORG
3h 47m 25 days ago

A lot has happened since the last devlog.
I've fixed lots of bugs related to the playground, added a dark theme to the code editor, fixed the terminal font. I've also added GitHub Actions to build and deploy both the native interpreter, as well as the playground.
I've also added the ability to load code from a GitHub Gist or file in a repository. This allowed me to make some examples that can be easily ran.
I'm currently working on the documentation for the language.

Update attachment
GGORG
GGORG
1h 22m 26 days ago

I've compiled XMLang to WebAssembly and made a quick web playground around it with Vite, CodeMirror, Xterm.js, and Wasmer.js. It's accessible at https://xmlang.ggorg.xyz/

Update attachment

And here are functions!

Update attachment
GGORG
GGORG
1h 32m 26 days ago

And here is FizzBuzz, made with loops, the modulo operator, and elif!
I've also added the ability to return/break from loops, blocks, and others, as well as continue in loops.

Update attachment

And with that XMLang is turing complete! I've added the <if> block, as well as some boolean helpers like <eq>, all the inequality operators, as well as <and> and <or>.
If is the second statement - it requires its children to be <condition>, <then> and optionally <else>.

Update attachment

For the next iteration of your hourly XMLang news, we've got the <block>, <type>, <join> and <readline> blocks!

<block> is very simple - it just evaluates its entire body, but returns only the value of the last child. May sometimes come in handy!
<type> returns the type of the value you pass in, and if you give it more than 1 child it will separate the types with a space.
<join> produces a string by joining the children with a separator, optionally adding a prefix or suffix - can save you from writing <space /> all the time when interpolating strings!
<trim> can trim the whitespace from the start and/or end of a string.
<readline>, well, reads a line of input from the user! Finally some interactivity!

Update attachment

And here we have the first statement - the try block!

It is differentiated from other elements, expressions, by the fact that its children MUST be <do> and <catch> (what's the point of a try block without a catch?). You put the fallible code in <do>, and when something breaks you end up in <catch>. Then you can extract the error message using yet another new mechanism - specials. They are like variables, except that they are constant and you can't make them yourself. They are automatically created by blocks like <catch>, and will be used for things like the for loop element or function arguments in the future.

Update attachment

And here are variables, as well as math operations!

Variables were quite simple to implement, but that was definitely not the case for the mathematical operations. I've implemented addition, subtraction, multiplication, division, and even unary negation (-value), logical unary negation (!value, aka NOT), and absolute values.

As for variables, there is a single global scope, and you interact with them with the <set> and <get> elements. For <get> you can provide the variable name via the var attribute or as the text content, and you can specify the default value to be returned if the variable doesn't exist (if no such default value is specified, you'll get null in that case).

Update attachment
GGORG
GGORG
1h 18m 27 days ago

For those that said HTML wasn't a programming language. Well, not exactly HTML, but its superset, XML!

And... here is a hello world!
I've made a simple interpreter, that for now only supports the print function and handles strings, but that's enough to write the first program a programming language should be able to run!

I've also switched up the error handling crate from color-eyre to miette, to prepare for real error handling with source code blocks soon.

Update attachment
GGORG
GGORG
2h 11m 28 days ago

I've added quick-xml as the XML parsing library and then built a tree structure on top of it, which can then be relatively easily interpreted as real code!

Small bug: whitespace at the beginning or end of elements is ignored. this is a library limitation, I'll have to make a <space count="n" /> function...

Update attachment