Re: Superclass defaults

2011-08-30 Thread Victor Nazarov
require any extensions. Three extensions seems simple when separate (I think there are many corner cases) Cons: Intervention is required into client code (But I think it is required anyway). -- Victor Nazarov ___ Glasgow-haskell-users mailing lis

Re: GHCJS

2011-08-04 Thread Victor Nazarov
use some very simple Integer implementation. We can use doubles 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 ___

Re: GHCJS

2011-08-04 Thread Victor Nazarov
On Wed, Aug 3, 2011 at 2:44 PM, Simon Marlow wrote: > On 03/08/2011 11:09, Victor Nazarov wrote: >> >> On Wed, Aug 3, 2011 at 11:30 AM, Simon Peyton-Jones >>  wrote: > >>> So perhaps that's the problem. parseDynamicFlags could perfectly well >>> s

Re: GHCJS

2011-08-03 Thread Victor Nazarov
ecific. For instance string literals are desugared into application of GHC.unpackCString :: Addr# -> String to some address wich points to '\0' terminated C-string. In GHCJS we better provide our own desugaring, then add terminating '\0' to strings to emula

Re: GHCJS

2011-08-03 Thread Victor Nazarov
t possible at all? > > Well, GHC generates the stub code in its code generator, doesn't it?  If you > don't call the code generator, because you are using yours instead, then > it'll be up to you to generate the stub code, no? I can access ForeignStubs datatype, but I think it already have generated C-code in it, havn't it? What step 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

GHCJS

2011-08-02 Thread Victor Nazarov
like to create ghcjs and ghcjs-pkg tools that will use their own directories and package index and will not interfere with ghc. Is it possible with GHC API? How 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_

Re: StgExpr AST

2011-02-10 Thread Victor Nazarov
Haskell to Javascript translator using GHC API. And I've ended with the following code to access STG: 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? -- V

Compiling base with custom compilation script

2010-09-01 Thread Victor Nazarov
load Prelude module which is not loadable". I don't remember the exact text and I have no access to my developing-machine. 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? -- Vi

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: GHC logo ideas (was: Re: ANN: Mac installer pkg for GHC - 6.8.2.20080211 trial release (Leopard, Intel))

2008-02-14 Thread Victor Nazarov
On Fri, Feb 15, 2008 at 2:20 AM, Tim Chevalier <[EMAIL PROTECTED]> wrote: > > Well, I got bored in class, so here's a sketch: > http://lafalafu.com/krc/Scratch/ghc-logo-idea.png > > This is still based on Yitzhak's idea of incorporating the Clyde Arc. > The extra bit of the lambda that extends

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

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

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

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 =

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 file

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 "H

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

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 Has

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/ _

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:

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

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

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