--- Log opened Tue Apr 07 00:00:08 2009
10:33 < h_buildbot> Build for ghc-6.8.3 OK. Test suite ran. 14/77 test cases failed. Check http://buildbot.happstack.com/ for details.
10:40 < h_buildbot> Build for ghc-6.10.1 OK. Test suite ran. 15/77 test cases failed. Check http://buildbot.happstack.com/ for details.
11:02 < mightybyte> http://softwaresimply.blogspot.com/2009/04/basic-happstack-blog-app.html
11:12 < wchogg> mightybyte : Heh, I was just writing some examples of using Happstack.Auth myself.
11:15 < wchogg> mightybyte : Is it correct to make AuthState a dependency of whatever application state you have that may include additional data, such as user profiles?  Is that what you intended?
11:15 < mightybyte> Yes
11:15 < wchogg> Okay, cool.
11:16 < mightybyte> I'm just about finished writing another post that takes this simple blog app with no authentication and outlines the process of adding auth.
11:16 < mightybyte> I'll post it tomorrow.
11:16 < wchogg> Ah, that soon.  Cool.
11:16 < mightybyte> And the source code will actually be in the happstack-auth github repository sooner.
11:17 < wchogg> I might want to make happstack-tutorial use Happstack.Auth.  That might simplify things a bit, as it's currently spaghetti.
11:17 < mightybyte> Great
11:18 < mightybyte> After Happstack.Auth matures a bit, it may be more natural to include it with happstack.
11:19 < mightybyte> If people want to do that, it's fine with me.
12:53 < mightybyte> wchogg: The code for my example with auth functionality is in the happstack-auth github repo now.
13:01 < mightybyte> I'll post an annotated description of the modifications on my blog tomorrow.
13:15 < wchogg> Cool, thanks.
14:53 < h_buildbot> Build for ghc-6.8.3 OK. Test suite ran. 15/77 test cases failed. Check http://buildbot.happstack.com/ for details.
14:59 < h_buildbot> Build for ghc-6.10.1 OK. Test suite ran. 15/77 test cases failed. Check http://buildbot.happstack.com/ for details.
16:22 < McManiaC> hi, what is the "statefile"?
16:25 < wchogg> I'm not sure what you mean, sorry.
16:26 < McManiaC> well, one of happs "disadvantages" seems to be, that the state file is kept in memory instead of writing it on disk
16:26 < McManiaC> so whats that state?
16:26 < McManiaC> sorry, really stupid questeion probably :)
16:32 < stepcut> McManiaC: in happstack, your state is just some arbitrary haskell data structures defined by you that contain whatever data you want for your application. It is transparently backed up to disk so that you can restore if you need to restart the web service. Also, similar mechanims are used to support multimaster, in case you can't serve all your needs on one machine
16:33 < stepcut> McManiaC: if you look at sites like facebook, they have thousands of memcached servers with terabytes of RAM just to cache database results in memory, because the disk is just too slow.
16:33 < stepcut> McManiaC: the advantage of happstack is simplicity -- instead of trying to fine tune caches and queries so that the right stuff happens to get cached, just keep everything in RAM to start with.
16:34 < stepcut> simple == cheaper, faster, better :)
16:35 < stepcut> McManiaC:  http://www.infoq.com/presentations/Facebook-Software-Stack
16:35 < McManiaC> so all my databases etc are stored in ram, but if a lot of ppl request stuff from it, it reacts faster because it doesnt have to look for it?
16:36 < stepcut> McManiaC: yep. RAM is around 100x faster than disk.
16:38 < gwern> stepcut: what happens when one's data doesn't fit in ram?
16:39 < stepcut> McManiaC: if you study the architectures of big sites like amazon, facebook, ebay, etc, you will learn that they don't use SQL databases the way you are 'supposed' to. Typically they don't use an transactions, etc. At facebook, for the most part, the tables are all just two field, key/value pairs. aka, giant hash tables. And they don't use stored procedures or even *joins* because it does not scale. Instead they use memcached t
16:39 < stepcut> the query results, and then do the joins, etc, in post using PHP.
16:39 < stepcut> gwern: three options. Buy more RAM, using sharding to split across multiple machines, or explicitly store stuff to disk based on the particular access patterns of your site.
16:40 < gwern> sounds painful
16:40 < stepcut> gwern: buying RAM is not that painful.
16:40 < stepcut> gwern: easy to buy a machine with 32GB.
16:41 < gwern> not very friendly to say students
16:41 < stepcut> gwern: well, happstack has never been focused on students
16:41 < gwern> and doesn't seem very flexible
16:41 < gwern> students shouldn't try to run, say, gitit?
16:42 < stepcut> gwern: because if happstacks flexibility, it is quite possible to do things like use sql, fastcgi, etc. But HAppS and happstack have always been focused on scaling big.
16:44 < McManiaC> so what exactly is "state"? only the databases?
16:45 < stepcut> gwern: even for smallish sites, happstack is a boon for business. If you can get by with one less employee because instead of having a web server machine, a memcached machine, a SQL machine, etc. You can easily save $100,000 / year -- which buys a lot of RAM.
16:46 < gwern> and how do we know happstack really makes an employee redundant?
16:47 < stepcut> gwern: we don't
16:49 < stepcut> McManiaC: yes. Though, it is not really a database per se, just some plain old Haskell data structures. That is one advantage of happstack. Instead of having to take your fancy haskell data structures (trees, etc,) and writing a bunch of code to marshall them in and out of SQL databases, you just write Haskell datatypes and functions that process them. So, now you have one less language to worry about (no SQL, just Haskell), an
16:49 < stepcut> worries about SQL inject, or whether your code for store trees in a database is bug-free, etc.
16:49 < wchogg> gwern : I think part of the assumption for using Happstack is that if you need more than a few GB of state, then you are probably running a pretty successful enterprise.
16:50 < wchogg> gwern : You can question how valid that is, but I think it's _fairly_ pragmatic.
16:51 < gwern> mm. well, we haven't heard anyone complaining about it yet, have we?
16:51 < McManiaC> hmmmm
16:53 < gwern> I suppose most examples are either large sites or file-based ie. I could get a few gigs in a gitit wiki pretty easily, but then gitit would be serving up files, and not actual state
16:53 < stepcut> gwern: right. gitit stores the files statically in darcs. The state would be things like user accounts, statistics, etc. (I am guessing)
16:54 < McManiaC> so happs replaces both, a scripting language like php and a databse like mysql?
16:55 < gwern> I suppose so
16:55 < stepcut> gwern: anyway, if you watch presentations like that facebook one, you will find out that LAMP/SQL/transactions/etc, fall apart when you try to scale up, and so they end up implementing a poor version of happstack. As you get bigger, you *want* to encode into you program what should be in RAM, and what should be on disk, and not be trying to fiddle with SQL settings to get it to guess the right answer.
16:56 < gwern> McManiaC: if by 'replace' you mean 'happs writes a bunch of functions and types which let you do the same kind of stuff in the single language haskell'
16:56 < McManiaC> yes gwern
16:56 < McManiaC> :)
16:56 < stepcut> McManiaC: yep. You get to write everything in one language.
16:57 < stepcut> McManiaC: and you get to use whatever datatypes you want -- you don't have to try to shoehorn everything into a relational model.
16:58 < McManiaC> ok
16:58 < McManiaC> that sounds pretty interesting :)
16:58 < stepcut> McManiaC: but you still get ACID, replication, sharding, and other things that people like about SQL databases.
16:59 < McManiaC> ive been using php + mysql the last few months and im actually still pretty new to haskell, but i doubt i will ever reach those multi-TB-server websites with my little project...
16:59 < McManiaC> :D
16:59 < McManiaC> just taking a look at whats possible
16:59 < stepcut> McManiaC: maybe you need better marketing?
17:00 < stepcut> McManiaC: i mean, facebook was just some site a few college kids hacked up in their dorm room over a weekend
17:00 < stepcut> in PHP no less ;)
17:00 < McManiaC> :)
17:00 < stepcut> though they do use Haskell somewhere at Facebook.
17:01 < McManiaC> its more of a playground for me, to test haskell, maybe write on or two tools in it
17:01 < stepcut> all of the languages they accept for this challange are ones that are used somewhere at facebook, http://www.facebook.com/careers/puzzles.php
17:02 < McManiaC> nothing big realy, i doubt marketing will be a topic any time soon
17:02 < McManiaC> :D
17:04 < stepcut> I think goes with out saying that no marketing results in 'nothing big really' ;)
17:05 < McManiaC> yes of course
17:05 < McManiaC> ;)
17:09 < McManiaC> hmmm those puzzles seem pretty simple in haskell
17:09 < McManiaC> or am i wrong
17:09 < McManiaC> :D
17:09 < stepcut> McManiaC: yeah -- you get graded for style too I think
17:10 < McManiaC> ok
17:10 < stepcut> McManiaC: though, I got stuck on the first one. I was writing an explanation of why you should do, | n `mod` 15 == 0
17:10 < stepcut> because Haskell rocks like that.
17:11 < McManiaC> haha
17:12 < McManiaC> even the last one only seems to me like a combination of (un)words and (un)lines
17:14 < stepcut> McManiaC: the facebull one? I only scanned it but I assumed it was a dynamic programming problem
21:41 < performance> hi mightybyte
21:41 < mightybyte> Hi
21:41 < performance> i did not understand the version adn serialize parts of the new blog code you put up
21:41 < performance> i followed the link, and got more monfused :D
21:42 < mightybyte> Yeah
21:42 < performance> confused
21:42 < mightybyte> For a long time I didn't even try to understand it.
21:43 < performance> i have a request for you, could you make an example with a real database, like sqlite etc..
21:43 < mightybyte> I still don't bother trying to understand the details of serialization.
21:43 < mightybyte> Hmmm, probably not.
21:43 < mightybyte> I try to avoid real databases as much as possible.
21:43 < wchogg> You mean use happstack-server but not happstack-state?
21:43 < performance> why ?
21:44 < performance> hi creighton, happstutorial depends on unix2.3.2  so i could not cabal install it on vista
21:44 < performance> using HDBC or something like that..
21:44 < mightybyte> I prefer the happstack approach where I have direct access to my data in the programming language.
21:44 < wchogg> performance : I know, unfortunately the tutorial has the same problem happstack is having right now:  FileManip depends on unix.
21:45 < wchogg> performance : I'm going to try and see if I can remove that dependency soon.
21:45 < performance> i got happstack working on vista
21:45 < wchogg> performance : The current darcs version?  That's the one having problems.
21:45 < performance> 2.1
21:45 < wchogg> Ah, yeah, that works fine with Windows.
21:46 < wchogg> It's 3 that's having some problems because of another library that only builds on *nix.
21:46 < performance> it was very painful, i had to install MSYS and MingW and cheat by creating a Haskell folder in Program Files
21:47 < performance> mightybyte: but the database + its interface is just another way to serialize/ marshall data right?  [ agreed it might enforce some limitation ]
21:48 < mightybyte> Yes, but it imposes more overhead on the programmer.
21:48 < mightybyte> (not just in terms of performance)
21:48 < performance> wchogg:  despite indicating cabal install --prefix=c:\sth happstack, it insisted on putting some stuff in Program Files\Haskell
21:49 < performance> but then it becomes easy to understand how to use Happstack and then appreciate being able to break those shackles
21:49 < mightybyte> I'm not saying there is no place for databases.  Just that I prefer happstack's in-memory approach.
21:50 < performance> but for a tutorial, i beleive atleast a simple example like your blog example using dbs would be very helpful
21:50 < mightybyte> Yeah, it probably would.  But I just don't have the time for that.
21:51 < mightybyte> The tutorial's that I'm doing directly apply to the other work I'm doing in Happstack.
21:51 < performance> :) if you can assume that im an absolute beginner with a few hours per week at hand,  would you have time to help me do that?
21:51 < performance> you == creighton + mightybyte+ any one else :)
21:52 < mightybyte> Unfortunately I can't.
21:52 < performance> uhoh, one down infinite to go :D
21:52 < mightybyte> Sorry.
21:53 < performance> why do you apologize, you are already doing a great help providing the examples you are :)
21:53 < mightybyte> I'd love to...but until I find a company willing to pay me to work full-time on happstack I just can't.
21:55 < performance> :) i'd love it if some one paid me to learn
21:56 < mightybyte> You and me both.
21:57 < wchogg> That's why I'm going back to grad school.  Closest thing to it. :p
21:59 < performance> wchogg: which school ?
22:07 < sm> hi performance
22:07 < sm> matthew was asking about your install problems on the mail list
22:07 < sm> he's mae here
22:15 < performance> hi sm
22:15 < performance> @seen mae
23:42 < performance> has any one installed HDBC-sqlite3 on vista?
--- Log closed Wed Apr 08 00:00:10 2009