Article View: comp.lang.functional
Article #912Re: Is efficient backtracking feasible in functional languages?
From: Thomas M. Breuel
Date: Sun, 15 Nov 1992 19:53
Date: Sun, 15 Nov 1992 19:53
22 lines
1628 bytes
1628 bytes
In article <1992Nov12.220621.14143@cs.tu-berlin.de> wg@opal.cs.tu-berlin.de (Wolfgang Grieskamp) writes: > strangesucc n = hd [x|x<-[0..];x>n]; > ... > [Major collection... 21% used (3397260/15733684), 1920 msec] > ... > GC Stack Overflow ! Whats funny with this example that the stream (lazy list) in the list comprehension can be seen as an imperative counter which is communicated to the consumer (hd): [example deleted] Sure. Many such expressions can be converted into something imperative (c.f. the CommonLisp Iterate macros). However, some interesting and useful others cannot. In general, I do think it would be nice if streams became a part of eager functional programming languages and if optimizers tried to do a better job at optimizing them. What about it for "SML the next generation"? Thomas.
Technical Details
Message-ID:
<TMB.92Nov15195322@arolla.idiap.ch>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmbReferences:
<1992Nov11.171742.18783@eua.ericsson.se> <lg3071INN8m1@exodus.Eng.Sun.COM> <1992Nov12.220621.14143@cs.tu-berlin.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb From: tmb@arolla.idiap.ch (Thomas M. Breuel) Newsgroups: comp.lang.functional Subject: Re: Is efficient backtracking feasible in functional languages? Followup-To: comp.lang.functional Date: 15 Nov 92 19:53:22 Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle Perceptive) Lines: 22 Message-ID: <TMB.92Nov15195322@arolla.idiap.ch> References: <1992Nov11.171742.18783@eua.ericsson.se> <lg3071INN8m1@exodus.Eng.Sun.COM> <1992Nov12.220621.14143@cs.tu-berlin.de> Reply-To: tmb@idiap.ch NNTP-Posting-Host: arolla.idiap.ch In-reply-to: wg@opal.cs.tu-berlin.de's message of Thu, 12 Nov 1992 22:06:21 GMT