Ross Paterson | 1 May 2003 14:46
Picon
Favicon

Re: cvs commit: fptools/libraries/base/Foreign/C Error.hs fptools/libraries/base/System/Posix Internals.hs fptools/libraries/network /Network Socket.hsc

On Mon, Apr 14, 2003 at 11:53:58AM +0100, Simon Marlow wrote:
> OPTIONS is also used to specify #includes for the C back-end.  The
> source code is the right place for these too, but the use of OPTIONS is
> a little clunky.  We *could* add these to the FFI declarations instead,
> but (a) it's verbose (you have to add the #include to every foreign
> import that needs it) and (b) GHC doesn't support it very well.

This one is a bit of a pain.  Some library modules have several -#include
options.  To turn that into code that conforms to the FFI spec, you have
to collect those #include's in a new header file, and add that to each
of the foreign imports; if those already have includes, more munging
is required.

If you've decided that the method provided by the FFI spec (though
sufficient) is too clunky to use, perhaps it should be changed.
Manuel M T Chakravarty | 1 May 2003 16:20
Picon
Picon
Favicon
Gravatar

Re: cvs commit: fptools/libraries/base/Foreign/C Error.hs fptools/libraries/base/System/Posix Internals.hs fptools/libraries/network /Network Socket.hsc

Ross Paterson <ross <at> soi.city.ac.uk> wrote,

> On Mon, Apr 14, 2003 at 11:53:58AM +0100, Simon Marlow wrote:
> > OPTIONS is also used to specify #includes for the C back-end.  The
> > source code is the right place for these too, but the use of OPTIONS is
> > a little clunky.  We *could* add these to the FFI declarations instead,
> > but (a) it's verbose (you have to add the #include to every foreign
> > import that needs it) and (b) GHC doesn't support it very well.
> 
> This one is a bit of a pain.  Some library modules have several -#include
> options.  To turn that into code that conforms to the FFI spec, you have
> to collect those #include's in a new header file, and add that to each
> of the foreign imports; if those already have includes, more munging
> is required.
> 
> If you've decided that the method provided by the FFI spec (though
> sufficient) is too clunky to use, perhaps it should be changed.

We have discussed this particular point for a quite a
while.  The conclusion was that it is infeasible to provide
the flexibility of CPP; hence, the FFI just provides the
bare minimum and anything more complicated requires the
programmer to write a custom header and include that in the
FFI declarations.

What I am curious about is point (b).  In what respect does
GHC not support it well?

Cheers,
Manuel
(Continue reading)

Simon Marlow | 1 May 2003 16:48
Picon
Favicon

RE: cvs commit: fptools/libraries/base/Foreign/C Error.hs fptools/libraries/base/System/Posix Internals.hs fptools/libraries/network /Network Socket.hsc


> What I am curious about is point (b).  In what respect does
> GHC not support it well?

Cross-module inlining of a foreign import with a #include attached
doesn't work: passing the #include info with the Id in the interface
file isn't implemented.  So we currently disable cross-module inlining
of foreign imports if they have a #include attached.  

I'm really not keen on putting #includes in FFI declarations (as I've
expounded several times on the FFI list before).  Doesn't Hugs have
something similar to -#include that can be used instead?

Cheers,
	Simon
Ross Paterson | 1 May 2003 16:53
Picon
Favicon

Re: cvs commit: fptools/libraries/base/Foreign/C Error.hs fptools/libraries/base/System/Posix Internals.hs fptools/libraries/network /Network Socket.hsc

On Thu, May 01, 2003 at 03:48:03PM +0100, Simon Marlow wrote:
> I'm really not keen on putting #includes in FFI declarations (as I've
> expounded several times on the FFI list before).  Doesn't Hugs have
> something similar to -#include that can be used instead?

No, but I'm starting to agree that it should, or rather that the FFI spec
should.
Alastair Reid | 1 May 2003 16:59
Picon

Re: cvs commit: fptools/libraries/base/Foreign/C Error.hs fptools/libraries/base/System/Posix Internals.hs fptools/libraries/network /Network Socket.hsc

SimonM
> > I'm really not keen on putting #includes in FFI declarations (as I've
> > expounded several times on the FFI list before).  Doesn't Hugs have
> > something similar to -#include that can be used instead?

RossP
> No, but I'm starting to agree that it should, or rather that the FFI spec
> should.

Actually, you could use Hugs' ability to pass arbitrary command line arguments 
to the compiler to do so.  (This would use the gcc specific -inline command 
line flag.)

But I would rather see the existing ffi spec implemented or the ffi spec 
changed to allow some kind of 'foreign include' declarations than use this
crufty little feature.

--
Alastair Reid
Sven Panne | 4 May 2003 15:04
Picon

cvs commit: fptools/libraries/OpenGL/Graphics/Rendering/OpenGL GL.hs fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL StringQueries.hs Query.hs fptools/libraries/OpenGL/Graphics/Rendering/Open GL/GLU Initialization.hs

