
OK, so a GHC question: Apparently at some point, GHC used to support DLLs. And then it stopped working. And then it may or may not have been brought back again... Does anybody know exactly what the status of this is? Is it currently working or broken? If it's working, what can and can't you use it for? And how do you work it? ;-) Thanks.

Andrew Coppin wrote:
OK, so a GHC question: Apparently at some point, GHC used to support DLLs. And then it stopped working. And then it may or may not have been brought back again... Does anybody know exactly what the status of this is? Is it currently working or broken? If it's working, what can and can't you use it for? And how do you work it? ;-)
Since nobody seems inclined to offer any help on this one, I started digging around with Google. It appears that this used to work sometime around 6.4.x, and then for some reason it stopped working. The docs for 6.8.3 indicate that you can compile a Haskell program as a DLL instead of an EXE, but that's it. The GHC Developer Wiki promises that this feature will "definitely" be back in GHC 6.10. But then, the same page promises an RC by 19 Sep 2008. More digging and I discover various status pages that suggest that this functionallity isn't working in HEAD yet, and will probably actually end up in 6.10.2 or maybe 6.10.3. Looking at the surface, it appears as if not very much is currently going on with GHC. And then, by pure chance, I happened across a link that allows you to access the GHC developers' mailing list, and woooooo-boy, it looks pretty damned busy in there! o_O (I was most amused to discover that Don is currently assigned on a GHC ticket that was created in response to a comment that was made by me - over a year ago...) So the current state of affairs seems clear: shared libraries are not currently supported. That leaves me with two questions: - Is this likely to make it into the next official GHC release? - Why did it "break" in the first place? PS. Oh, and though there's no RC yet, it appears that there *are* several betas available already, so maybe I'll fire up a virtual machine to play with those anyway...

Andrew Coppin wrote:
Andrew Coppin wrote:
OK, so a GHC question: Apparently at some point, GHC used to support DLLs. And then it stopped working. And then it may or may not have been brought back again... Does anybody know exactly what the status of this is? Is it currently working or broken? If it's working, what can and can't you use it for? And how do you work it? ;-)
Since nobody seems inclined to offer any help on this one, I started digging around with Google.
It appears that this used to work sometime around 6.4.x, and then for some reason it stopped working. The docs for 6.8.3 indicate that you can compile a Haskell program as a DLL instead of an EXE, but that's it.
The GHC Developer Wiki promises that this feature will "definitely" be back in GHC 6.10. But then, the same page promises an RC by 19 Sep 2008.
More digging and I discover various status pages that suggest that this functionallity isn't working in HEAD yet, and will probably actually end up in 6.10.2 or maybe 6.10.3.
Looking at the surface, it appears as if not very much is currently going on with GHC. And then, by pure chance, I happened across a link that allows you to access the GHC developers' mailing list, and woooooo-boy, it looks pretty damned busy in there! o_O
There's nothing closed about the GHC developer list - feel free to join, or just read it from the archives or GMane. http://haskell.org/mailman/listinfo/cvs-ghc On the subject of DLLs, there's an important distinction to make. 1. putting the whole program/library in a DLL that you can call from C 2. putting individual Haskell packages in DLLs that you can call from Haskell. (1) has always been supported (temporary breakage notwithstanding) and as far as I know will work in 6.10.1. (2) was supported a long time ago for a short while, and we'd like to bring it back, but as part of a multi-platform effort to support shared libraries. To get (1) you just do ghc -shared, I believe (I'm not by a Windows machine right now so can't check). Cheers, Simon

