Is the main value to the expression debugger that it makes explicit the order of evaluation, or the specific intermediate values? (or is it pretty much both that provide the value?)
It makes explicit stuff like operator precedence, but it's especially helpful when you have to explain function calls and recursion.
For the latter specifically, Thonny has a mode where for every call stack frame, it opens up a separate child editor window that displays the code of the function in that frame, highlighting the current line. When you step through, the visual substitution of expression results happens in the window for the frame where it is happening. Thus, when you have a chain of recursive calls, you can see all the substitutions that it took to get there.
> I have this implementation of the uxn virtual machine that has 32 instructions, how can we add a few more instrucions do implement memory pagination? (code here)
To implement memory pagination, we can add a few instructions to the existing set of 32 instructions in the uxn virtual machine. These instructions could include:
1. PAGE_IN - This instruction would be used to load a specific page of memory from the underlying storage device into the virtual machine's RAM.
2. PAGE_OUT - This instruction would be used to save a specific page of memory from the virtual machine's RAM to the underlying storage device.
3. SET_PAGE - This instruction would be used to set the current page of memory that is being accessed by the virtual machine.
4. GET_PAGE - This instruction would be used to retrieve the current page of memory that is being accessed by the virtual machine.
These instructions could be implemented as follows:
#define PAGE_IN(x) { u->page = (x); u->dev[0x0f] = 1; }
#define PAGE_OUT(x) { u->dev[0x0f] = 1; }
#define SET_PAGE(x) { u->page = (x); }
#define GET_PAGE(x) { x = u->page; }
int
uxn_eval(Uxn *u, Uint16 pc)
{
...
switch(instr & 0x1f) {
...
case 0x1a: /* PAGE_IN */ PEEK(a, pc) PAGE_IN(a) pc += 1 + bs; break;
case 0x1b: /* PAGE_OUT */ PEEK(a, pc) PAGE_OUT(a) pc += 1 + bs; break;
case 0x1c: /* SET_PAGE */ PEEK(a, pc) SET_PAGE(a) pc += 1 + bs; break;
case 0x1d: /* GET_PAGE */ GET_PAGE(a) PUSH(src, a) break;
...
}
...
Not only these opcodes are already assigned, this would be a very much overkill implementation of this functionality by wasting opcode space, whereas a simple device port would do the trick. It's telling that everyone's first reaction to Uxn is to write a compiler for it, or adding extra memory - it's more about finding fun projects to do that fits within such a restricted space.
It seems to be included with the util-linux package
https://packages.fedoraproject.org/pkgs/util-linux/util-linu...