Re: GC options. Reply

2001-08-08 Thread Hannah Schroeter

Hello!

On Tue, Aug 07, 2001 at 10:47:50AM +0100, Simon Marlow wrote:

   - Compacting garbage collection is enabled when the residency
 reaches a certain percentage of the maximum heap size (if there
 is one).

Could there be the possibility to set an absolute amount of memory
to start compacting, at least for the case of no maximum heap size?

Kind regards,

Hannah.

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



Re: How to box/unbox values?

2001-04-10 Thread Hannah Schroeter

Hello!

On Tue, Apr 10, 2001 at 01:55:21AM +0200, Thomas Pasch wrote:

 is there an easy way to box/unbox Types.
 I need this for Int's, so is there 
 a function that does:

 Int# - Int
 Int - Int#

You must import the appropriate modules, to "see" the type definition
for Int (which is data Int = I# Int# in GHC). Then just use plain
pattern matching:

unboxInt :: Int - Int#
unboxInt (I# i#) = i#

boxInt :: Int# - Int
boxInt i# = I# i#

Note that there are some restrictions for handling unboxed values,
see the documentation.

Kind regards,

Hannah.

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



Re: Lightningspeed haskell

2001-03-20 Thread Hannah Schroeter

[CC stripped a bit]

On Thu, Mar 01, 2001 at 07:58:26AM +0100, Ketil Malde wrote:
 Jan-Willem Maessen [EMAIL PROTECTED] writes:

  Absolutely.  Good high-level thread support trumps anything provided
  by the operating system.

 Unless you have more than one CPU...

No, even then, some high level thread support gains more than
just mapping one thread  one OS process: Acquire (number_of_cpus),
perhaps plus a few spare OS threads/processes and schedule your high
level threads onto them.

I've seen no OS that can handle 4 or 5 figure numbers of threads.
However, Erlang (high level lightweight threads) or Concurrent
Haskell in GHC's implementation *can* handle. In the latter case,
with a memory overhead of about 1 or 2 KB per thread, in contrast
to much more for OS threads (lemme see: a few 100 bytes for the
in-kernel process structure, then one or two pages for the u-structure
incl. per-process kernel-mode stack, in Linux those pages are wired
into memory, in BSD they can be "swapped out" which is OTOH done
only as last resort, and then thread-private stack, at least one
page, sums up to at least 8 KB on i386).

 [...]

Kind regards,

Hannah.

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



Simple concurrent issue?

2000-08-01 Thread Hannah Schroeter

Hello!

When running this program under GHC 4.08 (OpenBSD 2.7, x86),
only "b"s are written. Shouldn't GHC's implementation of
Concurrent Haskell be preemptive?

Regards,

Hannah.

import Concurrent

main = forkIO a  b
 where
  a = putStrLn "a"  a
  b = putStrLn "b"  b




Re: simple GHC compiling issues

2000-06-22 Thread Hannah Schroeter

Hello!

On Wed, Jun 21, 2000 at 03:21:26PM -0400, Stephen Alden Elliott wrote:
 I have never used GHC (and am new to Linux as well, what a recipe for
 disaster) before and am very confused about how to set up dependencies
 properly and how to configure the make file (I know a little about
 mkdependHS).  I would like to compile a bunch of haskell files:

 FishAll.hsFishDefault.hs  FishSim.hsFishTests.hs  FishUtils.hs
 FishControl.hsFishModel.hsFishSimulator.hs  FishTypes.hs  FishVis.hs

 However, they all depend on many many other files.  Can anyone give tell
 me how to set up the make file to do the appropriate compiling
 procedure?  Or point me to a resource that will teach me how to use
 makefiles with GHC?  Thanks!

Perhaps you'd be interested in hmake; see
  http://www.haskell.org/libraries/
and especially
  http://www.cs.york.ac.uk/fp/hmake/
for details.

Regards, Hannah.




Re: Portable C code

2000-06-21 Thread Hannah Schroeter

Hello!

On Wed, May 24, 2000 at 08:15:24AM -0700, Julian Seward (Intl Vendor) wrote:

 |   Anybody knows how to generate a portable C code through GHC ?

 It depends what you mean by portable.

 GHC can produce C code which you can compile with gcc, without
 special support -- we call this "unregisterised" code.  This code
 needs some GNU extensions -- named initialisers, zero length arrays
 and (I think) support for 64-bit arithmetic.  So it is not strict
 ANSI C89 code, although it looks all 3 extensions will be the 
 ANSI C9X standard.

That'd be a nice foundation for hc-boot so you don't have to have
arch specific hc archives. That'd be especially much cleaner for
a multiplatform BSD port/pkgsrc (OpenBSD/NetBSD).

 I also believe (not sure, tho) that you'd still need to configure
 GHC's runtime for word size (32 vs 64 bits) and endiannness, although
 that isn't a problem.

That could be handled by configure in the hc archive.

 [...]

Kind regards,

Hannah.




Re: binary IO

2000-03-10 Thread Hannah Schroeter

Hello!

On Fri, Mar 10, 2000 at 01:42:01AM -0800, Simon Marlow wrote:
 [...]
hPutBufBA  :: Handle - ByteArray Int - Int - IO ()

hPutBuf:: Handle - Addr - Int - IO ()
 [...]

Why are the output functions of return type IO () and not also
IO Int (or rather IO [some integral type large enough to cover C's size_t])?
There *is* possibility for partial writes on POSIX at least.

Regards, Hannah.



Re: binary IO

2000-03-10 Thread Hannah Schroeter

Hello!

On Fri, Mar 10, 2000 at 02:52:41AM -0800, Simon Marlow wrote:

 [...]

 The idea is that the functions never return until the whole buffer is
 written.  If the reading end (of a socket or pipe) is closed prematurely,
 we'll get an IO error.

But even in the IO error, it'd be interesting to know if nothing
was written at all or at least a part was written before the error
occurred.

E.g. partial writes because of reaching the disk quota (where the
part returned as write() result was really written and really reached
its destination).

 [...]

Regards, Hannah.



Re: prelude functions not in scope

2000-03-08 Thread Hannah Schroeter

Hello!

On Tue, Mar 07, 2000 at 11:29:33PM -0800, Nick Eby wrote:
 Why is ghc not recognizing prelude functions, specifically isLower,
 toLower, and isUpper?  When compiling, i get the message 
 Variable not in scope:  'isLower'

Look at the Haskell report. There's no isLower/toLower/isUpper in
the prelude. Rather they are in the Char standard library module.

 thanks

Regards, Hannah.



Re: Socket module, graphs

2000-02-01 Thread Hannah Schroeter

Hello!

On Tue, Feb 01, 2000 at 12:10:33PM +0100, Sven Panne wrote:
 Hannah Schroeter wrote:
  [...] There should be a call to
  SocketPrim.setSocketOption sock SocketPrim.ReuseAddr 1
  before bindSocket.

  *wink* to the GHC team :-)

 OK, understood.  :-)  I've added this to SocketPrim for AF_INET,

To SocketPrim? I thought the problem was in Socket.listenOn?

 but I'm unsure about the AF_UNIX case. Is it necessary? Does it
 any harm otherwise? It's been a long time since my last
 #include netinet/in.h...

:-) Not for me.

I believe it's not needed in the AF_UNIX case, but doesn't harm either.
(That's from reading BSD source! I hope that matches portable behaviour.)

 Cheers,
Sven

Regards, Hannah.



Re: Socket module, graphs

2000-01-31 Thread Hannah Schroeter

Hello!

On Mon, Jan 31, 2000 at 09:11:14PM +0100, Wojciech Moczydlowski, Jr wrote:
 [...]

 main = do
   socket - listenOn (PortNumber (mkPortNumber 6665))
   (handle, hn) - accept socket
   putStrLn hn" - it's just supposed to say who called and exit.
 Nevertheless, when I try to run it again, it says:

 "Fail: resource busy
 Action: bindSocket
 Reason: Address already in use".

I believe, bindSocket is called from listenOn:

listenOn :: PortID  -- Port Identifier
 - IO Socket   -- Connected Socket

listenOn (Service serv) = [...]

listenOn (PortNumber port) = do
proto - getProtocolNumber "tcp"
sock  - socket AF_INET Stream proto
bindSocket sock (SockAddrInet port iNADDR_ANY)
listen sock maxListenQueue
return sock

[...]

There should be a call to
SocketPrim.setSocketOption sock SocketPrim.ReuseAddr 1
before bindSocket.

*wink* to the GHC team :-)

There's an analogous idiom in C/C++ which is almost never wrong to
use, and often forgotten/not thought of in the beginning of writing
a network server.

 [...]

Regards, Hannah.



Re: GHC Select and Time modules - struct timeval

1999-12-09 Thread Hannah Schroeter

Hallo!

On Wed, Dec 08, 1999 at 10:39:10PM +, Alex Ferguson wrote:

 Keith Wansbrough:
  If the Integer is greater than 2^64-1 then simply
  pass NULL to select(): I think 595 000 years is near enough forever
  given current operating systems...

 Quincentomillennium bug, anyone?

 ;-)

No.

struct timeval {
longtv_sec;
longtv_usec;
};

So, on archs where long is 32 bit, we have a 68-years-problem.

Regards, Hannah.



Re: GHC Select and Time modules - struct timeval

1999-12-01 Thread Hannah Schroeter

Hello!

On Wed, Dec 01, 1999 at 03:59:44PM -0800, Sigbjorn Finne wrote:

 I don't see a good reason why hSelect couldn't be changed to take
 a TimeVal, as you suggest:

data TimeVal 
  = TimeVal { tv_sec  :: Int
, tv_usec :: Int
}

 I would either rely on the fact that the rep. of ClockTime is
 exposed or write my own gettimeofday() (or equiv) wrapper.

Then, it should take a Maybe TimeVal as parameter (Nothing matching
the NULL pointer in C, which is completely different from any
other TimeVal value).

Or perhaps just Maybe Integer {- in microseconds -}?

 [...]

Regards, Hannah.



Re: GHC 4.04 patchlevel 1 released

1999-09-22 Thread Hannah Schroeter

Hello!

On Wed, Sep 15, 1999 at 05:48:30AM -0700, Simon Marlow wrote:
 [...]

   - gcc 2.95 compatibility

What's that specifically?

I ask, because I'm using OpenBSD, and am usually bootstrapping
new versions with an old 3.02 installation, because of the
occasional problems with compiling ghc with a *slightly* older
ghc (when some functions change at a time when the version number
does NOT change, so the version feature checks are inaccurate --
which has bitten me more than once).

