[Haskell-cafe] Re: Network.CGI.Compat.pwrapper

2007-02-13 Thread Gracjan Polak
Bjorn Bringert bringert at cs.chalmers.se writes: Another question is: how do I do equivalent functionality without pwrapper? You can roll you own web server if you want something very simple. If you don't want to do that, there is a version of Simon Marlow's Haskell Web Server

Re: [Haskell-cafe] Re: Network.CGI.Compat.pwrapper

2007-02-13 Thread Bjorn Bringert
On Feb 13, 2007, at 9:14 , Gracjan Polak wrote: Bjorn Bringert bringert at cs.chalmers.se writes: Another question is: how do I do equivalent functionality without pwrapper? You can roll you own web server if you want something very simple. If you don't want to do that, there is a version

Re: [Haskell-cafe] Network.CGI.Compat.pwrapper

2007-02-13 Thread Bjorn Bringert
On Feb 12, 2007, at 23:27 , Albert Y. C. Lai wrote: Bjorn Bringert wrote: pwrapper is not an HTTP server, though the Haddock comment can make you think so. pwrapper allows you to talk *CGI* over a TCP port, but I have no idea why anyone would like to do that. Here is a scenerio. I want a

[Haskell-cafe] Re: Foldr tutorial, Inspired by Getting a Fix from a Fold

2007-02-13 Thread apfelmus
Lennart Augustsson wrote: para f e xs = snd $ foldr (\ x ~(xs, y) - (x:xs, f x xs y)) ([], e) xs I thought solution one was missing the ~ ? Yes, that's irrefutably right ;) I mean solution one modulo the laziness bug. Regards, apfelmus ___

[Haskell-cafe] Re: Network.CGI.Compat.pwrapper

2007-02-13 Thread Gracjan Polak
Bjorn Bringert bringert at cs.chalmers.se writes: Is there a description what is a *CGI* protocol? Here you go: http://hoohoo.ncsa.uiuc.edu/cgi/interface.html I should be more clear: what kind of data does pwrapper expect? Somewhere in the middle it needs two handles: one to write and

[Haskell-cafe] SIP SDP parsers

2007-02-13 Thread Neil Davies
Hi Has anyone out there done any work on parsers for SIP (Session Initiation Protocol) and/or SDP (Session Description Protocol)? Thought that I would ask before I embarked on it myself. Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: GHC throws IOError on Win32 when there is no console

2007-02-13 Thread Simon Marlow
Duncan Coutts wrote: On Sat, 2007-02-10 at 23:46 +1100, John Ky wrote: Hi Duncan, Thanks for your comments. In the context of a haskell process running as a Windows service, a message box is useless, because Haskell services do not have a GUI and cannot interact with the desktop. Good

Re: [Haskell-cafe] Re: GHC throws IOError on Win32 when there is no console

2007-02-13 Thread Krasimir Angelov
On 2/13/07, Simon Marlow [EMAIL PROTECTED] wrote: Sounds like a good idea. You need to look at rts/RtsMessages.c, in particular rtsErrorMsgFn(), which currently has cases for GUI and non-GUI. I guess it really should have 3 cases: GUI, console, and non-GUI. The trick here is how to find

[Haskell-cafe] Re: Haskell vs Ruby as a scripting language

2007-02-13 Thread Simon Marlow
Neil Mitchell wrote: Hi Also, I recommend looking into embedding YHC. I have not had a chance to use it yet, but it looks like it is a better fit to an interpreter-only embedding situation than GHC--with GHC, you are getting a lot more than you seem to be asking for. I would want to

[Haskell-cafe] Re: GHC throws IOError on Win32 when there is no console

2007-02-13 Thread Simon Marlow
Krasimir Angelov wrote: On 2/13/07, Simon Marlow [EMAIL PROTECTED] wrote: Sounds like a good idea. You need to look at rts/RtsMessages.c, in particular rtsErrorMsgFn(), which currently has cases for GUI and non-GUI. I guess it really should have 3 cases: GUI, console, and non-GUI. The

Re[2]: [Haskell-cafe] Network.CGI.Compat.pwrapper

2007-02-13 Thread Bulat Ziganshin
Hello Albert, Tuesday, February 13, 2007, 1:27:29 AM, you wrote: * Or, nevermind performance or privilege. I am a cheapo, and I use a cheapo hosting provider, which only provides me with 3MB of storage. My program weighs 17MB (recall that it links in the whole GHC :) ). may be hugs or

