Re: Reading Core

2011-11-14 Thread David Terei
Great thanks everyone! On 14 November 2011 04:38, Simon Peyton-Jones wrote: > If you wanted to write a Wiki page in the Commentary summarising your > understanding, I'd be happy to check it over.  Think of the page you'd *like* > to have read rather than working it out by experiment. Sure. I'm

RE: Reading Core

2011-11-14 Thread Simon Peyton-Jones
| - case = only place evaluation occurs | - let = only place heap allocation occurs / thunk creation / introduce laziness As Simon says, that's not true of Core, only of STG (or Core after CorePrep). In a application (f e), where is not "trivial" (see CoreUtils.exprIsTrivial), - the a

Re: Reading Core

2011-11-14 Thread Simon Marlow
On 13/11/2011 01:30, David Terei wrote: Hi all, I've seen it said in various places that for Core the semantics are basically: - case = only place evaluation occurs - let = only place heap allocation occurs / thunk creation / introduce laziness These are both true after the CorePrep phas

Re: Reading Core

2011-11-14 Thread Max Bolingbroke
On 13 November 2011 01:30, David Terei wrote: > Can anyone confirm that in Core let bindings _aren't_ the only place > allocation occur (so read it like Haskell) but the 2 rules do hold for > STG? Or maybe I'm dumping core wrong... Yep I think you are right - allocation is only confined to "let"

Reading Core

2011-11-12 Thread David Terei
semantics as Haskell, where you need to still look at function application as potentially creating a thunk. e.g In the paper 'A transformation-based optimiser for Haskell' the above two rules for reading core are given, as is the example: g :: (Double -> Double -> Double) -> D