First I made an interpreted language in python, then I autogenerated some working source code

Hah, okay cool, looks like a stack based assembly language with set/add/sub/mul/div/color/circle? That "v" opcode is just setting the stack at i+1 to a literal value at i+2, right?

It's pretty neat. If you were to expand on this, I'd make it so you could reference addresses on the stack and lookup values, where it takes the "pointer" at i+1, I'd add a set of jump instructions like jmp jgt jlt jnez jez etc and have it check the value at i+1. Since values are 8 bit, you could have an opcode to output an ascii char too.

If you want to get crazy, you could make a toy language that compiles to this bytecode as well... that'd be a fun exercise in compiler programming. You'd want to have conditional jumps for sure for that.

/r/Python Thread Parent Link - i.redd.it