Re: Re: Stack based machines

"Quinn Tyler Jackson" <qjackson@wave.home.com>
28 Mar 2000 00:59:54 -0500

          From comp.compilers

Related articles
Stack based machines thand@pmail.net (Linus Thand) (2000-03-23)
Re: Stack based machines pieter@cs.kun.nl (Pieter Koopman) (2000-03-25)
Re: Re: Stack based machines qjackson@wave.home.com (Quinn Tyler Jackson) (2000-03-28)
| List of all articles for this month |

From: "Quinn Tyler Jackson" <qjackson@wave.home.com>
Newsgroups: comp.compilers
Date: 28 Mar 2000 00:59:54 -0500
Organization: Compilers Central
References: 00-03-101 00-03-128
Keywords: architecture

"Pieter Koopman" <pieter@cs.kun.nl> said:


> > What is happening in the world of stack-based machines?
> > Are there any active groups working on processors or
> > compilers (I'm especially interested in functional languages).
>
> Many modern functional language implementations like Haskell
> (www.haskell.org) and Clean (www.cs.kun.nl/~clean) use stack-based
> abstract machines for their compilation schemes.


More than a few LPM users complain that the syntax is ugly, but I try
to remind them that since the patterns are compiled to an interpreted
machine at runtime, the reverse notation allows for efficient pattern
compilation, since each parameter is just pushed to a stack, and once
the last character is encountered, the entire clause is available for
compilation.


      % 2-5 'a' ; 'b' {NOCASE} !


"Match 2 to 5 hits from the sets 'a' or 'b', disregarding case."


It got enough response for ugliness that I added some predefined macros:


        <!('a' ; 'b', 2-5, NOCASE)>


Which just expands to the more easily parsed version under the hood.
Some would even have the more verbose macro "class" instead of the
bang...


        <class ('a' ; 'b', 2-5, NOCASE)>


--
Quinn Tyler Jackson


http://qtj.n3.net/~quinn/


Post a followup to this message

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