Re: [Haskell-cafe] Can I use Haskell for web programming

2006-01-23 Thread Lemmih
On 1/23/06, Jared Updike [EMAIL PROTECTED] wrote:
 For haskell-fastcgi, my configure fails with

 cannot satisfy dependency cgi-any

 Google does not turn up any useful results for this. Which package
 will fix this dependency? I thought I just installed fastcgi from
 source but I'm not sure where it gets looked for by haskell-fastcgi...

From the README:
Requirements for building:

- The cgi package from:
  http://www.cs.chalmers.se/~bringert/darcs/haskell-cgi/

--
Friendly,
  Lemmih
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Can I use Haskell for web programming

2006-01-23 Thread Niklas Broberg
hsp can be run in two different modes. Running the full-blown version
with runtime system will probably be hard on a professional site, you
would have to convince them to install hsp. But if you can do without
the fancier bits, in particular application-scoped data, you can run
hsp pages as ordinary cgi scripts. Look in the HSPR.CGI.RunCGI module.

/Niklas

On 1/21/06, Maurício [EMAIL PROTECTED] wrote:
They both look cool. Do you think I'll be able to find someone to
 host professional sites using those libraries?

[],
Maurício

 Sebastian Sylvan wrote:
  On 1/21/06, Maurício [EMAIL PROTECTED] wrote:
 
Hi,
 
Can I use Haskell to do what people do with, say, PHP? More and more
 I have the need for that, and I've been looking into Ruby on Rails. Do
 you thing Haskell could be a choice? Of course, I don't need something
 exactly like PHP (for instance, I don't care if I can't insert code in
 the middle of xhtml pages. If I have to generate everything from Haskell
 code, I would probably like it. Also, CGI can be a choice). But I need
 reasonable efficiency and to be able to find someone to host my site.
What solutions do you suggest me?
 
 
 
  Take a look at WASH and HSP...
 
  http://www.informatik.uni-freiburg.de/~thiemann/WASH/
  http://www.cs.chalmers.se/~d00nibro/hsp/
 
  --
  Sebastian Sylvan
  +46(0)736-818655
  UIN: 44640862

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] GHC integers pre-allocation

2006-01-23 Thread Simon Peyton-Jones








I believe that we statically allocate
all ASCII chars, and Ints between -16 and +16. Have a look in
ghc/rts/StgMiscClosures.cmm



Simon













From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Monique Monteiro
Sent: 22 January 2006 23:26
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] GHC
integers pre-allocation





Hi all,
 
 does anyone know if GHC implements any kind of pre-allocation of
integers/caracteres ? If yes, which range of values does it use?

Thanks in advance,

Monique Monteiro








___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Hashtable woes

2006-01-23 Thread Chris Kuklewicz
Hello,

  This post is a about a tangential issue to the shootout, not the
shootout itself.  It concerns the lack of a fast mutable hashtable.  If
you have a good replacement for Data.Hashtable, I would be interested to
know about it (and so would the wiki!).  The shootout entry
k-nucleotide is a good test of the hashtable provided by each of the
languages:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=knucleotidelang=all

Several of us are building a proposed entry on the wiki at

http://haskell.org/hawiki/KnucleotideEntry

where I have just posted a plea which I will paste below:

On mutable data structures in Haskell

This benchmark is completely bottlenecked by Data.Hashtable (in GHC
6.4.1) and this discussion is based on the assumption that I am using
Hashtable optimally. I downloaded the GHD 0.17 compiler and the DMD
entry to benchmark on my machine. The DMD entry uses the associative
arrays built into the language: int[char[]] frequencies and places
[WWW]second (runs in 3.0s). The winning entry is interesting, since the
c-code does not have a hash table, and so it uses #include
../../Include/simple_hash.h which pulls in a dead simple, inline,
string to int hashtable and runs in 2s.

The entry below runs 16 slower than the DMD entry on my powerbook G4.
Profiling shows the bottleneck. I downloaded simple_hash.h and
shamelessly optimized it to replace Data.Hashtable for exactly this
benchmark code. This sped up the proposed entry by a factor of 4.1 so
that it is now about a factor of 4 slower than the DMD entry. This shows
that Data.Hashtable is doing *at least* four times more work that is
needed for this usage pattern. And even with my over specialized hash
table, Haskell is almost 50% slower than OCaml's module H =
Hashtbl.Make(S) (note that I my code uses the same hash function as
OCaml). Unfortunately I cannot submit this optimized hash table entry to
the shootout.

