Reuben Thomas | 4 Oct 2000 17:00
Picon
Picon
Favicon

New InstallShield of GHC 4.08.1

I've just put up a new InstallShield of 4.08.1
(http://www.haskell.org/ghc/download.html, as usual). It fixes some
problems with missing symbols when linking dynamically, and is also better
behaved, in that it clears up the temporary files it makes during
installation, so that when uninstalled it really does delete everything.

--

-- 
http://sc3d.org/rrt/ | maxim, n.  wisdom for fools

Simon Peyton-Jones | 5 Oct 2000 17:54
Picon
Favicon
Gravatar

Generics

Folks,

I've added Hinze/PJ-style generic class definitions to GHC, based
on summer hacking done by Andrei Serjantov.  The design is based
very closely on the Haskell workshop 2000 paper
	http://www.informatik.uni-bonn.de/~ralf/Derive.ps.gz

For example:

  class Bin a where
    toBin   :: a -> [Int]
    fromBin :: [Int] -> (a, [Int])

    toBin {| Unit |}    Unit	= []
    toBin {| a :+: b |} (Inl x)   = 0 : toBin x
    toBin {| a :+: b |} (Inr y)   = 1 : toBin y
    toBin {| a :*: b |} (x :*: y) = toBin x ++ toBin y

  
    fromBin {| Unit |}    bs        = (Unit, bs)
    fromBin {| a :+: b |} (0:bs)  = (Inl x, bs')    where (x,bs') = fromBin
bs
    fromBin {| a :+: b |} (1:bs)  = (Inr y, bs')    where (y,bs') = fromBin
bs
    fromBin {| a :*: b |} bs  	   = (x :*: y, bs'') where (x,bs' ) =
fromBin bs
					        (y,bs'') = fromBin bs'

Now we can say simply

(Continue reading)

Reuben Thomas | 6 Oct 2000 18:29
Picon
Picon
Favicon

Haskell Heaven for Windows Weenies: Pesky Profiling Problems Pulverized

There's a new 4.08.1 InstallShield with what I *think* are working
profiling libraries (static only).

--

-- 
http://sc3d.org/rrt/ | free, a.  already paid for

David Brown | 10 Oct 2000 02:04

Porting to powerpc-linux

I'm considering taking some effort to port GHC to powerpc linux.  The task
seems moderately doable, given that GHC once ran on the powerpc
architecture.

I guess as a good first question: should I start with 4.08.1, or should I
venture off with the CVS tree.  The driver in CVS seems to have been
written in Haskell, and it seems to be needed to build the runtime.  This
sounds like it would preclude building from .hc files.

I've got my x86 linux box ready to build some unregistered .hc files.

Dave (looking forward to debugging RTS) Brown

Simon Marlow | 10 Oct 2000 12:15
Picon
Favicon

RE: Porting to powerpc-linux

> I'm considering taking some effort to port GHC to powerpc 
> linux.  The task
> seems moderately doable, given that GHC once ran on the powerpc
> architecture.

Cool! :)

> I guess as a good first question: should I start with 4.08.1, 
> or should I
> venture off with the CVS tree.  The driver in CVS seems to have been
> written in Haskell, and it seems to be needed to build the 
> runtime.  This
> sounds like it would preclude building from .hc files.

I would start from 4.08.1, for exactly that reason.  We haven't tackled the
issue of bootstrapping with the Haskell driver.  The plan was to use a
handwritten Makefile to build an unregisterised driver from .hc sources
using plain gcc, but this isn't done yet.  Furthermore, we're about to merge
the driver with the compiler proper as part of the GHCi reorganisation, so
things are going to be broken for a while...

> I've got my x86 linux box ready to build some unregistered .hc files.

You'll need two build trees.  In the first tree, build the compiler as
normal, and the libraries/RTS with -unreg -keep-hc-files-too.  You should be
able to use these .hc files to try out some simple programs on the PPC.

In the second tree, bootstrap the compiler using the compiler from the first
tree with -unreg -keep-hc-files-too.  Take these .hc files to the PPC and
bootstrap them there.
(Continue reading)

David Brown | 11 Oct 2000 20:31

Re: Porting to powerpc-linux

On Tue, Oct 10, 2000 at 03:15:49AM -0700, Simon Marlow wrote:

> > I've got my x86 linux box ready to build some unregistered .hc files.
> 
> You'll need two build trees.  In the first tree, build the compiler as
> normal, and the libraries/RTS with -unreg -keep-hc-files-too.  You should be
> able to use these .hc files to try out some simple programs on the PPC.
> 
> In the second tree, bootstrap the compiler using the compiler from the first
> tree with -unreg -keep-hc-files-too.  Take these .hc files to the PPC and
> bootstrap them there.

Ok.  Here's what I've done.  I've made two trees, b1 and b2, and some
appropriate directories ton install in.

Inside b1, I edited b1/ghc/lib/std/Makefile to add the options
-optc-DNO_REGS...  and compiled this compiler.

I then went into b2 and added the unregister options to SRC_HC_OPTS in
b2/mk/config.mk  (Configured to use the compiler generated in step b1.

During the build here, the compiler SEGVs when compiling the first haskell
file built with the new built compiler.

...

../../driver/ghc-inplace -keep-hc-file-too -optc-DNO_REGS
-optc-DUSE_MINIINTERPRETER -fno-asm-mangling -funregisterised -fvia-C
-recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing -O -package-name std
-static -split-objs  -H12m  -c PrelBase.lhs -o PrelBase.o -osuf o
(Continue reading)

Brett Letner | 12 Oct 2000 00:12

C main

Greetings -

Could someone instruct me on (or point me to) the correct ghc command line
for calling haskell from C?
From the documentation, it seems like "ghc -fglasgow-exts -no-hs-main main.c
foo.hs" should work, but
that still gives me a multiple definition of "main".

I'm running ghc 4.08.1 on Windows NT.

Thanks -

Brett Letner
RBC Incorporated
http://www.revbiz.com
mailto:bletner <at> revbiz.com
(913) 385-5700 ext.20 Fax (913) 385-5701

Lescher Christian | 12 Oct 2000 07:47
Picon

Exposing Haskell functions with string arguments in a DLL

How can I convert string arguments (null-terminated strings) to Haskell's [Char]? I saw there is some
CString module in package lang of GHC, but I didn't found any documentation about it (e.g.
packStringIO...?). How must a function f :: String -> String for usage in a DLL look like in order to convert
the string parameter and result?
(From earlier Haskell functions with BSTR arguments, I already know how to build a (static) DLL. I use GHC4.08.1.)

Christian Lescher

Simon Marlow | 12 Oct 2000 11:07
Picon
Favicon

RE: C main

> Greetings -
> 
> Could someone instruct me on (or point me to) the correct ghc 
> command line
> for calling haskell from C?
> From the documentation, it seems like "ghc -fglasgow-exts 
> -no-hs-main main.c
> foo.hs" should work, but
> that still gives me a multiple definition of "main".
> 
> I'm running ghc 4.08.1 on Windows NT.

You can use ghc just like you would use gcc to compile up your C program,
then use ghc again to link the whole program with the Haskell module(s).
The -no-hs-main flag shouldn't be necessary, as far as I can tell. eg.

	$ ghc -c main.c
	$ ghc -c HaskellStuff.hs
	$ ghc main.o HaskellStuff.o

Cheers,
	Simon

Simon Marlow | 12 Oct 2000 11:02
Picon
Favicon

RE: Porting to powerpc-linux

> I'm guessing I didn't do the b1 build right.  The compiler it 
> generated
> builds, but doesn't even run.  Do I need to add the 
> unregistered options
> throughout the build, or just in the library?

Just the libraries and the RTS in b1, and the compiler in b2.  You can check
that things are working right by compiling up hello world against b1
(remember to add the options when compiling hello world too).

Cheers,
	Simon


Gmane