[Haskell-cafe] Re: Haskell vs Ruby as a scripting language

2007-02-13 Thread Neil Mitchell
Hi Simon, Yhc can happily compile code and run it. You'll probably pay a factor of 2-8 times slower than GHC, depending on what the code does. Benchmarks please! Let's see some comparisons on the nofib suite. If there's a factor of 2 or less between GHC -O2 and YHC for any of the nofib

Re: [Haskell-cafe] Re: Haskell vs Ruby as a scripting language

2007-02-13 Thread Bulat Ziganshin
Hello Neil, Tuesday, February 13, 2007, 4:43:46 PM, you wrote: Benchmarks please! Let's see some comparisons on the nofib suite. If there's a factor of 2 or less between GHC -O2 and YHC for any of the nofib programs, I'll eat my keyboard for lunch :-) I will try and get some Yhc vs

[Haskell-cafe] Calendar Dates before the epoch

2007-02-13 Thread jim burton
It seems that CalendarTime is for dates since the epoch...what do I use to handle dates before that? Sorry if this is an FAQ, I looked on the wiki and tried to find MissingH since I thought it might be in there, but don't know where to find it. I also found this from 2003 -

Re: [Haskell-cafe] Calendar Dates before the epoch

2007-02-13 Thread Björn Bringert
jim burton wrote: It seems that CalendarTime is for dates since the epoch...what do I use to handle dates before that? Sorry if this is an FAQ, I looked on the wiki and tried to find MissingH since I thought it might be in there, but don't know where to find it. I also found this from 2003 -

[Haskell-cafe] Implementation of scaled integers

2007-02-13 Thread Stefan Heinzmann
Hi all, is there a library for Haskell that implements scaled integers, i.e. integers with a fixed scale factor so that the scale factor does not need to be stored, but is part of the type? In particular it would be useful (i.e. for signal processing) to have numbers based on Int scaled such

[Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought that everything I'd written here was tail-recursive, but after compiling this

Re: [Haskell-cafe] Implementation of scaled integers

2007-02-13 Thread Lennart Augustsson
The tricky part to get efficient is multiply and divide. Say you pick Int32 as the underlying type, when multiplying you really want the 64 bit result and then scale that. AFAIK, there are no such primitives exposed to the user. What you can do is cast to 64 bit, multiply, shift, and cast back

Re: [Haskell-cafe] Implementation of scaled integers

2007-02-13 Thread Sebastian Sylvan
On 2/13/07, Stefan Heinzmann [EMAIL PROTECTED] wrote: Hi all, is there a library for Haskell that implements scaled integers, i.e. integers with a fixed scale factor so that the scale factor does not need to be stored, but is part of the type? In particular it would be useful (i.e. for signal

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Duncan Coutts
On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought that everything I'd

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
On Tuesday 13 February 2007 15:59, Duncan Coutts wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Kirsten Chevalier
On 2/13/07, Jefferson Heard [EMAIL PROTECTED] wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to point me in the direction of a document on efficiency in

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Brandon S. Allbery KF8NH
On Feb 13, 2007, at 16:07 , Kirsten Chevalier wrote: On 2/13/07, Jefferson Heard [EMAIL PROTECTED] wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Creighton Hogg
On 2/13/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Bernie Pope
Duncan Coutts wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Seth Gordon
Jefferson Heard wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to point me in the direction of a document on efficiency in Haskell? I found this page

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Bernie Pope
Creighton Hogg wrote: On 2/13/07, *Duncan Coutts* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or

[Haskell-cafe] Re: Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread apfelmus
Jefferson Heard wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving execution time efficiency. Anyone care to point me in the direction of a document on efficiency in Haskell? Besides, proper tail

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Creighton Hogg
On 2/13/07, Bernie Pope [EMAIL PROTECTED] wrote: Creighton Hogg wrote: This may be silly of me, but I feel like this is an important point: so you're saying that tail recursion, without strictness, doesn't run in constant space? It is an important point, and a classic space bug (see foldl

Re: [Haskell-cafe] Re: Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Didn't think it was overly slow, just that I could do better :-). On Tuesday 13 February 2007 16:30, [EMAIL PROTECTED] wrote: Jefferson Heard wrote: Argh, bitten by the scheme bug! Right -- NO tail recursion... So that leaves me with some rather non-intuitive strategies for achieving

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Ha! You're right! I didn't think about the laziness aspect of it. Anyway, the non tail-recursive version fixed the problem. Thanks! On Tuesday 13 February 2007 16:32, Bernie Pope wrote: Creighton Hogg wrote: On 2/13/07, *Duncan Coutts* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:

[Haskell-cafe] Suggestion for hackage

2007-02-13 Thread Benjamin Franksen
Hi It would be a nice feature if one could look online at the documentation of a package, i.e. w/o downloading and building the package first. Fr instance, haddock generated API docs can give you a much better idea what you can expect from a library package than the mere package description.

Re: [Haskell-cafe] Implementation of scaled integers

2007-02-13 Thread Twan van Laarhoven
Stefan Heinzmann wrote: Hi all, is there a library for Haskell that implements scaled integers, i.e. integers with a fixed scale factor so that the scale factor does not need to be stored, but is part of the type? Data.Fixed [1] does exactly that, only it is based on Integer. Using fixed

[Haskell-cafe] Re: Implementation of scaled integers

2007-02-13 Thread Benjamin Franksen
Stefan Heinzmann wrote: is there a library for Haskell that implements scaled integers, i.e. integers with a fixed scale factor so that the scale factor does not need to be stored, but is part of the type? I dimly remember that there has been some work done on this in connection with (and by

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Donald Bruce Stewart
duncan.coutts: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Duncan Coutts
On Tue, 2007-02-13 at 15:12 -0600, Creighton Hogg wrote: On 2/13/07, Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: Hi, I am running the following code against a 210 MB file in an attempt to determine

Re: [Haskell-cafe] Suggestion for hackage

2007-02-13 Thread Donald Bruce Stewart
benjamin.franksen: Hi It would be a nice feature if one could look online at the documentation of a package, i.e. w/o downloading and building the package first. Fr instance, haddock generated API docs can give you a much better idea what you can expect from a library package than the mere

Re: [Haskell-cafe] Summer of Code

2007-02-13 Thread Donald Bruce Stewart
bulat.ziganshin: Hello Bryan, Tuesday, February 13, 2007, 2:24:21 AM, you wrote: I am wondering if there are any Summer of Code projects that I would be able to do for the Haskell community. of 9 projects started last year, only 1 or 2 was successful. so i think that retaking one of

[Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-13 Thread keepbal
For example, --- ?php //test.php require (tiny.php);//Tiny is a small template engine. $tn=new Tiny(); $arr=new Array(); $arr['a']='1'; $arr['b']='2'; $arr['c']='3'; $tn-set('arr',$arr); $tn-show('_test.php'); ? --- ?php

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-13 Thread Donald Bruce Stewart
keepbal: The code and template are separated in the PHP example,so designers can design with out too much PHP knowledge.This is actually what I want to solve. I'd use one of the Html/XML pretty printing libraries then, xhtml:

[Haskell-cafe] Difference between Lazy ByteStrings and Strings in alex

2007-02-13 Thread Jefferson Heard
It was suggested that I might derive some performance benefit from using lazy bytestrings in my tokenizer instead of regular strings. Here's the code that I've tried. Note that I've hacked the basic wrapper code in the Lazy version, so the code should be all but the same. The only thing I

Re: [Haskell-cafe] Difference between Lazy ByteStrings and Strings in alex

2007-02-13 Thread Donald Bruce Stewart
jeff: It was suggested that I might derive some performance benefit from using lazy bytestrings in my tokenizer instead of regular strings. Here's the code that I've tried. Note that I've hacked the basic wrapper code in the Lazy version, so the code should be all but the same. The only

Re: [Haskell-cafe] Difference between Lazy ByteStrings and Strings in alex

2007-02-13 Thread Stefan O'Rear
On Tue, Feb 13, 2007 at 10:43:11PM -0500, Jefferson Heard wrote: I am running GHC 2.6 now, and am using -O3 as my optimization parameter. I'm I think you will get much better performance with GHC 6.6. The optimizer has been improved a *lot* in the last 10 years. (I hope that was a typo!!)

Re: [Haskell-cafe] Difference between Lazy ByteStrings and Strings in alex

2007-02-13 Thread Jefferson Heard
Yes, that was a typo :-) On Tuesday 13 February 2007 22:54, Stefan O'Rear wrote: On Tue, Feb 13, 2007 at 10:43:11PM -0500, Jefferson Heard wrote: I am running GHC 2.6 now, and am using -O3 as my optimization parameter. I'm I think you will get much better performance with GHC 6.6. The