How do you know the optimizing compiler does or doesn't perform one
additional read/write when the result goes to 'the' stack instead of going
to a different data structure?  I couldn't build a compiler, but I think
the registers are being used at times, and that the stack is a metaphor.
 Factor certainly is written better than simply treating each word as a
jump, which early forths did, before inlining.  It may be fewer ops to do
it the first way rather than the second, as the second actually contains
the first, plus the temp storage of cut pieces pre-pan.



On Sat, Jul 7, 2012 at 2:03 AM, graham telfer <gakouse...@hotmail.com>wrote:

>
>
> ------------------------------
> Thanks to everybody who gave me suggestions about the stack. I'd like to
> add a final comment about why I think the stack is useful in this case.
>
> Imagine you are going to chop up a carrot to cook it. There are 2 ways you
> might go about the job: the first is to cut off a piece and then turn and
> put it into the pan ready to cook. Keep doing this, cutting one piece at a
> time, turning and putting each piece of carrot into the pan until there is
> no carrot left. The second way is to cut the carrot into pieces and then
> put all of the pieces into the pan as a single operation.
>
> I see the second way as analagous to using the stack. Do all the dividing
> then put all the values into the data structure as a single operation. I do
> not see this as using the stack as a data structure; just a convenient
> holding pen.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to