Re: FFI: calling Haskell from C++?

2005-09-14 Thread Felix Breuer
could write up a summary of our experiences calling Haskell from C++, but as I have no in depth knowledge of the interna, that summary would be anything but comprehensive, so I am not sure I am the right man for the job. Right now we have to use GHC to link the entire project (including the C++ part) becau

Re: FFI: calling Haskell from C++?

2005-09-14 Thread Rich Neswold
On 9/14/05, Simon Peyton-Jones <[EMAIL PROTECTED]> wrote: There's been a bit of traffic about calling Haskell from C++ recently, and I know that calling C++ from Haskell is a frequently asked question.   Would someone like to write up a description of how  

RE: FFI: calling Haskell from C++?

2005-09-14 Thread Simon Peyton-Jones
There’s been a bit of traffic about calling Haskell from C++ recently, and I know that calling C++ from Haskell is a frequently asked question. (E.g. Koen Claessen was asking me about it this week.)  It also seems to be somewhat platform dependent.  (Esp on Windows, I think

Re: FFI: calling Haskell from C++?

2005-09-13 Thread Felix Breuer
Hello everyone, the examples are working now! John, Wolfgang and Rich, thank you for your help! On Wed, 14 Sep 2005 02:07:52 +1000 skaller <[EMAIL PROTECTED]> wrote: > On Tue, 2005-09-13 at 15:20 +, Felix Breuer wrote: > > main.o(.text+0x22): In function `main': > > main.cpp: undefined r

Re: FFI: calling Haskell from C++?

2005-09-13 Thread skaller
On Tue, 2005-09-13 at 15:20 +, Felix Breuer wrote: > we have tried long and hard to call Haskell functions from C++ using > the FFI mechanism but without success. > $ ghc -fffi Foo.o Foo_stub.o main.cpp > main.o(.text+0x22): In function `main': > main.cpp: undefined reference to `__st

Re: FFI: calling Haskell from C++?

2005-09-13 Thread Rich Neswold
On 9/13/05, Felix Breuer <[EMAIL PROTECTED]> wrote:   $ ghc -fffi Foo.o Foo_stub.o main.cpp  main.o(.text+0x22): In function `main':  main.cpp: undefined reference to `__stginit_Foo()'  main.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'  collect2: ld returned 1 exit status In ma

Re: FFI: calling Haskell from C++?

2005-09-13 Thread Wolfgang Thaller
we have tried long and hard to call Haskell functions from C++ usingthe FFI mechanism but without success. Don't forget to say which platform you're on - the solution might be slightly platform-dependent.  $ ghc -fffi Foo.o Foo_stub.o main.cpp   main.o(.text+0x22): In function `main':  main.cpp: un

FFI: calling Haskell from C++?

2005-09-13 Thread Felix Breuer
Hello everyone, we have tried long and hard to call Haskell functions from C++ using the FFI mechanism but without success. Our problem is as follows: We tried the C case first. Taking the example code from Chapter 8.2 of the GHC User Guide, we created files Foo.hs and main.c and then did $

Calling Haskell from .Net

2004-10-28 Thread David Lo
Dear all, I'm new in Haskell. I need to port a haskell application written by someone else to be called by a .Net C# application. Please kindly advise on which option to pursue. Maybe on how to convert haskell code to dll or how to let C++ code (in dll format) to call Haskell. Any helps will rea

Re: calling haskell from C from haskell

2003-01-03 Thread Alastair Reid
> Hello, Is calling haskell from C from haskell possible? This is what > i tried (generated with green-card): It ought to work. Instead of using Greencard (which only supports Haskell->C) or the old _casm_ operation, I'd recommend using the new foreign function inte

calling haskell from C from haskell

2003-01-03 Thread Arjen Hommersom
Hello, Is calling haskell from C from haskell possible? This is what i tried (generated with green-card): {-# OPTIONS -#include "Main_stub.h" #-} module Main where import StdDIS foreign export ccall foo :: Int -> Int foo i = i+1 bar :: Int -> IO Int bar arg1 = _casm_ ``

Re: Help in calling Haskell from C

2001-10-12 Thread Sigbjorn Finne
> > I admit to being the culprit here. When I globally-renamed __init_* > to __stginit_* in ghc, I forgot to do it in the hdirect tree. Sorry. > No need to be, you did propagate that change into hdirect/. The 'problem' was that the HDirect src-dist snapshot was cut a couple of weeks before t

RE: Help in calling Haskell from C

2001-10-12 Thread Julian Seward (Intl Vendor)
| > When I tried to link the code, __init_MathLibProxy came up undefined. | > In looking though the library produced, __init_MathLibProxy was in | > fact missing. However, there was a __stginit_MathLibProxy, and when I | > changed the code to startup using that symbol, the code worked as it

Re: Help in calling Haskell from C

2001-10-12 Thread Sigbjorn Finne
0.19) --sigbjorn - Original Message - From: "Mark Conway Wirt" <[EMAIL PROTECTED]> To: "Sigbjorn Finne" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, October 11, 2001 17:48 Subject: Re: Help in calling Haskell from C > On Tue, Au

Re: Help in calling Haskell from C

2001-10-11 Thread Mark Conway Wirt
On Tue, Aug 14, 2001 at 11:28:57AM -0700, Sigbjorn Finne wrote: > Hi, > > the 0.17 documentation (and examples) wasn't updated to cover > the extra argument that startupHaskell() now takes, I'm afraid. > Attached is a version of tst.c from examples/server/ which shows > you how to now use startup

Re: Calling Haskell from C

1999-07-08 Thread Sven Panne
"Sigbjorn Finne (Intl Vendor)" wrote: > [...] Here's a simple example demonstrating how to call into > Haskell from C > [...] > foreign export "putChar" putChar :: Char -> IO () > [...] Just for clarification: *This* is the part which calls C from Haskell again, so the whole story is C -> Haskell

RE: Calling Haskell from C

1999-07-08 Thread Sigbjorn Finne (Intl Vendor)
[EMAIL PROTECTED] writes: > ... > > I know how to call C from Haskell, how to call Perl from C and I > am beginning to know how to call C from Perl. The missing part is > Haskell from C... > Here's a simple example demonstrating how to call into Haskell from C foo% ghc --version The Glorio

RE: Calling Haskell from C

1999-07-08 Thread Simon Marlow
> But before you do that do a gdb -c core in the directory > ghc/lib/std/ to > figure out what is really crashing. My unlit might of been crashing > because I had the header files for glibc2.0 but the binaries for > glibc2.1 installed. It could make a bit of a difference ;) True - I thought i

Re: Calling Haskell from C

1999-07-07 Thread Manuel M. T. Chakravarty
[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote, > 6 Jul 1999 16:02:26 GMT, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> pisze: > > > Is it possible to give C functions linked into a Haskell module the > > ability to call various Haskell IO functions? > > Ah, I think I've found it (foreign

Re: Calling Haskell from C

1999-07-06 Thread Kevin Atkinson
Marcin 'Qrczak' Kowalczyk wrote: > > Tue, 06 Jul 1999 14:21:11 -0400, Kevin Atkinson <[EMAIL PROTECTED]> pisze: > > > > As I can't build ghc from sources and fix the problem myself, is > > > there any workaround? > > > > Why can't you build ghc from source? > > Because it mysteriously fails to

Re: Calling Haskell from C

1999-07-06 Thread Marcin 'Qrczak' Kowalczyk
Tue, 06 Jul 1999 14:21:11 -0400, Kevin Atkinson <[EMAIL PROTECTED]> pisze: > > As I can't build ghc from sources and fix the problem myself, is > > there any workaround? > > Why can't you build ghc from source? Because it mysteriously fails to compile some files (PerlBase.lhs) without any error

Re: Calling Haskell from C

1999-07-06 Thread Kevin Atkinson
Marcin 'Qrczak' Kowalczyk wrote: > As I can't build ghc from sources and fix the problem myself, is > there any workaround? Why can't you build ghc from source? -- Kevin Atkinson [EMAIL PROTECTED] http://metalab.unc.edu/kevina/

Re: Calling Haskell from C

1999-07-06 Thread Marcin 'Qrczak' Kowalczyk
6 Jul 1999 16:02:26 GMT, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> pisze: > Is it possible to give C functions linked into a Haskell module the > ability to call various Haskell IO functions? Ah, I think I've found it (foreign export), but it does not work with ghc-4.02 (the "glibc version"

Calling Haskell from C

1999-07-06 Thread Marcin 'Qrczak' Kowalczyk
Is it possible to give C functions linked into a Haskell module the ability to call various Haskell IO functions? I wish that those Haskell functions could change some values pointed to by IORefs known to the code which calls those C functions. So probably the structure containing those IORefs wo

Re: Calling Haskell from...

1999-02-25 Thread Michael Hobbs
Alex Ferguson wrote: > > What's the state of the art as regards calling Haskell functions from > 'the outside world'? I note that Haskell Direct has this in its > manifesto, but says "currently unsupported". Does that mean a moderate > size black hole at the centre of something still potentiall

Calling Haskell from...

1999-02-25 Thread Alex Ferguson
What's the state of the art as regards calling Haskell functions from 'the outside world'? I note that Haskell Direct has this in its manifesto, but says "currently unsupported". Does that mean a moderate size black hole at the centre of something still potentially usable, or nothing much at al

RE: Green Card and calling Haskell from C

1998-12-03 Thread Sigbjorn Finne (Intl Vendor)
Graeme E Moss <[EMAIL PROTECTED]> writes: > > In the on-line documentation for Green Card at: > > http://www.dcs.gla.ac.uk/fp/software/green-card/users-guide-9.html > > there is the following option for invoking green-card: > > --gc-safe > > Generates code that can use callbacks to Hask

Green Card and calling Haskell from C

1998-12-03 Thread Graeme E Moss
In the on-line documentation for Green Card at: http://www.dcs.gla.ac.uk/fp/software/green-card/users-guide-9.html there is the following option for invoking green-card: --gc-safe Generates code that can use callbacks to Haskell (GHC only.) This makes the generated code slower. Does this