Your site is the second one I've seen using the JetBrains Mono typeface -really easy on the eyes, even when set light grey #eff1f5 on a very dark #07080d background.
I love jetbrains mono, together with go mono my favourite fonts
The example: 2+3*4-1 should resolve to either LR: 19 RL: -7 PEMDAS: 13
and never this: 15
Who would expect a language where add/sub is more tightly binding than mul? Its feels akin to starting your indexes at 2, it's not illegal, if you remember everything works, but its a true foot gun in a scripting lang.
Either way the parser isnt implemented yet and all ast examples for the compiler are hardcoded
In fact why not simply write rust to begin with?
Though I'm wondering about the const_binary optimization:
Is this valid? The first const_binary optimization changes the values of r0 and r1 (before the optimization they're 2 and 3, after the optimization they're unknown). The second const_binary optimization changes the values of r1 and r0 (before the optimization they're 4 and 1, after the optimization they're unknown). An optimizer which analyzes the whole block would be able to see that r0 and r1 are written to before they're read from, but the peephole optimizer only sees the 3 instructions, right?I would get how this works in a stack based bytecode, as 'push 2; push 3; add' could be replaced with 'push 5' without affecting the machine state after the optimization. But why is the same optimization valid for this register machine? Does purple-garden impose some invariant that a register may be read at most once after being written to?
I honestly didnt think of this possibility while building the optimisation. Since constant folding is done as an ir pass i will remove the peephole pass, thanks for noticing :)