Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-06 Thread Greg Weber
I created a GHC patch that spits out the generated Template Haskell code to a file with -dump-to-file -ddump-splices https://ghc.haskell.org/trac/ghc/ticket/9126 On Sat, Jul 5, 2014 at 8:18 PM, adam vogt wrote: > Zeroth takes the first approach. It only supports a subset of TH > (DecsQ splices)

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread adam vogt
Zeroth takes the first approach. It only supports a subset of TH (DecsQ splices) however. http://hackage.haskell.org/package/zeroth https://github.com/aavogt/zeroth is a fork that works with more recent haskell-src-exts and ghc On Sat, Jul 5, 2014 at 3:59 PM, John Meacham wrote: > Actually, I w

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Luite Stegeman
rg/package/template-haskell-2.9.0.0/docs/Language-Haskell-TH-Syntax.html , the Quasi class for the required functionality). This would mean serializing all names with types modules, annotations, instances. I briefly looked into this for GHCJS but decided that just querying the compiler would be better

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread John Meacham
The target compiler would have the TH libraries, which could be made to be portable. The external program would just extract the TH bits and turn them into a program that spits the TH expanded output to a new file to compile, and repeat the process til no TH expansions exist and finally that is the

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Luite Stegeman
How would you do reification with that approach? On Sat, Jul 5, 2014 at 9:59 PM, John Meacham wrote: > Actually, I was looking into it a little, and template haskell could > effectively be implemented by a pre-processor and a portable library > that is compiler independent. If one could get ghc

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread John Meacham
Actually, I was looking into it a little, and template haskell could effectively be implemented by a pre-processor and a portable library that is compiler independent. If one could get ghc to spit out the template haskell source after it expands it then that can be fed to jhc as a quick first pass,

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Brandon Allbery
On Sat, Jul 5, 2014 at 1:34 PM, Carter Schonwald wrote: > does JHC support template haskell? Pretty sure TH is too closely tied to ghc. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Carter Schonwald
> >>> > >>> On Wed, Jul 2, 2014 at 2:20 PM, Carter Schonwald > >>> wrote: > >>>> wow, this is great work! > >>>> > >>>> If theres a clear path to getting the generic tooling into 7.10, i'm > all > >>>

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-05 Thread Scott Turner
l >>>> for it :) (and willing to help on concrete mechanical subtasks) >>>> >>>> >>>> On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman >>>> wrote: >>>>> hi all, >>>>> >>>>> I've adde

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-04 Thread John Meacham
t;> >>>> wow, this is great work! >>>> >>>> If theres a clear path to getting the generic tooling into 7.10, i'm all >>>> for it :) (and willing to help on concrete mechanical subtasks) >>>> >>>> >>>> On Wed, Jul

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-04 Thread Luite Stegeman
omplicated and making > maintaining it harder, then I’m open to your proposals. > > > I think most of the communication code could go into a separate executable that can be built by the user for the target-specific communication. The GHC API facing part of the implementation in GHCJS is

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread Dominick Samperi
great work! >>> >>> If theres a clear path to getting the generic tooling into 7.10, i'm all >>> for it :) (and willing to help on concrete mechanical subtasks) >>> >>> >>> On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman >>> w

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread John Meacham
ote: >> >> wow, this is great work! >> >> If theres a clear path to getting the generic tooling into 7.10, i'm all >> for it :) (and willing to help on concrete mechanical subtasks) >> >> >> On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman >

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread Luite Stegeman
I think GHC could use more or less the same communication method as GHCJS now does: Start some user-specifiied process and send messages through pipes (GHCJS uses stdin/stderr of the node process), with the difference that it would get dynamic libraries for the target rather than blobs of JS code

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-03 Thread CJ van den Berg
Yes! This would definitely be of great interest to users of the Android cross compilers. It should be quite feasible to drive a TH runner process on a development device or emulator. Having genuine TH support would be a huge improvement to the usefulness of GHC in a cross compiling scenario. I wou

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-02 Thread Carter Schonwald
into 7.10, i'm all > for it :) (and willing to help on concrete mechanical subtasks) > > > On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman > wrote: > >> hi all, >> >> I've added some code [1] [2] to GHCJS to make it run Template Haskell >>