The only mutable data structure that come with GHC besides arrays is
Data.Hashtable, which is not comptetitive with OCaml Hashtbl or DMD's
associative arrays (unless there is something great hidden under
Data.Graph). Is there any hope for GHC 6.6? Does anyone have pointers to
an existing library at all? Perl and Python and Lua also have excellent
built in hashtable capabilities. Where is a good library for Haskell?

-- 
Chris Kuklewicz

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Can I use Haskell for web programming

2006-01-23 Thread Maurício
  I think it would be interesting to ask some professional site to 
install hsp, before I go to the cgi solution. If I want to do that, what 
should I ask them to install to get a full working environment, with 
access to SQL and other stuff?


  Maurício

Niklas Broberg wrote:

hsp can be run in two different modes. Running the full-blown version
with runtime system will probably be hard on a professional site, you
would have to convince them to install hsp. But if you can do without
the fancier bits, in particular application-scoped data, you can run
hsp pages as ordinary cgi scripts. Look in the HSPR.CGI.RunCGI module.

/Niklas

On 1/21/06, Maurício [EMAIL PROTECTED] wrote:


  They both look cool. Do you think I'll be able to find someone to
host professional sites using those libraries?

  [],
  Maurício

Sebastian Sylvan wrote:


On 1/21/06, Maurício [EMAIL PROTECTED] wrote:



 Hi,

 Can I use Haskell to do what people do with, say, PHP? More and more
I have the need for that, and I've been looking into Ruby on Rails. Do
you thing Haskell could be a choice? Of course, I don't need something
exactly like PHP (for instance, I don't care if I can't insert code in
the middle of xhtml pages. If I have to generate everything from Haskell
code, I would probably like it. Also, CGI can be a choice). But I need
reasonable efficiency and to be able to find someone to host my site.
 What solutions do you suggest me?




Take a look at WASH and HSP...

http://www.informatik.uni-freiburg.de/~thiemann/WASH/
http://www.cs.chalmers.se/~d00nibro/hsp/

--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Can I use Haskell for web programming

2006-01-23 Thread Niklas Broberg
Now that would be a treat. :-)
To get it working properly you would first of all need ghc. The you
would need packages hsp with dependencies (haskell-src-exts, harp,
trhsx) and hspr with dependencies (hs-plugins). To get the SQL parts
you probably want to have haskelldb.

I am in the process of making hsp installation easier, there are still
a bunch of rough edges here and there. You can contact me if you want
to try installing, or if you find someone who would be willing to try.
:-)

/Niklas


On 1/23/06, Maurício [EMAIL PROTECTED] wrote:
I think it would be interesting to ask some professional site to
 install hsp, before I go to the cgi solution. If I want to do that, what
 should I ask them to install to get a full working environment, with
 access to SQL and other stuff?

Maurício

 Niklas Broberg wrote:
  hsp can be run in two different modes. Running the full-blown version
  with runtime system will probably be hard on a professional site, you
  would have to convince them to install hsp. But if you can do without
  the fancier bits, in particular application-scoped data, you can run
  hsp pages as ordinary cgi scripts. Look in the HSPR.CGI.RunCGI module.
 
  /Niklas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Guess what ... Tutorial uploaded! :)

2006-01-23 Thread Paul Moore
On 1/22/06, Dmitry Astapov [EMAIL PROTECTED] wrote:
 Recend thread Tutorial upload reminded me of my intentions to write
 haskell tutorial which I suppresend from the times when Hal Daume
 began to write YAHT. Unusually low temperature here (-22C) freed me a
 lot of time this weekend, and the result it here:

 http://www.haskell.org/hawiki/HitchhickersGuideToTheHaskell

 This is a work in progress, plus I'm trying it on C++/Java folk around
 me, so it's bound to be heavily corrected, but main direction could
 already be seen (I hope). If you want - jump on the wagon, and provide
 me with (constructive) criticism, edits on hawiki or anything else you
 see fit.

