Re: Iterator

neelk@alum.mit.edu (Neelakantan Krishnaswami)
27 May 2002 01:15:43 -0400

          From comp.compilers

Related articles
Iterator takusi@manjiro.net (2002-05-23)
Re: Iterator neelk@alum.mit.edu (2002-05-27)
Re: Iterator rhydemscs@aol.com (Randall Hyde) (2002-05-27)
Re: Iterator joachim_d@gmx.de (Joachim Durchholz) (2002-05-27)
Re: Iterator haberg@matematik.su.se (Hans Aberg) (2002-05-27)
Re: Iterator bobduff@shell01.TheWorld.com (Robert A Duff) (2002-05-31)
| List of all articles for this month |

From: neelk@alum.mit.edu (Neelakantan Krishnaswami)
Newsgroups: comp.compilers
Date: 27 May 2002 01:15:43 -0400
Organization: ATT Broadband
References: 02-05-125
Keywords: design
Posted-Date: 27 May 2002 01:15:43 EDT

Takuya Murata <takusi@manjiro.net> wrote:
> Now, I'm making a compiler. I want to support a loop feature as
> iterators like Sather.
>
> http://www.icsi.berkeley.edu/~sather/Documentation/LanguageDescription/webmaker/DescriptionX2Eiterators-chapte-1.html#HEADING1-5
>
> The problem is as if two stacks exists concurrently. I couldn't find
> a compiler construction book about how to implement iterator
> mechanism. Anyone suggestion?


Sure. At the conceptual level you want to understand what
continuations are, and how you can use them to implement coroutines.
Then to use them to implement Sather-style iterators you can look at:


  Featherweight Concurrency in a Portable Assembly Language. Ramsey and
  Peyton-Jones. http://citeseer.nj.nec.com/ramsey01featherweight.html


"Concurrency" in this paper refers to coroutine-style user threads,
which are basically the same as Sather/CLU-style iterators.


--
Neel Krishnaswami
neelk@alum.mit.edu


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.