[Haskell-cafe] Re: I love purity, but it's killing me.

2009-06-09 Thread Chung-chieh Shan
Paul L wrote in article <856033f20906082224s2b7d5391gdc7a4ed913004...@mail.gmail.com> in gmane.comp.lang.haskell.cafe: > The open question is whether there exists such a > solution that's both elegant and efficient at maintain proper sharing > in the object language. What is your criterion for

Re: [Haskell-cafe] Re: I love purity, but it's killing me.

2009-06-08 Thread Paul L
Interpreting lambda calculus is neither cheap or efficient, otherwise we wouldn't all be using compilers :-) By "interpretive overhead" of adding Let/Rec/LetRec to an object language I mean the need to introduce variables, scoping, and environment (mapping variables to either values or structures

Re: [Haskell-cafe] Re: I love purity, but it's killing me.

2009-06-06 Thread Chung-chieh Shan
On 2009-05-27T03:58:58-0400, Paul L wrote: > One possible solution is to further introduce a fixed point data > constructor, a Rec or even LetRec to explicitly capture cycles. But > then you still incur much overheads interpreting them, I don't understand this criticism -- what interpretive overhe

[Haskell-cafe] Re: I love purity, but it's killing me.

2009-05-29 Thread Heinrich Apfelmus
Conal Elliott wrote: > Sittampalam, Ganesh wrote >> In my experience [1], observable sharing using GHC's stable names is a >> pretty effective solution to this problem. > > Plus unsafePerformIO and weak references as in *Stretching the storage > manager: weak pointers and stable names in > Haskell

Re: [Haskell-cafe] Re: I love purity, but it's killing me.

2009-05-27 Thread Paul L
BTW, I doubt the (cyclic) sharing problem relates that much to purity, because in an impure language (or the unsafe observable sharing), you still have to remember whether something has been traversed or not and in the worst case accumulates everything that's been traversed so far before releasing

Re: [Haskell-cafe] Re: I love purity, but it's killing me.

2009-05-27 Thread Paul L
Let-expression in the EDSL indeed solves the sharing problem, but only partially. Recursion appears when you have a leaf node pointing back to the root node or another branch and forming a cyclic graph in the data structure. It is often desirable to recover cyclic sharing when showing/reading/inter

[Haskell-cafe] Re: I love purity, but it's killing me.

2008-02-13 Thread Chung-chieh Shan
Henning Thielemann <[EMAIL PROTECTED]> wrote in article <[EMAIL PROTECTED]> in gmane.comp.lang.haskell.cafe: > It seems to become a FAQ. I think all DSLs suffer from the same problems: > sharing and recursion. I've used wrappers for CSound, SuperCollider, > MetaPost, they all have these problems.