Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTR stack on left? #11

Open
3 tasks
cben opened this issue Mar 7, 2021 · 0 comments
Open
3 tasks

LTR stack on left? #11

cben opened this issue Mar 7, 2021 · 0 comments

Comments

@cben
Copy link
Owner

cben commented Mar 7, 2021

https://www.youtube.com/watch?v=EkzoevQ19Pk shows a very nice layout for visualizing stack-based language execution, also similar to http://www.nsl.com/k/xy/xy.htm model (and probably has been re-invented many times):

stack current-word continuation
3 square 4 square +
3 square
3 dup * · 4 square +
3 dup * · 4 square +
3 3 * · 4 square +
9 4 square +
9 4 square +
9 4 dup * · +
9 16 +
25
  • the whole program starts on the right
  • taking a step takes first word from continuation and executes it
  • that usually does something to right edge of stack, e.g. numbers just shift left :-)
  • a definition can be "exploded" back into the continuation
    • its end is marked with a no-op · which supports "jump over" to complete function execution, instead of default single-stepping.

However, I want to keep text editable, don't want it to actaully disapper.

But things I can do to approach this:

  • move stack to left of editor
  • orient stack left-to-right
  • dim "consumed" words from start to cursor.

Hmm, the program is not necessarily horizontal 🤔 It can consist of many lines.
(Current vertical stack layout inspired by terminal REPL where each word was typed on separate line and stack was printed vertically between words:

black
    [█]
white
    [█]
    [ ]
fade
    [█▓▒░ ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant