RE: [Haskell-cafe] Battling laziness

2005-12-16 Thread Simon Marlow
On 16 December 2005 15:23, Joel Reymont wrote: Looking at http://wagerlabs.com/randomplay.hd.ps I see closures (constructors?) in this order Script.Array.sat_s46N W8# I# Script.Array.fromIntegral_s453 Script.Endian.sat_s1WxM Script.Endian.sat_s1WF2 W16# Script.PicklePlus.sat_s38YS

RE: [Haskell-cafe] Optimizing a high-traffic network architecture

2005-12-16 Thread Simon Marlow
On 16 December 2005 15:19, Lennart Augustsson wrote: John Meacham wrote: On Thu, Dec 15, 2005 at 02:02:02PM -, Simon Marlow wrote: With 2k connections the overhead of select() is going to start to be a problem. You would notice the system time going up. -threaded may help

RE: [Haskell-cafe] +RTS -M800M

2005-12-20 Thread Simon Marlow
On 17 December 2005 21:57, Ketil Malde wrote: Simon Marlow [EMAIL PROTECTED] writes: On 16 December 2005 10:05, Joel Reymont wrote: I'm trying to restrict GHC to 800Mb of heap at runtime by passing in +RTS -M800M, the machine has 1Gb of memory and top shows free physical memory dropping

[Haskell-cafe] Re: OpenAL bindings / compiling ghc 6.5

2005-12-29 Thread Simon Marlow
Michael Benfield wrote: I see here: http://www.haskell.org/HOpenGL/newAPI/ OpenAL bindings listed as part of the Hierachical Libraries. And when I download the source to a development snapshot of GHC, there they are. Is there a way to install this on GHC 6.4? Alternatively... I can't get

[Haskell-cafe] Re: Joels Time Leak

2006-01-03 Thread Simon Marlow
Tomasz Zielonka wrote: On Thu, Dec 29, 2005 at 01:20:41PM +, Joel Reymont wrote: Why does it take a fraction of a second for 1 thread to unpickle and several seconds per thread for several threads to do it at the same time? I think this is where the mistery lies. Have you considered

[Haskell-cafe] RE: Haskell vs. Erlang: The scheduler

2006-01-03 Thread Simon Marlow
On 03 January 2006 15:13, Joel Reymont wrote: On Jan 3, 2006, at 2:30 PM, Simon Marlow wrote: The default context switch interval in GHC is 0.02 seconds, measured in CPU time by default. GHC's scheduler is stricly round- robin, so therefore with 100 threads in the system it can be 2 seconds

RE: [Haskell-cafe] Re: Joels Time Leak

2006-01-03 Thread Simon Marlow
On 03 January 2006 15:37, Sebastian Sylvan wrote: On 1/3/06, Simon Marlow [EMAIL PROTECTED] wrote: Tomasz Zielonka wrote: On Thu, Dec 29, 2005 at 01:20:41PM +, Joel Reymont wrote: Why does it take a fraction of a second for 1 thread to unpickle and several seconds per thread

RE: [Haskell-cafe] Re: Haskell Speed

2006-01-04 Thread Simon Marlow
On 30 December 2005 01:23, Jan-Willem Maessen wrote: Probably. The minimum table chunk size was rather large. I have been experimenting (tests are running even as I type) with alternate implementations of Data.HashTable. So far the winning implementation is one based on multiplicative

RE: [Haskell-cafe] Help with shootout

2006-01-04 Thread Simon Marlow
On 03 January 2006 12:03, Chris Kuklewicz wrote: STM* is usually slower than IO/MVar. STM has to do the transactional record keeping and throws away work (i.e. CPU cycles and speed) when it aborts. The Chameneos benchmark has 4 writers working *very* quickly, so the contention is high.

RE: [Haskell-cafe] Re: Joels Time Leak

2006-01-04 Thread Simon Marlow
On 03 January 2006 17:32, Chris Kuklewicz wrote: Thanks for the answer, but I should I written a longer comment. I have added such a longer comment below: Simon Marlow wrote: Chris Kuklewicz wrote: Another comment: between 1000's of threads and writing a custom continuation based

[Haskell-cafe] Re: Joels Time Leak

