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 that it's

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

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

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

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

RE: STG to JavaScript translation

2007-09-17 Thread Simon Peyton-Jones
/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 JavaScript translation | | Hello

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 case b

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 The