~rabbits/uxn

1

Stack Erroring Behavior

Details
Message ID
<CAE2DaSQUoMSdBHzXng1TswYEnKEDyJcqVVhWUEp_Lo2Kenpi8w@mail.gmail.com>
DKIM signature
pass
Download raw message
This is specifically for Felix, but I'd like to make this conversation
available to all, in case anyone has ideas.

In UF, when uxncli under/overflows, it breaks the repl. It'd be nice
to agree on a way to handle this stuff by using this as a usecase.

The way I would handle this is to set a System/vector and clean up the
stack in that vector, and throw a custom error. Do you think that
would work for you? We could make that behaviour standard across
emulators if that would do it? What would be the ideal UX to handle
that?
Details
Message ID
<16566292630.682786@mail.networkname.de>
In-Reply-To
<CAE2DaSQUoMSdBHzXng1TswYEnKEDyJcqVVhWUEp_Lo2Kenpi8w@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> In UF, when uxncli under/overflows, it breaks the repl. It'd be nice
> to agree on a way to handle this stuff by using this as a usecase.

This is indeed an unsolved problem in the moment.

> 
> The way I would handle this is to set a System/vector and clean up the
> stack in that vector, and throw a custom error. Do you think that
> would work for you? We could make that behaviour standard across
> emulators if that would do it? What would be the ideal UX to handle
> that?

Do you mean a separate vector for error handling? This appears to
be the most straightforward solution, but it is hard for me to think
through what this means in practice (I haven't that much experience
in developing uxn applications).  The uxnemu approach of setting
the screen vector to different values, depending on what is the
expected behaviour is a bit tricky, a separate vector
would certainly make things simpler for UF...

So, from the top of my hat, the first idea that comes to mind is
to use the system vector for machine-exceptions, and pass the error
code in a device port and/or via the 254th byte of a mapped stack
(BTW, is this feature finalized? the varvara page seems to indicate
that). 

In the end I'm uncertain, perhaps others can suggest alternative,
more elegant approaches.


felix
Reply to thread Export thread (mbox)