Re: GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-02 Thread Carter Schonwald
wow, this is great work! If theres a clear path to getting the generic tooling into 7.10, i'm all for it :) (and willing to help on concrete mechanical subtasks) On Wed, Jul 2, 2014 at 12:14 PM, Luite Stegeman wrote: > hi all, > > I've added some code [1] [2] to GHCJS to m

GHCJS now runs Template Haskell on node.js - Any interest in out of process TH for general cross compilation?

2014-07-02 Thread Luite Stegeman
hi all, I've added some code [1] [2] to GHCJS to make it run Template Haskell code on node.js, rather than using the GHC linker. GHCJS has supported TH for a long time now, but so far always relied on native (host) code for it. This is the main reason that GHCJS always builds nativ

GHCJS, JavaScript, cross-platform typechecking with the GHC API and primops

2013-01-25 Thread Luite Stegeman
hi all, I've been working on GHCJS [1] for a while and am trying to get it to work on 64 bit GHC. A quick background: GHCJS uses the GHC API to generate STG, which it then translates to JavaScript. It uses slightly patched versions of the integer-gmp, base and ghc-prim libraries and sup

Re: Compiling ghcjs

2012-07-02 Thread Simon Marlow
On 27/06/2012 13:24, Nathan Hüsken wrote: I hope this is the correct list to ask this question. I am trying to compile the ghcjs compiler. I am on ubuntu 12.04 and have ghc-7.4.1 installed (via apt-get). I am following the instruction I found here: https://github.com/ghcjs/ghcjs The first

Compiling ghcjs

2012-06-27 Thread Nathan Hüsken
Hi, I hope this is the correct list to ask this question. I am trying to compile the ghcjs compiler. I am on ubuntu 12.04 and have ghc-7.4.1 installed (via apt-get). I am following the instruction I found here: https://github.com/ghcjs/ghcjs The first trouble comes with "git pull ghcjs&qu

Re: GHCJS