So, I should look if I can backport the ghc 2.95 compatibility
easily, or if I have to change my procedure somewhat, as OpenBSD-current
has changed from 2.81 (which works fine with ghc on i386) to 2.95.1.

 [...]

Regards, Hannah.



Re: Bug Tracking Systems?

1999-09-22 Thread Hannah Schroeter

Hello!

On Tue, Sep 14, 1999 at 03:55:39AM -0700, Simon Marlow wrote:
 [...]

   - BugZilla (the Mozilla bug tracker).  Web/CGI based,
 uses an SQL database.  Does just about everything
 under the sun, probably a bit heavyweight for us.

 Does anyone have any experience with any of these, or thoughts in general?

Yes. Please no bug trackers that are *only* accessible via the WWW.
WWW via EMail is very cumbersome, and there are still UUCP and other
offline users.

 I'm leaning towards Debian at the moment, since it seems about the right
 level of complexity for the number of bugs we expect to maintain on it (i.e.
 not many :-).

Seems good. Gnats is uncomfortable to set up and keep running, as I've
experienced with a small play installation thereof.

Regards, Hannah.



Re: Fudgets and GHC?!

1999-04-19 Thread Hannah Schroeter

Hello!

On Sun, Apr 18, 1999 at 01:23:49AM +0200, Thomas Hallgren wrote:

  Has anyone already got Fudgets to compile with GHC?

 Yes, a few weeks ago made the neccessary changes to the fudgets library for
 Haskell 98 compatibility and updated the low level stuff (Xlib interface,
 etc) written to work with GHC 2.01, so that it now works with GHC 4.02. I'll try
 to put the sources on our ftp site [1] in a couple of days.

Thanks for your answer. I'll stay tuned :-)

 [...]

  And the circularly imported interfaces seemed very big, so it was
  much too tedious to write .hi-boot files from scratch.

 These files are created automatically by the supplied make scripts.

Exactly how are the .hi-boot files generated, if I may ask?

 The fudget
 library comes with ghcmake, which is a frontend to hbcmake, which is normally
 distributed with HBC, but you can also get it separately from our ftp site [1].

In source form compilable with a C/C++/Haskell compiler? :-)
Doesn't look so, seems I need a running lmlc for that.

Somehow I'd like to set up some Makefiles to compile Fudgets with
GHC and without having to bootstrap another Haskell (and LML) system
on my arch :-)

The only problem in setting them up was generating those .hi-boot
files to resolve those recursive imports.

 Regards,
 Thomas Hallgren

 References
 [1] http://www.cs.chalmers.se/pub/haskell/chalmers/

Anyway, thanks for your fast answer!

Regards, Hannah.