DX-Forth uses a 256 byte return stack. The consequence of that is only
about 6 files can be included before it runs out.
dxf <[email protected]> writes:
DX-Forth uses a 256 byte return stack. The consequence of that is only
about 6 files can be included before it runs out.
If you mean 6 levels of nesting, that seems sufficient for a small
system. It's around 20 return stack cells for each level. Is that for
a blocks system, or do you have files?
I guess it's reasonable to set
aside a chunk of dictionary or block space to use as an explicit stack,
if you want to remember filenames.
Do you use RPICK or anything like that, to get at the data for the
current level?
I still don't understand the issue with using the data stack. Maybe I haven't thought about it enough.
It would prevent nested files from passing data on the stack.
Loading works on the principle of a 'current file' whose pointer is saved/restored during nesting.
dxf <[email protected]> writes:
...
Loading works on the principle of a 'current file' whose pointer is
saved/restored during nesting.
Ok but in this case why is the return stack depth a limiting factor?
The FDB pointer is just one cell, maybe even a static cell. Then you
have an array of FDB's that is used as a stack with the FDB pointer as a stack pointer, if I understand what you mean.
in blk etc). Then there's RS usage incurred during load/compile ofthe current file. It all adds up. My ?STACK does a RS check which is
For each nest there's state stuff that needs saving (loadline# source
in blk etc).
Then there's RS usage incurred during load/compile of the current
file. It all adds up.
dxf <[email protected]> writes:
For each nest there's state stuff that needs saving (loadline# source
in blk etc).
Oh I had figured that would be in the FDB. Does it have to be on the
stack for some reason?
Then there's RS usage incurred during load/compile of the current
file. It all adds up.
I wonder if moving the state to the FDB can get rid of the need for
stack nesting. Then it's just a matter of how many FDB's you want to
set aside space for. You could even put them in the ALLOCATE heap if
you have that.
I'd have to think how that could be made to work. OTOH RS exists and
as its entire purpose is nesting, why wouldn't I use it?
I don't have ALLOCATE for various reasons. It's always struck me as
black magic.
dxf <[email protected]> writes:
I'd have to think how that could be made to work. OTOH RS exists and
as its entire purpose is nesting, why wouldn't I use it?
Do you have to do a bunch of painful juggling to get at the several
relevant RS items? And as you say, it limits you to 6 levels.
I don't have ALLOCATE for various reasons. It's always struck me as
black magic.
It gets worse. Don't ever let anyone tell you about garbage collection ;).
dxf <[email protected]> writes:
For each nest there's state stuff that needs saving (loadline# source
in blk etc).
Oh I had figured that would be in the FDB. Does it have to be on the
stack for some reason?
Then there's RS usage incurred during load/compile of the current
file. It all adds up.
I wonder if moving the state to the FDB can get rid of the need for
stack nesting. Then it's just a matter of how many FDB's you want to
set aside space for. You could even put them in the ALLOCATE heap if
you have that.
In article <[email protected]>,
Paul Rubin <[email protected]d> wrote:
dxf <[email protected]> writes:
For each nest there's state stuff that needs saving (loadline# source
in blk etc).
Oh I had figured that would be in the FDB. Does it have to be on the
stack for some reason?
Then there's RS usage incurred during load/compile of the current
file. It all adds up.
I wonder if moving the state to the FDB can get rid of the need for
stack nesting. Then it's just a matter of how many FDB's you want to
set aside space for. You could even put them in the ALLOCATE heap if
you have that.
Somehow in addition to buffer information you must remember the
file identification. For unix and linux that is a handle that you
get back from OPEN-FILE. That is readily stored on the return stack,
if you are not in a pinch (on a 64 bit system). If you store this in
FDB still you have stack a reference to the FDB. I don't think you
can use the data stack for that.
Groetjes Albert
On 16/03/2026 7:21 am, Paul Rubin wrote:
dxf <[email protected]> writes:
DX-Forth uses a 256 byte return stack. The consequence of that is only
about 6 files can be included before it runs out.
If you mean 6 levels of nesting, that seems sufficient for a small
system. It's around 20 return stack cells for each level. Is that for
a blocks system, or do you have files?
On 16/03/2026 10:46 am, dxf wrote:
On 16/03/2026 7:21 am, Paul Rubin wrote:
dxf <[email protected]> writes:
DX-Forth uses a 256 byte return stack. The consequence of that is only >>>> about 6 files can be included before it runs out.
If you mean 6 levels of nesting, that seems sufficient for a small
system. It's around 20 return stack cells for each level. Is that for
a blocks system, or do you have files?
Has anyone that uses libraries with interdependencies (4tH ?) calculated >their worst case nesting level? ANS specified a minimum of 8 levels.
Curious as to how that figure panned out in reality.
On 16/03/2026 10:46 am, dxf wrote:
On 16/03/2026 7:21 am, Paul Rubin wrote:
dxf <[email protected]> writes:
DX-Forth uses a 256 byte return stack. The consequence of that is only >>>> about 6 files can be included before it runs out.
If you mean 6 levels of nesting, that seems sufficient for a small
system. It's around 20 return stack cells for each level. Is that for
a blocks system, or do you have files?
Has anyone that uses libraries with interdependencies (4tH ?) calculated their worst case nesting level? ANS specified a minimum of 8 levels.
Curious as to how that figure panned out in reality.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,123 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 36:17:56 |
| Calls: | 14,371 |
| Files: | 186,380 |
| D/L today: |
2,290 files (656M bytes) |
| Messages: | 2,540,645 |