The size of things

2002-02-13 Thread Ketil Z. Malde


Hi

I'm building some stuff here that is basically a glorified and
specialized version of quicksort.  It is very quick, and works like a
charm for my purposes, except that it consumes way too much space,
about 100 bytes times the size of the input list.  Which means that,
for my data sets, the program exceeds available RAM and uses swap,
which in turn kills performance.

Is there any guideline how much space the various constructs use?
E.g. how much for cons cells (or whatever that make up lists), how
much for a data type with only nullary data constructors -- should I
use Word8s instead? -- how much for tuples, and so on.  I realize I
can (and I do somewhat) use profiling to determine heap use, but it'd
be nice to be able to do back-of-envelope calculations and have some
idea of what's the right approach. 

So, any pointers or thoughts?

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



A question about GHC-5.03

2002-02-13 Thread Sean Seefried




One of the new features of the latest snapshot of GHC 
is that :
"The type system now supports arbitrary rank 
polymorphism, given appropriate type annotations."
Could you point me to some literature on this feature 
and how it is used?
I'm familiar with rank-2 polymorphic types.  I 
am not however familiar with what an "appropriate type annotation" 
is.
Sean Seefried


RE: CVS Build problem

2002-02-13 Thread Hal Daume III

Ah, thanks.  I was having the same problem but was too shy to ask about
it, figuring it must be my bad.  This should probably be mentioend in the
build documentation (hint, hint).

 - Hal

--
Hal Daume III

 "Computer science is no more about computers| [EMAIL PROTECTED]
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume

On Wed, 13 Feb 2002, Nicholas Nethercote wrote:

> On Wed, 13 Feb 2002, Nicholas Nethercote wrote:
> 
> > That's what I did.  It made ghc ok, but then when it tries the 'make
> > boot' in hslibs it falls over.  The same happens if I change into
> > $(BUILD)/hslibs and do 'make boot'...
> 
> Ok, I've worked out the problem:  I just checked out the modules "ghc" and
> "hslibs".  It seems that the standard library has just been moved into a
> new separate module "libraries".  So my build was missing the standard
> library which was causing the problem.
> 
> --
> Nick Nethercote
> [EMAIL PROTECTED]
> 
> ___
> Glasgow-haskell-users mailing list
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> 

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: CVS Build problem

2002-02-13 Thread Nicholas Nethercote

On Wed, 13 Feb 2002, Nicholas Nethercote wrote:

> That's what I did.  It made ghc ok, but then when it tries the 'make
> boot' in hslibs it falls over.  The same happens if I change into
> $(BUILD)/hslibs and do 'make boot'...

Ok, I've worked out the problem:  I just checked out the modules "ghc" and
"hslibs".  It seems that the standard library has just been moved into a
new separate module "libraries".  So my build was missing the standard
library which was causing the problem.

--
Nick Nethercote
[EMAIL PROTECTED]

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: CVS Build problem

2002-02-13 Thread Nicholas Nethercote

On Wed, 13 Feb 2002, Simon Marlow wrote:

> > ../../ghc/utils/ghc-pkg/ghc-pkg-inplace --update-package
> >  > Reading package info from stdin... done.
> > Expanding embedded variables...done.
> > dependency `base' doesn't exist
> > make[2]: *** [boot] Error 1
> > make[1]: *** [boot] Error 1
> > make[1]: Leaving directory `/local/scratch-4/njn25/ws2/build2/hslibs'
> > make: *** [all] Error 1
>
> You need to 'make all' in fptools/ghc before 'make boot' in hslibs.
> The top-level fptools Makefile will arrange this if you just say 'make'
> at the top level.

That's what I did.  It made ghc ok, but then when it tries the 'make
boot' in hslibs it falls over.  The same happens if I change into
$(BUILD)/hslibs and do 'make boot'...
--
Nick Nethercote
[EMAIL PROTECTED]

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Weird symbol prevents GHCi from loading my package.

2002-02-13 Thread Axel Simon

Hi,

I built quite a big library and turned it into a package. It works fine if
use ghc -package gtk2 Blah.hs to compile things. But when I convert all
the libraries to object files as described in the documentation, GHCi
refuses to load the whole machinery:

~/source/mogul/fpDemo:$ ghci -package gtk2 Arabic.hs
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 5.02.2, for Haskell
98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package std ... linking ... done.
Loading package lang ... linking ... done.
Loading package gtk2 ...

GHCi runtime linker: fatal error: I found a duplicate definition for
symbol
   gcc2_compiled.
whilst processing object file
   /home/as49/local/lib/gtk2hs/gtk2hs.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
 loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.

The symbol obviously has nothing to do with GHCi, but I don't have a clue
how it got there and it probably does not matter as long as I don't use
GHCi. Does anybody know where it comes from? My library consists of a huge
bunch of modules, most of them having C calls and callbacks.

Thanks for hints,
Axel.


P.S.: Output from

