Re: Superclass defaults

2011-08-30 Thread Victor Nazarov
) Cons: Intervention is required into client code (But I think it is required anyway). -- Victor Nazarov ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: GHCJS

2011-08-04 Thread Victor Nazarov
On Wed, Aug 3, 2011 at 2:44 PM, Simon Marlow marlo...@gmail.com wrote: On 03/08/2011 11:09, Victor Nazarov wrote: On Wed, Aug 3, 2011 at 11:30 AM, Simon Peyton-Jones simo...@microsoft.com  wrote: So perhaps that's the problem. parseDynamicFlags could perfectly well simply return any un

Re: GHCJS

2011-08-04 Thread Victor Nazarov
instead of integers at first to get things rolling. * in javascript we better use other unpacking function for strings, since Javascript strings doesn't have terminating NUL and have length built-in. -- Victor Nazarov ___ Glasgow-haskell-users mailing

Re: GHCJS

2011-08-03 Thread Victor Nazarov
during compilation I should generate stubs on? -- Victor Nazarov ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: GHCJS

2011-08-03 Thread Victor Nazarov
. In GHCJS we better provide our own desugaring, then add terminating '\0' to strings to emulate C-string with Javascript-strings. -- Victor Nazarov ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman

GHCJS

2011-08-02 Thread Victor Nazarov
can I do it? [1] https://github.com/sviperll/ghcjs [2] http://www.haskell.org/haskellwiki/GHC:FAQ#Why_isn.27t_GHC_available_for_.NET_or_on_the_JVM.3F -- Victor Nazarov ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http

Re: StgExpr AST

2011-02-10 Thread Victor Nazarov
: https://github.com/sviperll/ghcjs/blob/master/src/Compiler/Main.hs -- Victor Nazarov ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

generating C stubs with GHC API

2010-11-03 Thread Victor Nazarov
I would like to get access to functions exported from Haskell module and to generate custom stubs for them using GHC API. As I understand, I need to obtain a list of ForeignDecl's (data structure defined in HsDecls GHC module) for given source module. How to achieve this with GHC API? -- Victor

Compiling base with custom compilation script

2010-09-01 Thread Victor Nazarov
. I think it's caused by circular dependencies between modules. And I think my compilation script is not quite correct for this case. What do you think? -- Victor Nazarov ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http

DataCon workers and wrapers through GHC API

2010-08-24 Thread Victor Nazarov
Is it possible to generate bindings for worker and wrapper of data constructor through GHC API? How can I do it? I want CoreBindings or StgBindings for workers and wrappers for all data constructors of the module... -- Victor Nazarov ___ Glasgow

Re: Redefining built in syntax

2008-01-01 Thread Victor Nazarov
On Dec 31, 2007 7:58 PM, Neil Mitchell [EMAIL PROTECTED] wrote: Hi, I'm getting errors such as: C:/Documents/Uni/packages/base/GHC/Base.lhs:270:12: Illegal binding of built-in syntax: [] When I try and compile GHC/Base.lhs using the GHC API. Is there some flag I can pass to allow the

The order if bindings generated by GHC

2007-11-19 Thread Victor Nazarov
I use STG-bindings generated by GHC during CoreToSTG phase. What is the order of this bindings is it random or does it correspond to original source code or does it reflect the dependency structure of the program? If I define the following in my program: data Numeral = Zero | Succ Numeral zero =

Re: The order if bindings generated by GHC

2007-11-19 Thread Victor Nazarov
On Nov 19, 2007 9:39 PM, [EMAIL PROTECTED] wrote: I always - naively - thought that it is a non-problem. How many times have I written stuff like that:... ping = 0 : pong pong = 1 : ping It seems that I don't understand the question of Victor Nazarov, nor the answer of SPJ

The order if bindings generated by GHC

2007-11-19 Thread Victor Nazarov
STG syntax: Foo.zero = NO_CCS Foo.Zero! []; SRT(Foo.zero): [] Foo.one = NO_CCS Foo.Succ! [Foo.Zero]; SRT(Foo.one): [] Foo.ten = NO_CCS Foo.Succ! [Foo.one]; SRT(Foo.ten): [] Foo.Zero = NO_CCS Foo.Zero! []; SRT(Foo.Zero): [] Foo.Succ = \r [eta_s68]

Building a prelude

2007-11-07 Thread Victor Nazarov
Is it possible to build Prelude from scratch. Or just some modules like GHC.Base. For example when I do % ghcjs-inplace.bat -fglasgow-exts -fjavascript -cpp -c Err.lhs-boot % ghcjs-inplace.bat -fglasgow-exts -fjavascript -cpp -c Base.lhs I've got this error: Base.lhs:94:0: Bad interface

Additional thunk for function

2007-09-21 Thread Victor Nazarov
What is the purpose for GHC to allocate a thunk for some functions? Why Test.map is not a function, but updatable thunk, which should become equal to the function just after the first call? Here is the details: % ghc -c test.hs -ddump-stg STG syntax:

Additional thunk for function

2007-09-21 Thread Victor Nazarov
I have reproduced it on 2 Windows machines with ghc 6.6 and 6.6.1 Here is the version information for ghc used to generate output in original message. % ghc -v Glasgow Haskell Compiler, Version 6.6, for Haskell 98, compiled by GHC version 6.6 Using package config file: C:\Program Files\Visual

Re: Additional thunk for function

2007-09-21 Thread Victor Nazarov
Here is some more details: % ghc -c -ddump-stg T1.hs STG syntax: T1.map = \u [] let { map1_sdR = \r [f_sdN ds_sdI] case ds_sdI of wild_sdU { [] - [] []; : x_sdM

Re: [Haskell-cafe] GHC 6.7 on Windows / containers-0.1 package?

2007-09-21 Thread Victor Nazarov
Is this still up-to-date with the way GHC/GHCi work internally? Then I'll certainly check it out. I think it isn't since STG is pretty much different with the G-machine describes in the book. The original paper about Spineless Tagless G-machine is here [1]. It is quite verbose. Recent paper How

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