I wonder how events, or more broadly reactive programming, could be managed in a simple stack-oriented language.

For example, let's imagine a context where there is a button that displays a small message when you press it. How could an entire program on the stack handle the case where the user presses the button without that becoming unmanageable (for example +30 buttons)? Does the button information remain on the stack throughout the execution? Since we only have access to the last element of the stack, how do we send the information?

More clearly, how could a stack of execution of a stack-oriented language handle the case of the events?

  • 1
    $\begingroup$ This seems like a software engineering questions. It's also not clear to me what you think is special about "event programming" that makes it more difficult to deal with in a stack-based language than a more traditional one, or why we can't just render a traditional solution in a stack-based language. $\endgroup$ – Derek Elkins left SE Sep 6 '19 at 3:59
  • $\begingroup$ In fact, I wonder how a runtime stack (no register or accumulator) could, on its own, be able to be attentive to the activation of said button while executing the rest of the program (what I mean by "event programming"). This does not really seem possible to me to do according to traditional methods. $\endgroup$ – Foxy Sep 8 '19 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.