~/source/mogul/fpDemo:$ ghc-pkg -s gtk2
Package
   {name = "gtk2",
import_dirs = ["/home/as49/local/lib/gtk2hs/hi"],
source_dirs = [],
library_dirs =
  ["/home/as49/local/lib",
   "/home/as49/local/lib/gtk2hs",
   "/usr/X11R6/lib",
   "/usr/local/lib"],
hs_libraries = ["gtk2hs"],
extra_libraries =
  ["X11",
   "Xext",
   "atk",
   "gdk-x11-1.3",
   "gdk_pixbuf-1.3",
   "glib-1.3",
   "gmodule-1.3",
   "gobject-1.3",
   "gtk-x11-1.3",
   "iconv",
   "intl",
   "m",
   "pango",
   "pangox"],
include_dirs =
  ["/home/as49/local/include/atk-1.0",
   "/home/as49/local/include/glib-2.0",
   "/home/as49/local/include/gtk-2.0",
   "/home/as49/local/include/pango-1.0",
   "/home/as49/local/lib/glib-2.0/include",
   "/home/as49/local/lib/gtk-2.0/include",
   "/home/as49/local/lib/gtk2hs/hi",
   "/usr/X11R6/include"],
c_includes =
  ["Container_stub.h",
   "General_stub.h",
   "Signal_stub.h",
   "TreeSelection_stub.h",
   "gtk/gtk.h"],
package_deps = ["lang"],
extra_ghc_opts = ["-fglasgow-exts"],
extra_cc_opts = [],
extra_ld_opts = ["-u TreeSelection_dwzw", "-u TreeSelection_dwzx"]}


___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



i386-pc-os2-emx port

2002-02-13 Thread Russell O'Connor

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm interested in doing a port of GHC to OS/2.

Any particular documentation I should be reading before I even think about
embarking on such a crazy endevour?

- -- 
Russell O'Connor[EMAIL PROTECTED]
   
``This is not a time, as it is never a time, to seek vengeance, but a
time to seek the courage to forgive'' -- George W. Bush
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (SunOS)
Comment: For info see http://www.gnupg.org

iD8DBQE8as3QuZUa0PWVyWQRAj58AJ0bZg8qm7GZVx9eJH0uA8p+qvhB8ACfe8ki
iaHWvxyrcR7IenWjplFVMy0=
=95xI
-END PGP SIGNATURE-

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



problem with source 5.03

2002-02-13 Thread Hal Daume III

There seems to be a problem with the source tar.bz2 distribution of the
5.03 snapshot.  The web page claims it's 5.3M, but the actualy file is
only 4117517 bytes and doesn't untar properly:

x ghc-5.03.20020204/ghc/InstallShield/Setup Files/Compressed Files, 0
bytes, 0 tape blocks
x ghc-5.03.20020204/ghc/InstallShield/Setup Files/Compressed
Files/Language Independent, 0 bytes, 0 tape blocks
tar: directory checksum error

I was able to grab a CVS image, but someone should probably fix this.

 - Hal

--
Hal Daume III

 "Computer science is no more about computers| [EMAIL PROTECTED]
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: CVS Build problem

2002-02-13 Thread Simon Marlow


> I just checked a fresh copy of ghc + hslibs out of CVS, and 
> tried doing a
> vanilla build.  It fell over doing "make boot" in hslibs.  
> Here are the
> last few make messages:
...
> ../../ghc/utils/ghc-pkg/ghc-pkg-inplace --update-package
>  Reading package info from stdin... done.
> Expanding embedded variables...done.
> dependency `base' doesn't exist
> make[2]: *** [boot] Error 1
> make[1]: *** [boot] Error 1
> make[1]: Leaving directory `/local/scratch-4/njn25/ws2/build2/hslibs'
> make: *** [all] Error 1

You need to 'make all' in fptools/ghc before 'make boot' in hslibs.  The top-level 
fptools Makefile will arrange this if you just say 'make' at the top level.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



CVS Build problem

2002-02-13 Thread Nicholas Nethercote

Hi,

I just checked a fresh copy of ghc + hslibs out of CVS, and tried doing a
vanilla build.  It fell over doing "make boot" in hslibs.  Here are the
last few make messages:


===fptools== Finished making `all' in includes utils driver docs compiler
rts ...
PWD = /local/scratch-4/njn25/ws2/build2/ghc

make[1]: Leaving directory `/local/scratch-4/njn25/ws2/build2/ghc'
make[1]: Entering directory `/local/scratch-4/njn25/ws2/build2/hslibs'

===fptools== Recursively making `boot' in lang concurrent posix util data
text net hssource tools ...
PWD = /local/scratch-4/njn25/ws2/build2/hslibs


==fptools== make boot -wr;
 in /local/scratch-4/njn25/ws2/build2/hslibs/lang

../../ghc/utils/ghc-pkg/ghc-pkg-inplace --update-package
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users