I think my stress over the launch of my first 'real' site has reached its peak and is now heading down. I hope. I wanted to use something like CouchDB or Mongo, but the site is 100% Haskell and, well, call me lazy but I figured I had enough to deal with with my junior-to-intermediate Haskell knowledge without throwing in a db that I hadn't used before for 'serious work'.
There are a few troubled spots in the code but, even with them, the site is very fast. Adding new functionality or even upper-level logic is very straightforward.
I'm no blogger. I really only post things when I think I might want to come back and relive my state of mind either for academic purposes or just for reminiscing, but I think a post about my experience writing a substantial web site (hopefully) serving a respectable amount of traffic might be of interest to more people than myself.
Then again, the site might blow up in my face like a high school science experiment. Time will tell.
L2M Logistics
Haskell, haskell, haskell, haskell, mushroom, mushroom.
We are go for launch
Local hackage mirror
Well, again, sort of.
RWC Release
Actually, it's more like "I wonder if these binaries work on other machines?".
Get your data directory here
Pick a binary for your particular system:
Linux x86_64
Mac OS X 10.5
Now drop the binary into the data directory and run the binary through a terminal or however you choose - just make sure that the cwd when you run it is the top of the data directory. Finally, go to http://localhost:8081/ and poke around.
There are two pretty big bugs that will most likely make it so you won't want to use this particular release as an everyday client.
1. There's no direct message support yet.
2. This facebook handling in this particular release is disabled because it's amazingly broken. I'll fix it by the next release.
Oh, there's a little hidden menu if you click an avatar for marking all messages from that user as read, and... one more thing that I can't remember. I'm going to write some docs one of these days, I swear.
Curiously Parallel
Well, not really, but sort of.
Take this code from http://cgi.cse.unsw.edu.au/~dons/blog/2007/11/29
Now, compiling it with no optimization, I get the following:
ghc --make fib.hs
time ./fib
real 5m50.175s
user 5m48.994s
sys 0m0.737s
ghc --make fib.hs -O2
time ./fib
real 5m48.966s
user 5m48.374s
sys 0m0.460s
Now with this code:
ghc --make -O2 -threaded
time ./pfib (Note the lack of RTS switches)
real 2m33.192s
user 2m32.883s
sys 0m0.173s
time ./pfib +RTS -N2
real 1m44.426s
user 2m38.416s
sys 0m1.587s
time ./pfib +RTS -N6 (It's an 8-core i7. Well, 8 thread? Does it actually do hyperthreading? I don't know)
real 1m24.359s
user 3m16.734s
sys 0m12.852s
Now with the optimized code
ghc --make -O2 -threaded sfib.hs
time ./sfib
real 1m3.752s
user 1m3.613s
sys 0m0.097s
time ./sfib +RTS -N2
real 0m33.545s
user 1m4.122s
sys 0m0.343s
time ./sfib +RTS -N4
real 0m17.462s
user 1m3.783s
sys 0m0.450s
time ./sfib +RTS -N6
real 0m16.076s
user 1m23.578s
sys 0m0.773s
time ./sfib +RTS -N8
real 11m55.785s
user 79m21.816s
sys 0m5.523s
Heh, for the first time since I bought the machine I heard the internal fans spin up to jet engine speeds.
Hrm, according to wikipedia, the processor is 4x but the Linux kernel sees 8. So it's 4 cores + hyperthreading or something? To be honest, I really don't care. It's fast enough to keep me entertained for quite a while.