Simon Marlow wrote:
Andrew Coppin wrote:
Looking at the surface, it appears as if not very much is currently going on with GHC. And then, by pure chance, I happened across a link that allows you to access the GHC developers' mailing list, and woooooo-boy, it looks pretty damned busy in there! o_O
There's nothing closed about the GHC developer list - feel free to join, or just read it from the archives or GMane.
I feel my IQ is far too low for that. ;-) [Not to mention that the traffic volume looks insane...]
On the subject of DLLs, there's an important distinction to make.
1. putting the whole program/library in a DLL that you can call from C
2. putting individual Haskell packages in DLLs that you can call from Haskell.
(1) has always been supported (temporary breakage notwithstanding) and as far as I know will work in 6.10.1. (2) was supported a long time ago for a short while, and we'd like to bring it back, but as part of a multi-platform effort to support shared libraries.
To get (1) you just do ghc -shared, I believe (I'm not by a Windows machine right now so can't check).
(1) is not of huge interest to me, but it's pleasing to know that it's possible. (I don't actually know how DLLs work, but presumably if I were to dig around in System.Win32 I could also call normal DLLs from Haskell too if I desire...?) (2) is something I'd like to see - and I aplaud you for seeking to make this a portable thing! (As well it should be.) One or other of the developer wiki pages lists this as "things we'll definitely do for 6.10"; can you confirm or refute that? Also, I read somewhere that you are/were looking at making the RTS into a DLL. What's the status with that? Given that I know virtually nothing about how such low-level things work, and I have no clue how GHC works internally, is there anything useful I can do to help you guys with this stuff? I mean, other than complaining that it's not done yet... ;-)

Andrew Coppin wrote:
(1) is not of huge interest to me, but it's pleasing to know that it's possible. (I don't actually know how DLLs work, but presumably if I were to dig around in System.Win32 I could also call normal DLLs from Haskell too if I desire...?)
Sure, that's possible.
(2) is something I'd like to see - and I aplaud you for seeking to make this a portable thing! (As well it should be.) One or other of the developer wiki pages lists this as "things we'll definitely do for 6.10"; can you confirm or refute that?
It's one of several things we quite get done in time for 6.10.1, I'll edit that page.
Also, I read somewhere that you are/were looking at making the RTS into a DLL. What's the status with that?
That's part of the same effort. Once Haskell packages can go into DLLs/shared libraries, the RTS can too (indeed, it probably has to).
Given that I know virtually nothing about how such low-level things work, and I have no clue how GHC works internally, is there anything useful I can do to help you guys with this stuff? I mean, other than complaining that it's not done yet... ;-)
Help with testing and reporting bugs is always welcome! Ee'll announce something when it's ready to test. Cheers, Simon

Simon Marlow wrote:
Andrew Coppin wrote:
(1) is not of huge interest to me, but it's pleasing to know that it's possible. (I don't actually know how DLLs work, but presumably if I were to dig around in System.Win32 I could also call normal DLLs from Haskell too if I desire...?)
Sure, that's possible.
Though non-portable. Of course, system-specific things being system-specific is kind of beyond Haskell's ability to fix. ;-)
(2) is something I'd like to see - and I aplaud you for seeking to make this a portable thing! (As well it should be.) One or other of the developer wiki pages lists this as "things we'll definitely do for 6.10"; can you confirm or refute that?
It's one of several things we quite get done in time for 6.10.1, I'll edit that page.
Aww... :-( Oh well, I'm sure we'll get it eventually. Up to date documentation is always nice though! (I realise this isn't always a busy development team's top priority - especially as release dates approach, etc.)
Also, I read somewhere that you are/were looking at making the RTS into a DLL. What's the status with that?
That's part of the same effort. Once Haskell packages can go into DLLs/shared libraries, the RTS can too (indeed, it probably has to).
Would that mean you can change between RTS versions just by supplying a command switch? (Presumably a small portion of the RTS still gets statically linked in so it knows to load a DLL from somewhere?) Or does the RTS version you want to use affect the rest of the compilation process? (I'm thinking of switching between threaded/nonthreaded RTS, stuff like that.) I presume the plan is to make shared libraries *optional*? As in, you can still build statically-linked executables if you specifically wanted to for some strange reason? (Also, I presume you still need a *.hi file to compile any code against a library, no matter what the linkage is, and then cross-module optimisation will still happen. The versioning problem looks... interesting.)
Given that I know virtually nothing about how such low-level things work, and I have no clue how GHC works internally, is there anything useful I can do to help you guys with this stuff? I mean, other than complaining that it's not done yet... ;-)
Help with testing and reporting bugs is always welcome! Ee'll announce something when it's ready to test.
Heh, OK. Well I gather Windows testers are rare round here. I'll try compiling things if you want... ;-) Actually, you have a beta for 6.10 already, right?
participants (2)
-
Andrew Coppin
-
Simon Marlow