Re: [stack] Constant folding algorithm
"Daniel Ehrenberg" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
> Oh, then I misunderstood. You don't have access to a Factor evaluator, > or do you? Essentially I imagined you were performing a partial > evaluation of Factor step by step. If so then > I think you can detect the underflow by counting the number of > arguments that are about to be consumed, during each stage of the > evalution. > That makes sense. We kept misunderstanding each other, though. I have access to the Factor evaluator easily. (I also have access to the compiler, though it's not particularly useful.) > > > > That really surprise me, because I always thought that a language like > > > Joy or Cat (where there is only one explicit stack) was as easy to > > > work with as SSA. I suspect it is because Slava does his own register > > > allocations? > > > > > It might not be difficult to convert a stack language to SSA, but I > > have no idea how to change it back into a quotation. Anyway, I don't > > think such a transformation would work for this, since it would change > > the quotation in other ways. > > So when introspecting the code, you are getting the SSA form? > No, I get a quotation, which is manipulable like quotations in Joy, except that it's a random-access array rather than a linked list. The SSA form is only for compilation. Thanks for your help, Chris (and John, though I was already doing that)! Daniel Ehrenberg