IRC Logs for #io Friday, 2019-02-08

prologicjer yes sort of08:29
prologicbut it's not even the while statement per se08:29
prologicthe two expressions  inside the block are compiled wrongly08:29
prologicI've since added assertions to my test suite to assert that the vm.sp == 0 on each test08:30
prologicwhich will help pin-point future stack issues08:30
prologicbut currently I'm "not getting" it08:30
prologicI'm still left with this question "when should the compiler emit a Pop, and when is it bad to do so?"08:31
prologicthe answer will fix everything and ensure a clean stack, and never run into an overflow or underflow08:31
*** prologic has quit IRC10:41
*** prologic has joined #io10:42
*** irclogger_do has joined #io11:46
prologicjer sadly I'm still no closer to solveing this bug23:24
prologicor is it a design flaw?23:25
prologicMy VM crashes even on something as simple as:23:25
prologiclet x = 1; if (x == 1) { let x = 2 }23:25
prologicwhich gets compiled to:23:27
prologic0000 LoadConstant 0; 0003 BindGlobal 0; 0006 LoadGlobal 0; 0009 LoadConstant 1; 0012 Equal; 0013 JumpIfFalse 25; 0016 LoadConstant 2; 0019 AssignGlobal 0; 0022 Jump 26; 0025 LoadNull; 0026 Pop;23:27
prologicThis is the disassembled form of: <ip> <opcode> <operands>;23:27
prologicAs you can see the compiler is wrong here23:28
prologicBecuase that last Pop is non-sense since AssignGlobal has a stack effect of -123:28
prologicit pops the top of the stack and stores the value in it's globals at the index given by its operand23:29
jer026 looks wrong to me23:56
jersorry reading as i think lol23:56
jeri'm not sure what it could be though23:56
jerlike i say, i hate working with stack machines =]23:57

Generated by 2.14.0 by Marius Gedminas - find it at!