2006-01-04 Thread Simon Marlow
Joel Reymont wrote: I don't think CPU usage is the issue. An individual thread will take a fraction of a second to deserialize a large packet. It's a combination of CPU usage by the pickler and GC load. Those 50k packets take 0.03 seconds to unpickle (version of unstuff.hs to measure that

[Haskell-cafe] Re: Joels Time Leak

2006-01-04 Thread Simon Marlow
Bulat Ziganshin wrote: Tuesday, January 03, 2006, 7:43:21 PM, you wrote: The minimum time between context switches is 20 milliseconds. Is there any good reason why 0.02 seconds is the best that you can get here? Couldn't GHC's internal timer tick at a _much_ faster rate (like 50-100µs or

[Haskell-cafe] Re: Joels Time Leak

2006-01-04 Thread Simon Marlow
Bulat Ziganshin wrote: Tuesday, January 03, 2006, 7:43:21 PM, you wrote: The minimum time between context switches is 20 milliseconds. Is there any good reason why 0.02 seconds is the best that you can get here? Couldn't GHC's internal timer tick at a _much_ faster rate (like 50-100µs or

[Haskell-cafe] Re: Optimizing a high-traffic network architecture

2006-01-05 Thread Simon Marlow
2005/09/17 04:36:26 bfulgham Exp $ -- The Great Computer Language Shootout -- http://shootout.alioth.debian.org/ -- Contributed by Einar Karttunen -- Modified by Simon Marlow -- This is the shootout cheap concurrency benchmark, modified -- slightly. Modification noted below (***) to add more

[Haskell-cafe] Re: Optimizing a high-traffic network architecture

2006-01-05 Thread Simon Marlow
Joel Reymont wrote: My apologies if this has been described somewhere but what is MUT time? MUTator time, i.e. the time spent doing real work by your program. (the term mutator isn't used so much these days, but it comes from the view of a functional program as a graph, and the engine that

[Haskell-cafe] Re: Joels Time Leak

2006-01-05 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Simon, Wednesday, January 04, 2006, 7:33:22 PM, you wrote: The minimum time between context switches is 20 milliseconds. SM Sure, there's no reason why we couldn't do this. Of course, even SM idle Haskell processes will be ticking away in the background, so

[Haskell-cafe] Re: Chameneos

2006-01-06 Thread Simon Marlow
Chris Kuklewicz wrote: Your case tweak was for an older version of Chameneos that used an older Ch channel implementation. But I was inspired by your improvement to use Int# instead of data Color, and I posted a version that seems faster than the winning one that was submitted.

[Haskell-cafe] Re: Chameneos

2006-01-06 Thread Simon Marlow
upload this to the shootout? Cheers, Simon Chris Kuklewicz wrote: Simon Marlow wrote: I'm not keen on using explicit unboxed values in these benchmarks, since it looks so ugly. In most cases you can convince GHC to do the unboxing for you, and I'm pretty sure it should be the case

[Haskell-cafe] Re: Chameneos

2006-01-09 Thread Simon Marlow
Bulat Ziganshin wrote: the same is for Int32 (and i think other fixed-width integrals). i just noticed that one simple loop in my program allocates 2.5 times more data and works 2 times slower when loop variable switched from Int to Int32 There's no reason that Int32 should be slower than

[Haskell-cafe] Re: Where does memory go?

2006-01-09 Thread Simon Marlow
Joel Reymont wrote: I compiled a simple one-liner: main = print Blah. This is the GC report: 5,620 bytes allocated in the heap 0 bytes copied during GC 0 collections in generation 0 ( 0.00s) 0 collections in generation 1 ( 0.00s) 1 Mb total

[Haskell-cafe] Re: Shootout favoring imperative code

2006-01-09 Thread Simon Marlow
Sebastian Sylvan wrote: It would be neat if the PackedString library contained functions such as hGetLine etc. It does have a function for reading from a buffer, but it won't stop at a newline... But yeah, fast string manipulation is difficult when using a linked-list representation... My

[Haskell-cafe] Re: hPutStrLn and hFlush

2006-01-10 Thread Simon Marlow
John Meacham wrote: Yeah. this is a major bug in ghc IMHO. I believe it has been fixed, but am unsure. It hasn't been fixed, this is the current behaviour and it's likely to stay that way, I'm afraid. We used to run finalizers on exit, but we stopped doing that for various reasons. Even

[Haskell-cafe] Re: Space usage problems

2006-01-11 Thread Simon Marlow
Ian Lynagh wrote: On Wed, Jan 11, 2006 at 10:36:47AM +, Simon Marlow wrote: My suggestion: don't use the lazy state monad if you can help it. But a strict state monad would force everything to be loaded into memory at once, right? What would you suggest I use instead? I'm not sure

[Haskell-cafe] Re: What's the current bug report procedure?

2006-01-16 Thread Simon Marlow
Seth Kurtzberg wrote: All, I have a (minor) but to report in the networking (Network and Network.Socket) libraries. If the /etc/protocols file is missing, an error message is printed saying that a service could not be found. This occurs even when no service is involved (the port number is

[Haskell-cafe] Re: Shootout rankings

2006-01-16 Thread Simon Marlow
Donald Bruce Stewart wrote: :D Haskell now ranked 2nd overall, only a point or so behind C: http://shootout.alioth.debian.org/gp4/benchmark.php?test=alllang=all And still a bit more we can squeeze out... Nice going, everyone who contributed! Simon

[Haskell-cafe] Re: Creating static libraries using GHC

2006-01-18 Thread Simon Marlow
Tom Hawkins wrote: I have a chunk of Haskell code I would like wrap up and distribute as a library. Is there a way to build a static library (*.a) that includes my code plus the Haskell runtime, which C programs can easily link against? Here is what I have tried so far... ghc --make -fffi

[Haskell-cafe] Re: Hashtable woes

2006-01-23 Thread Simon Marlow
under CK Data.Graph). Is there any hope for GHC 6.6? Does anyone have pointers to CK an existing library at all? Perl and Python and Lua also have excellent CK built in hashtable capabilities. Where is a good library for Haskell? 1) are you used +RTS -A10m / +RTS -H100m? 2) Simon Marlow optimized

[Haskell-cafe] Re: Known Unknowns

2006-01-31 Thread Simon Marlow
Donald Bruce Stewart wrote: haskell: Donald Bruce Stewart wrote: haskell: There is a new combined benchmark, partial sums that subsumes several earlier benchmarks and runs 9 different numerical calculations: http://haskell.org/hawiki/PartialSumsEntry Ah! I had an entry too. I've posted

[Haskell-cafe] Re: unary pattern matching

2006-02-01 Thread Simon Marlow
John Meacham wrote: On Fri, Jan 27, 2006 at 04:57:14AM -0500, Cale Gibbard wrote: Or if we're going to allow @ as an infix operator, we could use (@ pat), reminiscent of section notation. (exp @) of course would make no sense, seeing as there's no representation for patterns as values. oooh.

[Haskell-cafe] Re: SCC accounting

2006-02-01 Thread Simon Marlow
Andrew Pimlott wrote: On Wed, Feb 01, 2006 at 12:28:59AM -0800, Andrew Pimlott wrote: The Haskell code looks like predQuery pred = case lookup pred ctxIdx of Just f - {-# SCC pq.foo' #-} f Note that f is a function, which we expect to be expensive when it is called. However, that should be

[Haskell-cafe] Re: Fast Mutable Variables for the IO and ST monads

2006-02-08 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Simon, Monday, February 06, 2006, 4:41:50 PM, you wrote: SM The Var class is interesting - basically the equivalent of the MArray SM class for mutable variables. Is there a reason you couldn't use the SM same pattern as the MArray class? MArray of Ptr works

[Haskell-cafe] Re: Streams: the extensible I/O library

2006-02-08 Thread Simon Marlow
Bulat Ziganshin wrote: I have developed a new I/O library that IMHO is so sharp that it can eventually replace the current I/O facilities based on using Handles. The main advantage of the new library is its strong modular design using typeclasses. I've taken a brief look, and I must say it's

[Haskell-cafe] Re: FFI question

2006-02-09 Thread Simon Marlow
Frederico Franzosi wrote: I'll try to make it short. I'm developping a package wich imports C functions. the fact is that when I try to compile if I call the compiler in the usual way, using -package and -llib it gives an undefined reference error... For example if I use: $ghc -package

[Haskell-cafe] Re: Emulating bash pipe/ process lib

2006-02-09 Thread Simon Marlow
Marc Weber Marc Weber wrote: Hi. I want to write a little haskell program executing about 4 programs passing data via pipes. As my python script seems to be slower than a bash script I want to try a ghc executable now. It should invoke different parts of a text to speech chain. This way I have

[Haskell-cafe] Re: Language shootout (reloaded)

2006-02-10 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Immanuel, Friday, February 10, 2006, 12:42:41 PM, you wrote: Still---and, please, forgive me for this---I feel that us being #1 now tells us more about the Haskell community than it tells us about Haskell. IL How to optimize Haskell code: IL 1) enter it as a

[Haskell-cafe] Re: Streams: the extensible I/O library

2006-02-21 Thread Simon Marlow
Bulat Ziganshin wrote: Wednesday, February 08, 2006, 2:58:30 PM, you wrote: SM I would prefer to see more type structure, rather than putting SM everything in the Stream class. You have classes ByteStream, SM BlockStream etc, but these are just renamings of the Stream class. There SM are

[Haskell-cafe] Re: Hashtable woes

2006-02-21 Thread Simon Marlow
Brian Sniffen wrote: On 2/10/06, Ketil Malde [EMAIL PROTECTED] wrote: Hmm...perhaps it is worth it, then? The benchmark may specify hash table, but I think it is fair to interpret it as associative data structure - after all, people are using associative arrays that (presumably) don't

[Haskell-cafe] Re: Emulating bash pipe/ process lib

2006-02-21 Thread Simon Marlow
Bulat Ziganshin wrote: Friday, February 10, 2006, 2:53:25 PM, you wrote: i'm not very interested to do something fascinating in this area. it seems that it is enough to do 1) non-blocking read of the entire buffer on input 2) flush buffer at each '\n' at output that should be enough to

[Haskell-cafe] Re: standard poll/select interface

2006-02-21 Thread Simon Marlow
John Meacham wrote: On Fri, Feb 10, 2006 at 12:26:30PM +, Simon Marlow wrote: in fact, I think this should be the basic API, since you can implement readFD in terms of it. (readNonBlockingFD always reads at least one byte, blocking until some data is available). This is used to partially

[Haskell-cafe] Re: standard poll/select interface

2006-02-21 Thread Simon Marlow
Bulat Ziganshin wrote: SM I don't think async I/O is a stream transformer, fitting it into the SM stream hierarchy seems artificial to me. yes, it is possible - what i'm trying to implement everything as tranformer, independent of real necessity. i really thinks that idea of transformers fit

[Haskell-cafe] Re: getChar + System.Cmd.system + threads causes hangups

2006-02-21 Thread Simon Marlow
Einar Karttunen wrote: Hello Using system or any variant of it from System.Process seems broken in multithreaded environments. This example will fail with and without -threaded. When run the program will print hello: start and then freeze. After pressing enter (the first getChar)

[Haskell-cafe] Re: getChar + System.Cmd.system + threads causes hangups

2006-02-22 Thread Simon Marlow
Donn Cave wrote: On Tue, 21 Feb 2006, Simon Marlow wrote: The reason for the deadlock is because getChar is holding a lock on stdin, and System.Cmd.system needs to access the stdin Handle in order to know which file descriptor to dup as stdin in the child process (the stdin Handle isn't

[Haskell-cafe] Re: Emulating bash pipe/ process lib

2006-02-22 Thread Simon Marlow
Bulat Ziganshin wrote: Tuesday, February 21, 2006, 4:05:57 PM, you wrote: i'm not very interested to do something fascinating in this area. it seems that it is enough to do 1) non-blocking read of the entire buffer on input 2) flush buffer at each '\n' at output that should be enough to

RE: [Haskell-cafe] Re: Hashtable woes

2006-02-22 Thread Simon Marlow
On 21 February 2006 17:21, Chris Kuklewicz wrote: From the shooutout itself: http://shootout.alioth.debian.org/gp4/benchmark.php?test=knucleotidelan g=ghcid=3 and http://shootout.alioth.debian.org/gp4/benchmark.php?test=knucleotidelan g=ghcid=2 (I forget the exact different between

[Haskell-cafe] Re: standard poll/select interface

2006-02-28 Thread Simon Marlow
Marcin 'Qrczak' Kowalczyk wrote: Simon Marlow [EMAIL PROTECTED] writes: I think the reason we set O_NONBLOCK is so that we don't have to test with select() before reading, we can just call read(). If you don't use O_NONBLOCK, you need two system calls to read/write instead of one

[Haskell-cafe] Re: different code in different platforms

2006-03-15 Thread Simon Marlow
Neil Mitchell wrote: Does it really have to change statically? I use code like: #ifdef __WIN32__ (Windows code) #else (Linux code) #endif In Yhc, we use a runtime test to check between Windows and Linux. It has various advantages - we only have one code base, everything is type

[Haskell-cafe] Re: Reading files efficiently

2006-03-22 Thread Simon Marlow
Donald Bruce Stewart wrote: Well, I know this works: $ cat A.lhs #!/usr/bin/env runhaskell main = putStrLn gotcha! $ ./A.lhs gotcha! But for files with no .hs or .lhs extension? Anyone know of a trick? GHC 6.6 will allow this, because we added the -x flag (works just

[Haskell-cafe] Re: The case of the missing module

2006-04-24 Thread Simon Marlow
Neil Mitchell wrote: import Paths_haddock( getDataDir ) Haddock requires to be built with Cabal (which generates this module), and as far as I can remember, its a Cabal that isn't released anywhere. When I did some work on haddock I commented this out, and made getDataDir return an

[Haskell-cafe] Re: How to get Haddock to generate docs for a directory tree of modules

2006-04-24 Thread Simon Marlow
Brian Hulley wrote: I've been looking at the docs for Haddock at http://haskell.org/haddock/haddock-html-0.7/index.html but I can't seem to find any option to recursively traverse a directory generating hyperlinked docs for all modules anywhere in the directory or any sub directory etc. Is

[Haskell-cafe] Re: Haddock seems to generate wrong types in newtype deriving

2006-04-24 Thread Simon Marlow
Brian Hulley wrote: Hi - I have the following code: data MState = MState -- details omitted type MonadStateMState = MonadState MState -- necessary for Haddock newtype ManagerM a = ManagerM (StateT MState IO a) deriving (Monad, MonadIO, MonadStateMState) which

[Haskell-cafe] Re: database access recommendation

2006-05-02 Thread Simon Marlow
Bulat Ziganshin wrote: Hello Donald, Friday, April 28, 2006, 12:29:38 PM, you wrote: I looked at http://www.haskell.org/haskellwiki/Libraries_and_tools, and suffice it to say that this page don't reflects current state of the art. during many years it was not updated and when it was moved

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-03 Thread Simon Marlow
This is interesting, thanks. I propose to add INLINE pragmas to withMVar and friends. Having an interface for simple locks sounds like a good idea to me. Would you like to send a patch? This won't affect Handle I/O unfortunately, because we need block to protect against asynchronous

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-04 Thread Simon Marlow
John Meacham wrote: On Wed, May 03, 2006 at 12:07:19PM +0100, Simon Marlow wrote: This won't affect Handle I/O unfortunately, because we need block to protect against asynchronous exceptions. I'm still not certain you won't need that in the stream library, too: check any stateful code (eg

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-04 Thread Simon Marlow
Bulat Ziganshin wrote: after Simon's message i thought about this problem. i found several situations where restoring of locked file will be useful: - using stdout and other standard handles. we may need to print error message or just continue work despite the exception abandoned our previous

[Haskell-cafe] Re: GHC 6.4.1 x86-64 does not compile

2006-05-05 Thread Simon Marlow
Dusan Kolar wrote: Hello all, I've install universal binary for x86_64 of GHC 6.4.1. The installation was done on AMD dual core machine. Uname for the machine gives: Linux machine name 2.6.16.5 #1 SMP Thu Apr 13 09:08:22 CEST 2006 x86_64 x86_64 x86_64 GNU/Linux While ghci was running

[Haskell-cafe] Re: Optimizing locking with MVars

2006-05-05 Thread Simon Marlow
Bulat Ziganshin wrote: Wednesday, May 3, 2006, 3:07:19 PM, you wrote: I propose to add INLINE pragmas to withMVar and friends. and to any higher-order function? :) imho, key of this problem is that GHC don't have a way to optimize just the required function with all it's enclosed calls.

[Haskell-cafe] Re: How to automatically free memory allocated by malloc? and how to reliably realloc such buffer?

2006-05-24 Thread Simon Marlow
Bulat Ziganshin wrote: my program uses datastructure that contains plain Ptr, this Ptr points to the memory area allocated by 'malloc': createRawMemBuf size = do buf- mallocBytes (fromIntegral size) bufRef - newURef buf ... return (Mem bufRef ...) i need to free this

[Haskell-cafe] Re: How to automatically free memory allocated by malloc? and how to reliably realloc such buffer?

2006-05-24 Thread Simon Marlow
Bulat Ziganshin wrote: Wednesday, May 24, 2006, 2:08:10 PM, you wrote: fptr - newForeignPtr fin nullPtr return (Mem bufRef ... fptr) I hope you surround each use of the actual Ptr with 'withForeignPtr'? If so, I imagine this is safe. no, i hope that fptr's finalizers will be no

Re: [Haskell-cafe] Preview the new haddock look and take a short survey

2010-08-09 Thread Simon Marlow
On 06/08/10 03:15, Jeff Zaroyko wrote: On Thu, Aug 5, 2010 at 11:48 PM, Johan Tibelljohan.tib...@gmail.com wrote: On Thu, Aug 5, 2010 at 3:35 PM, Dino Morellid...@ui3.info wrote: On Wed, 4 Aug 2010, Mark Lentczner wrote: One thing I haven't seen anyone else comment on is the width of the

[Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-08-09 Thread Simon Marlow
On 27/07/2010 01:54, John Meacham wrote: For each type I can statically generate an optimal layout based on its structure. For instance, maybe benefits from two of these optimizations, first of all, nullary constructors (Nothing) need never appear in the heap, so they are given values that pack

[Haskell-cafe] Re: A GHC error message puzzle

2010-08-12 Thread Simon Marlow
On 12/08/10 15:09, Yitzchak Gale wrote: The file error_puzzle.hs begins like this: main = do inp- readFile input writeFile output $ process inp process :: String - String When compiled with GHC 6.12.3 and run, it gives the following result: $ ./error_puzzle error_puzzle: output:

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-13 Thread Simon Marlow
On 12/08/2010 21:59, Yitzchak Gale wrote: Wei Hu wrote: nonTermination _ = blackhole where blackhole = blackhole My original example was actually: process :: String - String process = let x = x in x Ah yes, that works too. But other similar versions don't, like this one: process ::

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-13 Thread Simon Marlow
On 13/08/2010 09:53, Simon Marlow wrote: On 12/08/2010 21:59, Yitzchak Gale wrote: Wei Hu wrote: nonTermination _ = blackhole where blackhole = blackhole My original example was actually: process :: String - String process = let x = x in x Ah yes, that works too. But other similar

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-14 Thread Simon Marlow
On 14/08/10 02:30, Lennart Augustsson wrote: So it's a bug in the garbage collector. It's closing a handle that clearly is still reachable, otherwise this would not have happened. The handle is in fact not reachable from the roots, because the thread that points to it is also not reachable.

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-14 Thread Simon Marlow
On 13/08/10 17:00, Tillmann Rendel wrote: Simon Marlow wrote: Really hClose shouldn't complain about a finalized handle, I'll see if I can fix that. That sounds like a work-around to me, not a fix, because it would not fix more complicated exception handlers. I don't think there's

Re: [Haskell-cafe] Re: A GHC error message puzzle

2010-08-16 Thread Simon Marlow
On 14/08/2010 22:29, Yitzchak Gale wrote: Lennart Augustsson wrote: So it's a bug in the garbage collector. It's closing a handle that clearly is still reachable, otherwise this would not have happened. Simon Marlow wrote: The handle is in fact not reachable from the roots, because

[Haskell-cafe] Re: Support for lock-free/wait-free programming?

2010-08-17 Thread Simon Marlow
On 17/08/2010 06:09, Gregory Collins wrote: Does GHC expose any primitives for things like atomic compare-and-swap? I can't seem to find anything in the docs. I'm wondering if it's possible, for example, to implement things like the wait-free concurrent queue from [1] or a lock-free wait-free

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-20 Thread Simon Marlow
On 19/08/2010 18:21, John Millikin wrote: On Wed, Aug 18, 2010 at 23:33, Jason Dagitda...@codersbase.com wrote: The main reason I would use iteratees is for performance reasons. To help me, as a potential consumer of your library, could you please provide benchmarks for comparing the

[Haskell-cafe] Re: [Haskell] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-23 Thread Simon Marlow
On 21/08/2010 04:30, John Millikin wrote: This also changes the binary enumHandle to use non-blocking IO, as recommended by Magnus Therning. I'm embarrassed to admit I still don't understand the improvement, exactly, but three people so far have told me it's a good idea. The issue is that

Re: [Haskell-cafe] Re: [Haskell] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-23 Thread Simon Marlow
On 23/08/2010 12:10, Felipe Lessa wrote: Hello, Simon! On Mon, Aug 23, 2010 at 8:00 AM, Simon Marlowmarlo...@gmail.com wrote: The issue is that hGet always waits for a complete buffer-full of data before returning. The hWaitForInput/hGetNonBlocking combination fixes that problem, but you

Re: [Haskell-cafe] Re: [Haskell] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-23 Thread Simon Marlow
On 23/08/2010 12:38, Felipe Lessa wrote: On Mon, Aug 23, 2010 at 8:29 AM, Simon Marlowmarlo...@gmail.com wrote: Which documentation are you referring to? This looks ok to me: http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/System-IO.html#v%3AhGetBuf Indeed, while there

Re: [Haskell-cafe] Re: [Haskell] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-23 Thread Simon Marlow
On 23/08/2010 12:57, Felipe Lessa wrote: On Mon, Aug 23, 2010 at 8:51 AM, Simon Marlowmarlo...@gmail.com wrote: Hmm, RawIO.read looks ok: -- | Read up to the specified number of bytes, returning the number -- of bytes actually read. This function should only block if there -- is no data

[Haskell-cafe] Re: Hackage on Linux

2010-08-26 Thread Simon Marlow
On 22/08/2010 11:41, Andrew Coppin wrote: Ivan Lazar Miljenovic wrote: Hackage has limited support for distro maintainers to state which packages are available on the distribution. Last I checked, it required distro maintainers to keep a text file somewhere up to date. Note that not all

[Haskell-cafe] Re: Cleaning up threads

2010-09-21 Thread Simon Marlow
On 14/09/10 19:29, Bryan O'Sullivan wrote: On Tue, Sep 14, 2010 at 11:21 AM, Edward Z. Yang ezy...@mit.edu mailto:ezy...@mit.edu wrote: Pure code can always be safely asynchronously interrupted (even code using state like the ST monad), and IO code can be made to interact correctly

Re: [Haskell-cafe] Re: Cleaning up threads

2010-09-22 Thread Simon Marlow
On 22/09/2010 02:18, Mitar wrote: Hi! On Tue, Sep 21, 2010 at 11:10 PM, Simon Marlowmarlo...@gmail.com wrote: So rather than admitting defeat here I'd like to see it become the norm to write async-exception-safe code. This is also what I think. You have to make your code work with

Re: [Haskell-cafe] Re: Cleaning up threads

2010-09-22 Thread Simon Marlow
On 22/09/2010 09:51, Mitar wrote: Hi! On Wed, Sep 22, 2010 at 10:21 AM, Simon Marlowmarlo...@gmail.com wrote: You could use maskUninterruptible, but that's not a good solution either - if an operation during cleanup really does block, you'd like to be able to Control-C your way out. So

[Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-06 Thread Simon Marlow
On 06/10/2010 00:04, Max Bolingbroke wrote: On 5 October 2010 17:38, Henning Thielemann schlepp...@henning-thielemann.de wrote: Richard O'Keefe schrieb: I'd prefer to see something like \ 1 - f | 2 - g but I'm sure something could be worked out. In order to be consistent

[Haskell-cafe] Re: Notes from Haskell takes over the world BoF at ICFP

2010-10-07 Thread Simon Marlow
On 07/10/2010 02:45, Jason Dagit wrote: + well documented workflow for lightweight changes + heavy weight process for major work. + bugs, tickets. + Simon Marlow contributions are going up, and process is working well That's reassuring. Is their workflow

[Haskell-cafe] Re: Eta-expansion destroys memoization?

2010-10-08 Thread Simon Marlow
On 07/10/2010 14:03, Derek Elkins wrote: On Thu, Oct 7, 2010 at 8:44 AM, Luke Palmerlrpal...@gmail.com wrote: On Thu, Oct 7, 2010 at 6:17 AM, Brent Yorgeybyor...@seas.upenn.edu wrote: The source code seems to be easy to read, but I don't think I understand that. For me I think if I change

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-12 Thread Simon Marlow
On 09/10/2010 10:07, Daniel Fischer wrote: On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: That code is incorrect. You can't assume that the base for floating point numbers is 2, that's something you have to check. (POWER6 and z9 has hardware support for base 10 floating

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-13 Thread Simon Marlow
On 12/10/2010 15:17, Daniel Fischer wrote: On Tuesday 12 October 2010 11:18:39, Simon Marlow wrote: On 09/10/2010 10:07, Daniel Fischer wrote: On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: That code is incorrect. You can't assume that the base for floating point numbers

Re: [Haskell-cafe] Bug in HTTP (bad internal error handling)

2010-11-03 Thread Simon Marlow
On 29/10/2010 23:24, Ganesh Sittampalam wrote: On Fri, 22 Oct 2010, Sigbjorn Finne wrote: On Fri, Oct 22, 2010 at 9:35 AM, Sittampalam, Ganesh ganesh.sittampa...@credit-suisse.com wrote: libraries@, what's the right way to proceed? Can I make a Debian-style non-maintainer upload with

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-10 Thread Simon Marlow
is raised. Hopefully one of the GHC devs (probably Simon Marlow) can confirm this behavior and shed some more light on it. I think it's behaving as expected - there's a short window during which exceptions are unblocked and a second exception can be thrown. The program has let run = doSomething

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-10 Thread Simon Marlow
On 10/11/2010 13:39, Mitar wrote: I know that (I read one post from you some time ago). It is in TODO commend before this code. I am waiting for GHC 7.0 for this because I do not like current block/unblock approach. Because blocked parts can still be interrupted, good example of that is

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-11 Thread Simon Marlow
On 10/11/2010 17:52, Mitar wrote: Hi! On Wed, Nov 10, 2010 at 4:16 PM, Simon Marlowmarlo...@gmail.com wrote: The right way to fix it is like this: Optimist. ;-) let run = unblock doSomething `catches` [ Handler (\(_ :: MyTerminateException) - return ()),

[Haskell-cafe] Re: Haskell is a scripting language inspired by Python.

2010-11-11 Thread Simon Marlow
On 04/11/2010 22:38, Lennart Augustsson wrote: It happened at various universities around the world. Look at the original Haskell committee and you'll get a good idea where. The smallest Haskell I know of is Gofer/Hugs; it originally ran on a 640k PCs. Before that languages like SASL and KRC

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-17 Thread Simon Marlow
On 12/11/2010 07:49, Mitar wrote: On Wed, Nov 10, 2010 at 4:48 PM, Simon Marlowmarlo...@gmail.com wrote: You can use maskUninterruptible in GHC 7, but that is not generally recommended, Maybe there should be some function like maskUninterruptibleExceptUser which would mask everything except

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-11-18 Thread Simon Marlow
On 18/11/2010 11:31, Mitar wrote: Hi! On Wed, Nov 17, 2010 at 12:00 PM, Simon Marlowmarlo...@gmail.com wrote: That's hard to do, because the runtime system has no knowledge of exception types, and I'm not sure I like the idea of baking that knowledge into the RTS. But currently it does have

[Haskell-cafe] Re: Eq instance for Chan

2010-11-25 Thread Simon Marlow
On 25/11/2010 00:48, Mitar wrote: Why is there no Eq instance for Chan? There is Eq for MVar so it is quite possible to define also Eq for Chan? It's just an oversight. Send us a patch, or make a ticket for it? Cheers, Simon ___

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-12-01 Thread Simon Marlow
On 01/12/2010 03:02, Mitar wrote: Hi! On Thu, Nov 18, 2010 at 2:19 PM, Simon Marlowmarlo...@gmail.com wrote: then it isn't uninterruptible, because the timeout can interrupt it. If you can tolerate a timeout exception, then you can tolerate other kinds of async exception too. Yes, but

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-12-02 Thread Simon Marlow
On 13/11/2010 19:08, Bit Connor wrote: On Wed, Nov 10, 2010 at 5:48 PM, Simon Marlowmarlo...@gmail.com wrote: [...] So we should say there are a few things that you can do that guarantee not to call any interruptible operations: - IORef operations - STM transactions that do not use retry

Re: [Haskell-cafe] [Haskell] haskell.org migration complete

2010-12-03 Thread Simon Marlow
On 02/12/2010 23:48, Claus Reinke wrote: The haskell.org server migration is now complete. Please let us know if you have any problems. Beginning this week, the majority of mails from haskell.org lists seem to end up in my ISP's spam filter. That would be Yahoo! - I wonder whether others here

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-09 Thread Simon Marlow
On 08/12/2010 16:34, Andrew Coppin wrote: On 08/12/2010 03:29 PM, Brandon S Allbery KF8NH wrote: Then build your CGIs restricted. Restricting the runtime by default, *especially* when setting runtime options at compile time is so much of a pain, is just going to cause problems. I'm already

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-15 Thread Simon Marlow
On 13/12/2010 15:45, Peter Simons wrote: Hi Mathieu, Why don't you use ulimit for this job? $ ulimit -m 32M; ./cpsa yes, I was thinking the same thing. Relying exclusively on GHC's ability to limit run-time memory consumption feels like an odd choice for this task. It's nice that

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-16 Thread Simon Marlow
On 16/12/2010 00:37, John D. Ramsdell wrote: On Wed, Dec 15, 2010 at 7:59 AM, Simon Marlowmarlo...@gmail.com wrote: The -M flag causes the GC algorithm to switch from copying (fast but hungry) to compaction (slow but frugal) as the limit approaches. Ah, so that's what it's doing. My

Re: [Haskell-cafe] Printing of asynchronous exceptions to stderr

2010-12-16 Thread Simon Marlow
On 07/12/2010 21:30, Mitar wrote: Hi! On Wed, Dec 1, 2010 at 10:50 AM, Simon Marlowmarlo...@gmail.com wrote: Yes, but semantics are different. I want to tolerate some exception because they are saying I should do this and this (for example user interrupt, or timeout) but I do not want others,

Re: [Haskell-cafe] Functor = Applicative = Monad

2010-12-22 Thread Simon Marlow
On 14/12/2010 08:35, Isaac Dupree wrote: On 12/14/10 03:13, John Smith wrote: I would like to formally propose that Monad become a subclass of Applicative, with a call for consensus by 1 February. The change is described on the wiki at

Re: [Haskell-cafe] Functor = Applicative = Monad

2010-12-23 Thread Simon Marlow
On 22/12/10 19:17, John Smith wrote: On 22/12/2010 19:03, Simon Marlow wrote: On 14/12/2010 08:35, Isaac Dupree wrote: On 12/14/10 03:13, John Smith wrote: I would like to formally propose that Monad become a subclass of Applicative, with a call for consensus by 1 February. The change

Re: [Haskell-cafe] Odd profiling results

2011-01-05 Thread Simon Marlow
On 04/01/2011 21:20, Erik de Castro Lopo wrote: Malcolm Wallace wrote: The peaks I am guessing are largely attributable to parsing the source files. Then, once the source has been converted to an AST, the DDC compiler is presumably doing some analysis before moving on to the next file? I

Re: [Haskell-cafe] thread safety, IO arrays, and IO refs

2011-01-05 Thread Simon Marlow
On 31/12/2010 09:19, Eric Stansifer wrote: Hello, I wish to use a mutable array in multiple threads. Can IO arrays be used in any thread, or only the thread they are created in? (So if I create an IO array in one thread, pass it to another via an MVar, can I read / edit it in that other

<    1   2   3   4   5   6   7   8   9   >