Please sign in to access this page
Tymek
Check their projects out: Agin CI, Agin Auth, Wasona, Agin Sensors, Agin Slides
MHanak
Check their project out: MCManager
Kurpol
Check their projects out: Ainese Whispers, AI learns to play match3 games!
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
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.
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!
More docs! I've documented blocks, specials, errors and variables.
Maths, loops, functions, logic operations and the if statement coming soon.
I've started work on the documentation! It's made using Markdown and mdBook, and is available at https://xmlang.ggorg.xyz/docs
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.
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/
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.
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>.
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!
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.
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).
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.
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...