Re: STG to JavaScript translation

2007-09-21 Thread Victor Nazarov
On 9/20/07, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: > > | Cool, is it implemented in 2.8? Function tagging seems promising for > | performance. But it isn't implementable in JavaScript :) > > I think it'll be in GHC 6.8. > I've meant 6.8 :) -- vir http://vir.comtv.ru/ _

RE: STG to JavaScript translation

2007-09-20 Thread Simon Peyton-Jones
| Cool, is it implemented in 2.8? Function tagging seems promising for | performance. But it isn't implementable in JavaScript :) I think it'll be in GHC 6.8. | I have one more question. There are know calls (saturated | applications) and unknown calls in STG. Is this information is encoded | in

Re: STG to JavaScript translation

2007-09-20 Thread Victor Nazarov
> Read our paper "Faster laziness using dynamic pointer tagging"! It's new > (ICFP'07) > http://research.microsoft.com/~simonpj/papers/ptr-tag/index.htm > > simon > Cool, is it implemented in 2.8? Function tagging seems promising for performance. But it isn't implementable in JavaScript :) I ha

RE: STG to JavaScript translation

2007-09-20 Thread Simon Peyton-Jones
| > For example: | > | > f = | > let g = (THUNK h x) | > in (CONS g y) | > | > Is this exactly the same as (right variant following the paper) | > | > f = | > let g = (THUNK h x) | > in let freshvar = (CONS g y) | > in freshvar Yes that's right. The only problem with the latter is t

Re: STG to JavaScript translation

2007-09-19 Thread Stefan O'Rear
On Thu, Sep 20, 2007 at 06:13:38AM +0400, Victor Nazarov wrote: > I still have some questions regarding the GHC internals. > There is a description of STG language in the "Making a Fast Curry: > Push/Enter vs. Eval/Apply for Higher-oder Languages" (2004) by Simon > Marlow and Simon Peyton Jones pap

STG to JavaScript translation

2007-09-19 Thread Victor Nazarov
I still have some questions regarding the GHC internals. There is a description of STG language in the "Making a Fast Curry: Push/Enter vs. Eval/Apply for Higher-oder Languages" (2004) by Simon Marlow and Simon Peyton Jones paper. In this description the constructor application (CONS closure) can o

Re: STG to JavaScript translation

2007-09-19 Thread Victor Nazarov
I still have some questions regarding the GHC internals. There is a description of STG language in the "Making a Fast Curry: Push/Enter vs. Eval/Apply for Higher-oder Languages" (2004) by Simon Marlow and Simon Peyton Jones paper. In this description the constructor application (CONS closure) can o

Re: STG to JavaScript translation

2007-09-17 Thread Philippa Cowderoy
On Mon, 17 Sep 2007, Neil Mitchell wrote: > Hi > > > case e of b { pati -> rhsi } > > > > * evaluates 'e', > > * binds the resulting value to 'b', > > * performs case analysis on the result to find which alternative to choose > > * binds the variables of the pattern to the components of the value

Re: STG to JavaScript translation

2007-09-17 Thread Neil Mitchell
Hi > case e of b { pati -> rhsi } > > * evaluates 'e', > * binds the resulting value to 'b', > * performs case analysis on the result to find which alternative to choose > * binds the variables of the pattern to the components of the value The Yhc.Core translator converts this to: let b = e in c

RE: STG to JavaScript translation

2007-09-17 Thread Simon Peyton-Jones
p://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType does that help? Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On | Behalf Of Victor Nazarov | Sent: 17 September 2007 11:48 | To: glasgow-haskell-users@haskell.org | Subject: STG to

Re: STG to JavaScript translation

2007-09-17 Thread Simon Marlow
Victor Nazarov wrote: Hello. I'm working on the translation of GHC's STG language to JavaScript. I've started my implementation, but I've got stuck with the STG case statements. The problem is the binder in case expression. StgCase expr livevars liverhsvars bndr srt alttype alts Operationally,

Re: STG to JavaScript translation

2007-09-17 Thread Neil Mitchell
Hi Are you aware that Dimitry is still working on ycr2js - and has made great progress. There are details available in The Monad Reader, issue 7 (http://www.haskell.org/haskellwiki/The_Monad.Reader) Thanks Neil On 9/17/07, Victor Nazarov <[EMAIL PROTECTED]> wrote: > Hello. > I'm working on the

STG to JavaScript translation

2007-09-17 Thread Victor Nazarov
Hello. I'm working on the translation of GHC's STG language to JavaScript. I've started my implementation, but I've got stuck with the STG case statements. The problem is the binder in case expression. StgCase expr livevars liverhsvars bndr srt alttype alts Operationally, I need to save continuat