I like the approach - using real tools to perform sensible tasks. I'm
not a real newbie any more (but hardly an expert!) so I can't really
comment on whether the approach is OK for someone who's never tried
Haskell before, but it looks good to me.

As a specific example, I haven't used Parsec much, and the section on
that is just right - enough details for me to see how I use it, but no
more than that, so I'm encouraged to go and look at the manuals if I
need any extra.

Keep up the good work! (I won't wish any more -22C weather on you, but
I hope you find time to keep going).

Some other sample tasks might be a web service, and database access.
Neither is trivial in Haskell, due to the need to search out the right
libraries, but both are very common real-life jobs.

Paul.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hashtable woes

2006-01-23 Thread Bulat Ziganshin
Hello Chris,

Monday, January 23, 2006, 12:27:53 PM, you wrote:

CK The only mutable data structure that come with GHC besides arrays is
CK Data.Hashtable, which is not comptetitive with OCaml Hashtbl or DMD's
CK associative arrays (unless there is something great hidden 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 something in the IOArray handling, but i
don't understand that is changed. see http://cvs.haskell.org/trac/ghc/ticket/650



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Performance Tuning darcs (a real shootout?)

2006-01-23 Thread Bulat Ziganshin
Hello Jason,

Monday, January 23, 2006, 9:38:02 AM, you wrote:

JD Potentially useful information about darcs;
JD 1) Uses a slightly modified version of FastPackedStrings.

what you mean? afaik, there is no standard FastPackedString
implementation, but there is some library that with minimal
modifications used in darcs, jhc and many other apps

JD still reports large amounts of memory used.  Does ghc use mmap to
JD allocate memory instead of malloc?

afaik, the answer is yes. look at ghc-6.4.1-src\ghc\rts\MBlock.c

JD I'm looking for advice or help in optimizing darcs in this case.  I
JD guess this could be viewed as a challenge for people that felt like  
JD the micro benchmarks of the shootout were unfair to Haskell.  Can we  
JD demonstrate that Haskell provides good performance in the real-world  
JD when working with large files?  Ideally, darcs could easily work with  
JD a patch that is 10GB in size using only a few megs of ram if need be  
JD and doing so in about the time it takes read the file once or twice  
JD and gzip it.

it seems that Ian just used this as memory/time-efficient alternative
for hGetContents. reading from memory-mapped file may be done as pure
computation if the whole file is mapped. is this used in darcs?

if not, then we can map small block at the time or even just use
hGetBuf - at least, for first version. what you will say about this?

JD Just to recap, I'm looking for 1) advice, 2) tips, 3) design ideas,
JD 4) tools, 5) libraries and just about anything else :)

i'll be happy to help, but i'm not ready to study the darcs code. i'm
ready to solve more concrete problems - such as providing new
input mechanism with given external interface or optimizing something
rather small

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Can I use Haskell for web programming

2006-01-23 Thread Björn Bringert
I think the easiest way to achieve that would be to do as Thomas Davie 
suggested earlier and get a virtual server where you can install 
whatever you want.


/Björn

Maurício wrote:
  I think it would be interesting to ask some professional site to 
install hsp, before I go to the cgi solution. If I want to do that, what 
should I ask them to install to get a full working environment, with 
access to SQL and other stuff?


  Maurício

Niklas Broberg wrote:


hsp can be run in two different modes. Running the full-blown version
with runtime system will probably be hard on a professional site, you
would have to convince them to install hsp. But if you can do without
the fancier bits, in particular application-scoped data, you can run
hsp pages as ordinary cgi scripts. Look in the HSPR.CGI.RunCGI module.

/Niklas

On 1/21/06, Maurício [EMAIL PROTECTED] wrote:


  They both look cool. Do you think I'll be able to find someone to
host professional sites using those libraries?

  [],
  Maurício

Sebastian Sylvan wrote:


On 1/21/06, Maurício [EMAIL PROTECTED] wrote:



 Hi,

 Can I use Haskell to do what people do with, say, PHP? More and more