2011-08-05 Thread Simon Marlow
On 04/08/2011 21:02, Simon Peyton-Jones wrote: | data LiteralDesugaring m = |LiteralDesugaring | { desugarInt :: MonadThings m => Integer -> m CoreExpr | , desugarWord :: MonadThings m => Integer -> m CoreExpr ... I am not sure why you want to control the desugaring of literal

Re: GHCJS

2011-08-04 Thread Victor Nazarov
On Fri, Aug 5, 2011 at 12:02 AM, Simon Peyton-Jones wrote: > |  data LiteralDesugaring m = > |    LiteralDesugaring > |      { desugarInt :: MonadThings m => Integer -> m CoreExpr > |      , desugarWord :: MonadThings m => Integer -> m CoreExpr > ... > > I am not sure why you want to control the d

RE: GHCJS

2011-08-04 Thread Simon Peyton-Jones
| > So then parseDynamicFlags should be split into two layers, the lower | > layer returning unused flags, and the upper layer generating errors. | | It's not that simple. In | ghcjs -O -someflag something -Wall | is "something" an argument to someflag, or a file to be c

RE: GHCJS

2011-08-04 Thread Simon Peyton-Jones
| data LiteralDesugaring m = |LiteralDesugaring | { desugarInt :: MonadThings m => Integer -> m CoreExpr | , desugarWord :: MonadThings m => Integer -> m CoreExpr ... I am not sure why you want to control the desugaring of literals. Why literals? And why is literals enough? | B

Re: GHCJS

2011-08-04 Thread Victor Nazarov
for a callback, like we do for printing error messages, > so the GHC API client passes in a callback to do whatever backend-specific > desugaring is required.  The callback mechanism could be used for lots of > things - I can imagine it growing into a record of backend-specific > funct

Re: GHCJS

2011-08-03 Thread Ian Lynagh
gt; >like filenames, but it throws error if un-consumed argument starts > >with dash. > > So then parseDynamicFlags should be split into two layers, the lower > layer returning unused flags, and the upper layer generating errors. It's not that simple. In ghcjs -O -someflag s

Re: GHCJS

2011-08-03 Thread Brandon Allbery
On Wed, Aug 3, 2011 at 11:55, Christiaan Baaij wrote: > >> So perhaps that's the problem. parseDynamicFlags could perfectly well > simply return any un-recognised flags. Indeed, I thought it did just that -- > it certainly returns a list of un-consumed arguments. If it doesn't perhaps > that's a

Re: GHCJS

2011-08-03 Thread Christiaan Baaij
bug. > > parseDynamicFlags returns un-consumed arguments if they are something > like filenames, but it throws error if un-consumed argument starts > with dash. Maybe you can wrap the GHCJS into a plugin now that plugin support is finally in GHC 7.2.* , and generate the javascript as a sid

Re: GHCJS

2011-08-03 Thread Simon Marlow
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 simply return any un-recognised flags. Indeed, I thought it did just that -- it certainly returns a list of un-consume

Re: GHCJS

2011-08-03 Thread Victor Nazarov
tom ffi calling conventions and custom format for call specification, Javascript or JVM will require radically different call specification then simple function-name as used with C-call. * cross-compilation. GHCJS doesn't work properly on 64bit systems. Javascript lacks real integers and we need to

Re: GHCJS

2011-08-03 Thread Victor Nazarov
ugh GHC API. - then convert StgBindings to Javascript. > > | == Command line interface == > | This works, but I'm not allowed to parse some custom flags used by > | GHCJS code and not by GHC API. > | ParseDynamicFlags throws UsageError if it encounters some unknown flags. > > S

RE: GHCJS

2011-08-03 Thread Simon Peyton-Jones
to convert that [CoreBind] into JavaScript | == Command line interface == | This works, but I'm not allowed to parse some custom flags used by | GHCJS code and not by GHC API. | ParseDynamicFlags throws UsageError if it encounters some unknown flags. So perhaps that's the problem. par

Re: GHCJS

2011-08-02 Thread John Lask
On 3/08/2011 2:10 PM, Brandon Allbery wrote: On Wed, Aug 3, 2011 at 00:31, John Lask wrote: What is really required is a "pluggable" back-end infrastructure - whereby various back-ends could be maintained (or not) at the discretion of their originators and separate to the official ghc back-end

Re: GHCJS

2011-08-02 Thread Brandon Allbery
On Wed, Aug 3, 2011 at 00:31, John Lask wrote: > What is really required is a "pluggable" back-end infrastructure - whereby > various back-ends could be maintained (or not) at the discretion of their > originators and separate to the official ghc back-ends. > I guess I'm confused; I thought the

Re: GHCJS

2011-08-02 Thread John Lask
parse error on "javascript" keyword. For now I'm using (abusing) ccall calling convention and simple imports works pretty well, but I would like to support exports and static/dynamic wrappers. GHC generates C-code to support them, and GHCJS should generate Javascript-code, but I have

Re: GHCJS

2011-08-02 Thread Brandon Allbery
simple > > imports works pretty well, but I would like to support > > exports and static/dynamic wrappers. GHC generates C-code to support > > them, and GHCJS should generate Javascript-code, > > but I have no idea how to use GHC API to generate custom (Javascript) > >

Re: GHCJS

2011-08-02 Thread Edward Z. Yang
filter out some > specified flags and return the rest GHC's flags untouched. Your best bet is to use '--' or something similar to demarcate GHCJS flags, and GHC flags, and then manually split them up before passing them off to your preferred command line parser. Though this vaguel

GHCJS

2011-08-02 Thread Victor Nazarov
Hello, I'm a maintainer and creator of GHCJS tool [1]. GHCJS currently uses GHC API to produce Javascript code from Haskell sources. There is a great interest to the project, but there have been little progress recently. I'm considering the future of it and I'd like to get