Skip to content

More useful leave stack#72

Merged
mkobetic merged 1 commit intomainfrom
lstack
Mar 28, 2026
Merged

More useful leave stack#72
mkobetic merged 1 commit intomainfrom
lstack

Conversation

@mkobetic
Copy link
Copy Markdown
Owner

@mkobetic mkobetic commented Mar 18, 2026

Leave stack is only used during word compilation. It seems wasteful to have a chunk of RAM just sitting there mostly unused.

This PR adds 6 words for the leave stack to match what's available for return stack, to make it similarly usable for stashing values temporarily. Given that it's only used for compilation, it has fewer restrictions as a value stash than the return stack (e.g. no issue with loops).

However it will be somewhat slower since we do not have a register permanently allocated for it and the words are implemented in ITC (for now). It would be quite feasible to speed things up a bit with native words, if desired.

@@ -1,32 +1,4 @@
# SPDX-License-Identifier: GPL-3.0-only

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to separate the lstack words from leave so that it is set up for potential native implementations of those.

@mkobetic mkobetic force-pushed the lstack branch 5 times, most recently from 11df22c to cda6f38 Compare March 23, 2026 03:44
@mkobetic mkobetic merged commit 16af9a0 into main Mar 28, 2026
3 checks passed
@mkobetic mkobetic deleted the lstack branch March 28, 2026 00:18
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

Successfully merging this pull request may close these issues.

1 participant