panne       2003/05/04 06:04:19 PDT

  Modified files:
    libraries/OpenGL/Graphics/Rendering/OpenGL GL.hs 
    libraries/OpenGL/Graphics/Rendering/OpenGL/GLU 
                                                   Initialization.hs 
  Added files:
    libraries/OpenGL/Graphics/Rendering/OpenGL/GL StringQueries.hs 
  Removed files:
    libraries/OpenGL/Graphics/Rendering/OpenGL/GL Query.hs 
  Log:
  Simplified string queries

  Revision  Changes    Path
  1.15      +2 -2      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL.hs
  1.7       +17 -16    fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GLU/Initialization.hs
Sven Panne | 4 May 2003 15:14
Picon

cvs commit: fptools/libraries/OpenGL/Graphics/Rendering/OpenGL GL.hs fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL BeginEnd.hs Rectangles.hs VertexSpec.hs fptools/libraries/OpenGL/Graphics/Rendering/Op enGL/GLU Tessellation.hs

panne       2003/05/04 06:14:06 PDT

  Modified files:
    libraries/OpenGL/Graphics/Rendering/OpenGL GL.hs 
    libraries/OpenGL/Graphics/Rendering/OpenGL/GL BeginEnd.hs 
                                                  Rectangles.hs 
                                                  VertexSpec.hs 
    libraries/OpenGL/Graphics/Rendering/OpenGL/GLU Tessellation.hs 
  Log:
  * BeginMode => PrimitiveMode
  * withBeginMode => renderPrimitive

  Revision  Changes    Path
  1.16      +1 -1      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL.hs
  1.7       +17 -17    fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/BeginEnd.hs
  1.3       +1 -1      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/Rectangles.hs
  1.12      +1 -1      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/VertexSpec.hs
  1.8       +6 -6      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GLU/Tessellation.hs
Sven Panne | 4 May 2003 15:18
Picon

cvs commit: fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL StringQueries.hs

panne       2003/05/04 06:18:41 PDT

  Modified files:
    libraries/OpenGL/Graphics/Rendering/OpenGL/GL StringQueries.hs 
  Log:
  cut-n-paste typo in comment only

  Revision  Changes    Path
  1.2       +1 -1      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/StringQueries.hs
Ian Lynagh | 4 May 2003 15:22
Picon

cvs commit: fptools/ghc/compiler/deSugar DsMeta.hs fptools/ghc/compiler/hsSyn Convert.lhs fptools/libraries/haskell-src Makefile fptools/libraries/haskell-src/Language/Haskell THSyntax.hs

igloo       2003/05/04 06:21:50 PDT
Sender: cvs-libraries-admin <at> haskell.org
Errors-To: cvs-libraries-admin <at> haskell.org
X-BeenThere: cvs-libraries <at> haskell.org
X-Mailman-Version: 2.0.13
Precedence: bulk
List-Help: <mailto:cvs-libraries-request <at> haskell.org?subject=help>
List-Post: <mailto:cvs-libraries <at> haskell.org>
List-Subscribe: <http://www.haskell.org/mailman/listinfo/cvs-libraries>,
	<mailto:cvs-libraries-request <at> haskell.org?subject=subscribe>
List-Id: fptools/libraries CVS commit messages <cvs-libraries.haskell.org>
List-Unsubscribe: <http://www.haskell.org/mailman/listinfo/cvs-libraries>,
	<mailto:cvs-libraries-request <at> haskell.org?subject=unsubscribe>
List-Archive: <http://www.haskell.org/pipermail/cvs-libraries/>
Date: Sun, 4 May 2003 06:21:50 -0700

  Modified files:
    ghc/compiler/deSugar DsMeta.hs 
    ghc/compiler/hsSyn   Convert.lhs 
    libraries/haskell-src Makefile 
    libraries/haskell-src/Language/Haskell THSyntax.hs 
  Log:
  Add support for unboxed Ints, Floats and Doubles to Template Haskell.

  Revision  Changes    Path
  1.34      +28 -8     fptools/ghc/compiler/deSugar/DsMeta.hs
  1.27      +5 -2      fptools/ghc/compiler/hsSyn/Convert.lhs
  1.7       +2 -1      fptools/libraries/haskell-src/Makefile
  1.26      +20 -8     fptools/libraries/haskell-src/Language/Haskell/THSyntax.hs
(Continue reading)

Sven Panne | 4 May 2003 15:29
Picon

cvs commit: fptools/libraries/OpenGL/Graphics/Rendering/OpenGL GL.hs fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL BeginEndInternal.hs BeginEnd.hs fptools/libraries/OpenGL/Graphics/Renderin g/OpenGL/GLU Tessellation.hs

panne       2003/05/04 06:29:12 PDT

  Modified files:
    libraries/OpenGL/Graphics/Rendering/OpenGL GL.hs 
    libraries/OpenGL/Graphics/Rendering/OpenGL/GL BeginEnd.hs 
    libraries/OpenGL/Graphics/Rendering/OpenGL/GLU Tessellation.hs 
  Added files:
    libraries/OpenGL/Graphics/Rendering/OpenGL/GL 
                                                  BeginEndInternal.hs 
  Log:
  Refactored some "Begin/End-Paradigm"-related data types to their own
  hidden module, making a "#prune" and a "hiding" clause unnecessary.

  Revision  Changes    Path
  1.17      +1 -2      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL.hs
  1.8       +4 -96     fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GL/BeginEnd.hs
  1.9       +1 -1      fptools/libraries/OpenGL/Graphics/Rendering/OpenGL/GLU/Tessellation.hs

Gmane