I have the need for that, and I've been looking into Ruby on Rails. Do
you thing Haskell could be a choice? Of course, I don't need something
exactly like PHP (for instance, I don't care if I can't insert code in
the middle of xhtml pages. If I have to generate everything from 
Haskell

code, I would probably like it. Also, CGI can be a choice). But I need
reasonable efficiency and to be able to find someone to host my site.
 What solutions do you suggest me?




Take a look at WASH and HSP...

http://www.informatik.uni-freiburg.de/~thiemann/WASH/
http://www.cs.chalmers.se/~d00nibro/hsp/

--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Hashtable woes

2006-01-23 Thread Simon Marlow

Bulat Ziganshin wrote:

Hello Chris,

Monday, January 23, 2006, 12:27:53 PM, you wrote:

CK The only mutable data structure that come with GHC besides arrays is
CK Data.Hashtable, which is not comptetitive with OCaml Hashtbl or DMD's
CK associative arrays (unless there is something great hidden 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 something in the IOArray handling, but i
don't understand that is changed. see http://cvs.haskell.org/trac/ghc/ticket/650


Much of the GC overhead of Data.Hash should be gone in GHC 6.6.  I also 
have an improved implementation of Data.Hash from Jan-Willem Maessen to 
import, but that will be 6.6 rather than 6.4.2.


Cheers,
Simon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Hashtable woes

2006-01-23 Thread Chris Kuklewicz
Simon Marlow wrote:
 Bulat Ziganshin wrote:
 Hello Chris,

 Monday, January 23, 2006, 12:27:53 PM, you wrote:

 CK The only mutable data structure that come with GHC besides arrays is
 CK Data.Hashtable, which is not comptetitive with OCaml Hashtbl or DMD's
 CK associative arrays (unless there is something great hidden 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 something in the IOArray handling, but i
 don't understand that is changed. see
 http://cvs.haskell.org/trac/ghc/ticket/650
 
 Much of the GC overhead of Data.Hash should be gone in GHC 6.6.  I also
 have an improved implementation of Data.Hash from Jan-Willem Maessen to
 import, but that will be 6.6 rather than 6.4.2.
 
 Cheers,
 Simon

That is good to hear.  The benchmark's tests take 1,250,000 pre-generated
strings as the keys.  At the end, the string keys are 18 characters long, drawn
randomly from a set of 4 characters.  So the hash computations are a nontrivial 
hit.

Using -A400m I get 39s down from 55s.  That is the best Data.HashTable time I
have seen. (Using -A10m and -A100m were a little slower).

Using my over optimized c-code hashtable I get 12.3 seconds.  The associative
arrays in OCaml and D are still faster.  So you see why I long for GHC 6.6.

Is Jan-Willem Maessen's Hash available anywhere?  I could benchmark it.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] Re: Hashtable woes

2006-01-23 Thread Bulat Ziganshin
Hello Chris,

Monday, January 23, 2006, 6:09:15 PM, you wrote:

CK Using -A400m I get 39s down from 55s.  That is the best Data.HashTable time 
I
CK have seen. (Using -A10m and -A100m were a little slower).

1) -A400m is a bit unusual. -H400m for 500-meg machine, -H800m
for 1g computer and so on will be fastest. current GHC doc leaks
explanations in this area, but basically -H just allocates that much
area and then dynamically changes -A after each GC allocating all
available space to the generation-0 memory pool

2) it's better to say that was MUT and GC times in your program, and
even better just to post its output with +RTS -sstderr

please post improved results here. that's really interesting for me,
and for my programs too ;)

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Guess what ... Tutorial uploaded! :)

2006-01-23 Thread Ben Rudiak-Gould

Dmitry Astapov wrote:

http://www.haskell.org/hawiki/HitchhickersGuideToTheHaskell


I like the approach too, but the section on IO actions, which I'm reading 
now, is not correct. It's not true that a - someAction has the effect of 
associating a with someAction, with the actual work deferred until later. 
All of the IO associated with someAction happens at the program point where 
a - someAction appears, whether or not it's needed later. getContents is 
a rare exception to this rule. It works by using unsafeInterleaveIO behind 
the scenes, which muddies Haskell's generally clean semantics and leads to 
odd impure behavior. I wish getContents were a good example of nonstrictness 
or laziness, but I don't think it is.


-- Ben
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe