
Cabalising hsc2hc I get (this is actually from manually building the package): --- [paris@bagend hsc2hs-0.67.20061107]$ runghc Setup.hs build Preprocessing executables for hsc2hs-0.67.20061107... Building hsc2hs-0.67.20061107... Main.hs:32:7: Could not find module `System.Process': it is a member of package process-1.0.1.0, which is hidden [paris@bagend hsc2hs-0.67.20061107]$ which I cannot understand. Please help! --- Cristiano

Am Freitag, 27. Februar 2009 15:13 schrieb Cristiano Paris:
Cabalising hsc2hc I get (this is actually from manually building the package):
--- [paris@bagend hsc2hs-0.67.20061107]$ runghc Setup.hs build Preprocessing executables for hsc2hs-0.67.20061107... Building hsc2hs-0.67.20061107...
Main.hs:32:7: Could not find module `System.Process': it is a member of package process-1.0.1.0, which is hidden [paris@bagend hsc2hs-0.67.20061107]$
which I cannot understand. Please help! ---
Cristiano
Cabal hides all packages not listed among the build-depends when building the libraries. I think in 2006, System.Process was in the base package ('twas before the base-split), so process is not listed among the build-depends in hsc2hs' .cabal file. Add it and try again. Cheers, Daniel

On Fri, Feb 27, 2009 at 3:19 PM, Daniel Fischer
Cabal hides all packages not listed among the build-depends when building the libraries. I think in 2006, System.Process was in the base package ('twas before the base-split), so process is not listed among the build-depends in hsc2hs' .cabal file. Add it and try again.
I had to append process and directory as dependencies but then it worked. How can I submit a patch to Hackage? Do I have to contact the owner? Cristiano

Cristiano Paris
I had to append process and directory as dependencies but then it worked. How can I submit a patch to Hackage? Do I have to contact the owner?
In general, just try the maintainer and/or author adresses given on hsc2hs's hackage page. I'd advice you to switch over to c2hs, which is actively developed, while hsc2hs's last update date smells like abandonware. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited.

On Fri, 2009-02-27 at 21:53 +0100, Achim Schneider wrote:
Cristiano Paris
wrote: I had to append process and directory as dependencies but then it worked. How can I submit a patch to Hackage? Do I have to contact the owner?
In general, just try the maintainer and/or author adresses given on hsc2hs's hackage page.
I'd advice you to switch over to c2hs, which is actively developed, while hsc2hs's last update date smells like abandonware.
Both are supported. hsc2hs comes with most Haskell compilers. Duncan

On Fri, Feb 27, 2009 at 09:53:28PM +0100, Achim Schneider wrote:
Cristiano Paris
wrote: I had to append process and directory as dependencies but then it worked. How can I submit a patch to Hackage? Do I have to contact the owner?
In general, just try the maintainer and/or author adresses given on hsc2hs's hackage page.
I'd advice you to switch over to c2hs, which is actively developed, while hsc2hs's last update date smells like abandonware.
They serve different purposes, hsc2hs is meant to run on the actual machine the library is being _built_ _for_ to obtain information that is only available on the final build architecture/operating system. as in, an hsc file is the lowest level portable code you can write. c2hs is more of a developers tool. If anything, I think c2hs should generate hsc files, which can then be portably distributed. John -- John Meacham - ⑆repetae.net⑆john⑈

On Sun, 2009-03-01 at 13:08 -0800, John Meacham wrote:
On Fri, Feb 27, 2009 at 09:53:28PM +0100, Achim Schneider wrote:
Cristiano Paris
wrote: I had to append process and directory as dependencies but then it worked. How can I submit a patch to Hackage? Do I have to contact the owner?
In general, just try the maintainer and/or author adresses given on hsc2hs's hackage page.
I'd advice you to switch over to c2hs, which is actively developed, while hsc2hs's last update date smells like abandonware.
They serve different purposes, hsc2hs is meant to run on the actual machine the library is being _built_ _for_ to obtain information that is only available on the final build architecture/operating system. as in, an hsc file is the lowest level portable code you can write. c2hs is more of a developers tool. If anything, I think c2hs should generate hsc files, which can then be portably distributed.
Like hsc2hs, c2hs has to be run using the C headers for the target machine. It needs these to calculate struct sizes like hsc2hs does. The reason it cannot generate .hsc files and leave the rest to hsc2hs is that it also generates Haskell ffi imports. It imports the C functions at the correct Haskell types. If the C headers on a different platform are quite different then we will get a type error at compile time. With hsc2hs we'll just get a segfault. So c2hs and hsc2hs are in the same class here. They both must be run for the target machine. In theory c2hs should be a strict superset of the hsc2hs functionality. In practise I do not yet fully trust the calculation of C type sizes. It needs a comprehensive test of that first. That's why gtk2hs uses both c2hs, for function imports, and hsc2hs for C struct Storable instances. Duncan

On Sun, Mar 01, 2009 at 11:03:41PM +0000, Duncan Coutts wrote:
They serve different purposes, hsc2hs is meant to run on the actual machine the library is being _built_ _for_ to obtain information that is only available on the final build architecture/operating system. as in, an hsc file is the lowest level portable code you can write. c2hs is more of a developers tool. If anything, I think c2hs should generate hsc files, which can then be portably distributed.
Like hsc2hs, c2hs has to be run using the C headers for the target machine. It needs these to calculate struct sizes like hsc2hs does. The reason it cannot generate .hsc files and leave the rest to hsc2hs is that it also generates Haskell ffi imports. It imports the C functions at the correct Haskell types. If the C headers on a different platform are quite different then we will get a type error at compile time. With hsc2hs we'll just get a segfault. So c2hs and hsc2hs are in the same class here. They both must be run for the target machine.
It still seems like you can get almost all the way there by generating things like (#type guint) in the hsc file. You would not be able to work around APIs that actually differ between architectures, but those are not all that common beyond the inherent incompatabilities due to C calling conventions and structure layouts. As in, you should be able to produce portable hsc files for everything that we could have written portable C code for in the first place, which is a large percentage of libraries. The other reason it would be nice is then we have a clear seperation of concerns, c2hs would just need generic header files, while hsc2hs requires an actual target build environment. Allowing people to build projects that used c2hs with just hsc2hs and not having to install c2hs in the majority of cases. The other reason is that it means that cross compiler support only needs to be implemented in one place, whatever interprets the hsc file. For instance, jhc is a cross compiler by nature, a mac OSX binary created on a linux box is equivalent to one you would create sitting at the mac OSX box and compiling it natively. Generally, bringing this about is quite straightforward, ; jhc --progc i386-mingw32-gcc -mgeneric HelloWorld.hs -o HelloWorld.exe ; wine HelloWorld.exe Hello, World! but when you involve hsc files things get a bit trickier, since it requires not just having access to the appropriate compiler, but the ability to run the resulting program. I'd like to remove that requirement, my current plan was to have jhc natively and transparently handle hsc files just like hs files. a (#type guint) will propagate through all the passes and actually become a 'guint' in the generated C file, likewise, for (#const ..) and other hsc declarations. As in, I am treating hsc files as a sort of standard way to express cross platform C compatability that all compilers should support (either natively or via hsc2hs) rather than specific input to hsc2hs. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (5)
-
Achim Schneider
-
Cristiano Paris
-
Daniel Fischer
-
Duncan Coutts
-
John Meacham