tag:blogger.com,1999:blog-7094652.post5305140815234759316..comments2024-03-23T14:36:09.980+00:00Comments on Neil Mitchell's Blog (Haskell etc): Haskell DLL's on WindowsNeil Mitchellhttp://www.blogger.com/profile/13084722756124486154noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-7094652.post-25178412351318364432010-01-28T15:02:51.629+00:002010-01-28T15:02:51.629+00:00My main concern is that I don't want to lose t...My main concern is that I don't want to lose the text that explains *why* using DllMain() is wrong, otherwise we're doomed to rediscover it in the future. By all means trim/fix/rewrite or whatever to make it correct.Unknownhttps://www.blogger.com/profile/00558568940124189862noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-64920343819011036752010-01-19T19:03:21.907+00:002010-01-19T19:03:21.907+00:00Simon: It has a section, but I'm not convinced...Simon: It has a section, but I'm not convinced it's correct. It seems to imply that there are some situations when putting the code in DllMain works, but I think that's by coincidence and isn't guaranteed, and may break in future GHC versions.<br /><br />I intend to Docbook this as soon as I get GHC building on my work machine, but it's been very busy with other stuff lately.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-11568295590142294782010-01-19T10:13:52.111+00:002010-01-19T10:13:52.111+00:00Neil: the current docs have a section entitled &qu...Neil: the current docs have a section entitled "Beware of DllMain!" which describes the problems with calling hs_init() from DllMain in detail. I suggest keeping that section, perhaps moving it to the end with a forward ref from "NOTE: don't call hs_init/hs_exit from DllMain".<br /><br />HeavensRevenge: a 2x speedup from 64-bit code is highly unlikely. The extra memory pressure tends to slow things down, so there's a tradeoff against the larger register set. We see roughly the same performance between 32 and 64 bit on Linux. The advantage of 64-bit is really only for applications that need more than 2Gb of memory. Also I'm not sure what you mean by "lambda expression size".Unknownhttps://www.blogger.com/profile/00558568940124189862noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-1041315245286285572010-01-16T20:46:18.213+00:002010-01-16T20:46:18.213+00:00I must agree with Felix, x64 on Windows to me is a...I must agree with Felix, x64 on Windows to me is a VERY massive issue, yes to the point of making me try and do a partial port. <br />If I may suggest, even though Haskell is general purpose to span the spectrum of redneck to doctoral users, I would gamble to say that most users are quite intelligent and current in todays leading technological advancements, not all the 1970's old school VAX user who is afraid of change.<br />The advantages of using 2x larger lambda's would of course be excellent news, x64 code regardless of word size or lambda expression size, does indeed run ~2x faster on a very excellent implementation, since I have measured a 192% increase primarily.<br />If windoze users using Haskell for the first time see it's speed and elegance their first go, we would most likely have more users with a Win64 native port seeing how windows is still an OS with a very large user base.HeavensRevengehttps://www.blogger.com/profile/10477618203431936135noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-46554810170593948372010-01-09T17:42:32.075+00:002010-01-09T17:42:32.075+00:00crafter: GHC does require you to specify all the p...crafter: GHC does require you to specify all the packages manually, unless you specify --make. You may find that there is somewhere you can put --make in that list of actions to get it working.<br /><br />The intention is that Cabal will help you make DLL's and handle all this stuff automatically, but it's not ready yet.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-800192307491880072009-12-01T15:54:52.812+00:002009-12-01T15:54:52.812+00:00Your post is really helpful. But I experience prob...Your post is really helpful. But I experience problem when I try to link Haskell-DLL which uses hackage library (XmlRpc). As I understand, GHC requires me to specify ALL packages I use explicitly or implictly. It is terribly inconvinient. I'd appreciate very much if you gave any workaround. Thank you!crafterhttps://www.blogger.com/profile/07881637924338123764noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-39910223278119353322009-11-29T08:42:15.414+00:002009-11-29T08:42:15.414+00:00Watto: I only intended the example to work on Wind...Watto: I only intended the example to work on Windows, but if it could be easily made to work on all platforms that would be great. I know GHC 6.10 doesn't really support DLL's on Linux, and I think the GHC 6.12 support is still in progress. I suggest you ask on the glasgow-haskell-users -AT- haskell.org mailing list.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-50379140150518613932009-11-28T18:24:30.261+00:002009-11-28T18:24:30.261+00:00Thanks for the tutorial. I am getting some linking...Thanks for the tutorial. I am getting some linking errors on the last step (under Ubuntu):<br /><br />Tester.cpp: In function ‘int main()’:<br /><br />Tester.cpp:15:0:<br /> warning: format ‘%i’ expects type ‘int’, but argument 2 has type ‘HsInt’<br />/usr/bin/ld: dynamic variable `base_GHCziIOBase_lvl22_closure' is zero size<br />...<br />...aquarinhttps://www.blogger.com/profile/01803879512885563659noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-56251110662768140552009-11-23T21:18:02.819+00:002009-11-23T21:18:02.819+00:00Felix: Haskell on Windows is far from at a dead en...Felix: Haskell on Windows is far from at a dead end. So far, very few people use Windows 64 bit. By the time it's anywhere close to mainstream it will be ported over - it's probably not that hard to do. There really is nothing to worry about.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-68012492871800486742009-11-23T14:19:10.775+00:002009-11-23T14:19:10.775+00:00A related serious issue is that there does not see...A related serious issue is that there does not seem to be a plan for a 64-bit Windows port. More and more Windows users switch to 64-bit. Windows Azure is based on 64-bit Windows Server. While i like Haskell in general more than F#, Haskell on Windows is approaching a dead end.Felixnoreply@blogger.comtag:blogger.com,1999:blog-7094652.post-18450585478865906452009-11-23T14:02:39.850+00:002009-11-23T14:02:39.850+00:00Ganesh: Very good point, especially since if peopl...Ganesh: Very good point, especially since if people try the DllMain thing it's very likely to work for them.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-11282497792672960072009-11-23T13:55:38.602+00:002009-11-23T13:55:38.602+00:00I'd suggest linking to the GHC bug you mention...I'd suggest linking to the GHC bug you mention (3605) from the "don't call hs_init/hs_exit from DllMain" note - it's very frustrating to be told that something you may well want to do won't work without any details.Anonymousnoreply@blogger.com