Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread Christopher Done
You also need an accomplice web server to host the JS file containing the JavaScript for the web worker to run. I don't see how you can "fork" threads without such support. On 13 November 2012 20:53, Luite Stegeman wrote: >> Does/can cabal-install support GHCJS? I suppose that's a minor advantage

Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread Luite Stegeman
> Does/can cabal-install support GHCJS? I suppose that's a minor advantage of > extending GHC itself; you get cabal support almost for free. Yes. There are two GHCJS installation options. One is the standalone option that includes wrappers for cabal and ghc-pkg. You use `ghcjs-cabal` to install p

Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread J. Stutterheim
One of the main reasons we didn't do this with UHC was that we had to focus on more elementary parts of the FFI/RTS first: dynamic/wrapper imports, object interaction, etc. I must admit that I forgot the exact reasons for not converting between the types automatically, after we had finished with

Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread J. Stutterheim
On 13 Nov 2012, at 19:08, Luite Stegeman wrote: > On Mon, Nov 12, 2012 at 9:16 AM, Jurriën Stutterheim > wrote: >> Hi all, >> >> foreign import js "%1.push(%2)" >>push :: JSArray a -> a -> IO (JSArray a) > > I'm not sure if it's even necessary to extend GHC itself for this. > Even though

Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread Christopher Done
On 13 November 2012 16:33, J. Stutterheim wrote: > Yes, I did check out other work that's been done in this area, albeit only > briefly. Unless I've overlooked it (which is very much possible), none of the > other solutions (except Fay) support an FFI that bridges the gap between JS's > OO and

Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread Luite Stegeman
On Mon, Nov 12, 2012 at 9:16 AM, Jurriën Stutterheim wrote: > Hi all, > > foreign import js "%1.push(%2)" > push :: JSArray a -> a -> IO (JSArray a) I'm not sure if it's even necessary to extend GHC itself for this. Even though this exact syntax (with the js calling convention name) is not

Re: Where has the special built-in inline function gone?

2012-11-13 Thread Johan Tibell
Thanks all. I've filed a bug for improving the docs. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Where has the special built-in inline function gone?

2012-11-13 Thread Mikhail Glushenkov
Hi Johan, On Tue, Nov 13, 2012 at 6:34 PM, Johan Tibell wrote: > Hi all, > > For the first time, I wanted to use the special built-in inline function. To > my dismay, I can't find it anywhere! On my system (GHC 7.4.2), it is accessible through GHC.Exts. -- () ascii ribbon campaign - against h

Where has the special built-in inline function gone?

2012-11-13 Thread Johan Tibell
Hi all, For the first time, I wanted to use the special built-in inline function. To my dismay, I can't find it anywhere! Here's a minimal example: --8<- module Main where import GHC.Prim f x = x + 1 {-# INLINE f #-} g h x = inline h x main = print $ g f 1 --8<- $ ghc /tmp/

Re: UHC-like JavaScript backend in GHC

2012-11-13 Thread J. Stutterheim
On 13 Nov 2012, at 16:17, Simon Peyton-Jones wrote: > | currently doing. Before I get started: does the GHC architecture > | currently allow for adding a new calling convention which departs from > | the conventional C FFIs and introduces a custom RTS? > > GHC certainly supports new back ends.

RE: UHC-like JavaScript backend in GHC

2012-11-13 Thread Simon Peyton-Jones
| currently doing. Before I get started: does the GHC architecture | currently allow for adding a new calling convention which departs from | the conventional C FFIs and introduces a custom RTS? GHC certainly supports new back ends. You'd probably want to replace the entire back end, and go from

Re: Using DeepSeq for exception ordering

2012-11-13 Thread Simon Hengel
> Sounds like a bug, -fpedantic-bottoms should work here. Please open a > ticket. done [1]. [1] http://hackage.haskell.org/trac/ghc/ticket/7411 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/lis

Re: Undocumented(?) magic "this" package-id in PackageImports

2012-11-13 Thread Herbert Valerio Riedel
Simon Marlow writes: > Please submit a bug (ideally with a patch!). It should be documented. done -> http://hackage.haskell.org/trac/ghc/ticket/7409 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailm

Re: Using DeepSeq for exception ordering

2012-11-13 Thread Simon Marlow
On 12/11/2012 16:56, Simon Hengel wrote: Did you try -fpedantic-bottoms? I just tried. The exception (or seq?) is still optimized away. Here is what I tried: -- file Foo.hs import Control.Exception import Control.DeepSeq main = evaluate (('a' : undefined) `deepseq` return

Re: Undocumented(?) magic "this" package-id in PackageImports

2012-11-13 Thread Simon Marlow
Please submit a bug (ideally with a patch!). It should be documented. However, note that we don't really like people to use PackageImports. It's not a carefully designed feature, we only hacked it in so we could build the base-3 wrapper package a while ago. It could well change in the future.

Undocumented(?) magic "this" package-id in PackageImports

2012-11-13 Thread Herbert Valerio Riedel
Hello Simon, I just found out that in combination with the PackageImports extension there's a special module name "this" which according to [1] always refers to the current package. But I couldn't find this rather useful feature mentioned in the GHC 7.6.1 Manual PackageImports section[2]. Has this