Experimental IRC log happs-2008-07-21

Available formats: content-negotiated html turtle (see SIOC for the vocabulary)

Back to channel and daily index: content-negotiated html turtle

These logs are provided as an experiment in indexing discussions using IRCHub.py, Irc2RDF.hs, and SIOC.

03:34:51<T-Cell>...
03:35:35<stepcut>whee! my hitcounter page only requires 112MB of memory...
03:46:44<T-Cell>What are the advantages of using the HAppS.Server over Network.CGI?
03:54:36<T-Cell>I've been web programming in Haskell (using Network.CGI) for almost a year now. Is there anyone who can provide me with some insight as to how exactly HAppS "handles all aspects of [my] internet apps?"
04:24:24<stepcut>Network.CGI requires you to run another webserver (such as apache), and your cgi application is run as a single-shot application on a per request basis, making
04:24:41<stepcut>HAppS-Server takes the place of the webserver, and requests are handle in a single multithreaded process
04:25:09<stepcut>additionally, if you combine HAppS-Server+HAppS-State, you can eliminate the need for a database server (postgres, mysql, etc), as well
04:25:54<T-Cell>hmm.. Sounds interesting.
04:26:26<stepcut>additionally, the development version of HAppS-State supports multimaster replication and sharding, so that your app can scale up to multiple servers
04:26:47<T-Cell>HAppS seems a bit complex though, and Network.CGI so simple
04:27:31<stepcut>Network.CGI is easier to get started with, but may not provide the power you want for a large scale app.
04:28:24<T-Cell>...After web programming in Haskell for almost a year now, I've concluded that there is almost nothing that can't be done in Network.CGI
04:28:41<stepcut>but, it is not really fair to compare Network.CGI to HAppS. You need to compare Network.CGI+SQL with HAppS for a more equal comparison
04:29:27<stepcut>You absolutely can do everything with Network.CGI. You can also write everything in C too.
04:32:52<stepcut>I don't think HAppS is really anymore complex than Network.CGI + SQL. If anything it is less complex. It is, however, quite unfamiliar, different, and not that well documented. For someone who has done no web development I think it might seem less complex -- provided some good documentation was available
04:34:02<stepcut>you don't have to worry about configuring a separate database, understanding SQL ad table schemas, marshalling your datatypes from Haskell data-types to something that works well in a relation database, etc.
04:34:36<stepcut>Instead you just have some Haskell data types, and few functions in the State or Reader monad, and some magic template haskell calls.
04:35:23<stepcut>HAppS also provides a reasonable way to migrate your old data to a new format when you change your types, providing compile time errors if you forget to update some code.
04:36:02<stepcut>If you update your SQL schema, then you have to figure out how to migrate the data from the old schema to the new schema. And you also have no good compile time way to check that all your SQL queries are still valid with the new schema.
04:37:25<stepcut>HAppS can start simple -- main = simpleHTTP nullConf [ method GET $ ok "hello, world!" ]
04:39:43<Arnia>I have a couple of questions which I feel the examples are unclear about. Firstly, if you have multiple Components, can you use the reified functions on the different bits without writing a single unified data type containing all the state and lifting the functions and re-reifying them?
04:40:31<T-Cell>stepcut, Well I would very much like to get my hands on some good documentation. I'm a sophomore in college and I've been putting together a little website to impress my math professors. My I post a link to my Haskell webapps?
04:40:32<stepcut>Arnia: you want a single transaction that affects multiple components ?
04:40:45<stepcut>T-Cell: sure
04:41:01<T-Cell>http://www.inputyourdata.com
04:41:18<stepcut>T-Cell: I recently wrote two quick start guides on HAppS, but I won't go so far as to call them good documentation, http://nhlab.blogspot.com/
04:42:01<stepcut>T-Cell: looks pretty colo
04:42:05<stepcut>s/colo/cool/
04:42:17<stepcut>though, the cyan on white is a bit hard to read
04:42:27<Arnia>Secondly, how smart is the lifting mechanism? Two parts to this; firstly, if I have a type-class (in my case the DynGraph class from FGL) where all instances also are instances of Serialize then can I just lift the class operations? This would simplify things greatly for me, since I could instantiate the graph operations on the lifted state.
04:43:16<Arnia>Secondly, does the serialisation mechanism work with cells or just with the abstraction so if I make a gross update to a value will it reserialise the entire structure using the function call or just the small component which has been altered
04:43:37<Arnia>(sorry for writing them all out at once, but my blood sugar is a bit low and so I didn't want to forget something)
04:44:01<T-Cell>Colors are easy to fix.. I'd very much like to improve my search engine.
04:44:13<Arnia>stepcut: yes, a single transaction. In particular, I want to keep sessional data out of the graph, but use both in my operations
04:45:24<stepcut>Arnia: as far as I know, HAppS does not serialize the data during each update. It just updates the value in memory and writes the Update to disk.
04:46:21<Arnia>ah, and with regards the smarts of the lifting into the reader/state monads?
04:46:27<stepcut>Arnia: for example, if you have a function, incCounter :: Update HitCounter (), and you do, webUpdate IncCounter. It runs the incCounter function, which updates the value in memory, and records the fact that you call IncCounter to disk.
04:46:53<stepcut>You'll find that you can not do any IO instead a transaction -- meaning they are pure.
04:46:58<Arnia>Ok. I thought that was how it worked, but I wished to check before I made an assumption that cost me a lot of time
04:47:21<stepcut>So, in theory, to recover from disk, you can start with the initial state, and just playback all the transactions that happened to get to the final state.
04:47:34<stepcut>However, that could take a while, so occasionally HAppS checkpoints the state to disk
04:47:54<Arnia>Is there a mechanism to cause a partial roll-back?
04:48:36<stepcut>Arnia: none that I know of -- but I am not an expert on the subject
04:48:38<Arnia>I got interested in using HAppS for my work in part because of the state mechanism; I want to be able to see what the system looked like at a certain time/point (this is for a web-based experiment)
04:49:40<stepcut>Arnia: You will need to poke around in HAppS-State and see what it provides. I think it should be possible, but may require some patches
04:50:38<Arnia>It isn't urgent, just desirable :)
04:51:19<Arnia>If worst comes to worst, I can always just write some functions which filter the relevant data by timestamps stored
04:53:30<Arnia>However, the issue of the interactions of components is more pressing. I have certain data which I want to store in a graph, and other data which I want kept out of the graph (this is for ethical reasons so I can point to my software and say that it is highly unlikely even with a bug that personal information can leak) but I do not wish to have to tightly couple the two parts together
04:54:08<Arnia>So, I want to be able to write my graph bits without any knowledge of the user-login/session bits and vice versa
04:54:18<stepcut>Arnia: not sure how to do that (though I need to know as well)
04:54:42<Arnia>So partly ethics, partly software engineering
04:54:50<Arnia>hm. Ok, thanks though
04:54:53<stepcut>I think you might have to make them separate components, and then make some other component that depends on both of them
04:55:12<stepcut>I might know in a week or two -- but that is probably too late for you ;)
04:55:27<stepcut>do you have session and login code implemented already ?
04:56:05<Arnia>yeah, I can do that. I just couldn't untangle the type system in my head to determine whether that would be enough information to allow GHC to select the correct functions
04:56:09<Arnia>stepcut: not yet
04:56:16<stepcut>one moment
04:56:21<Arnia>ACTION is running heavily behind schedule for various reasons
04:56:45<Arnia>damn PhDs :(
04:56:54<stepcut>you can see if this suits your needs:
04:56:57<stepcut>http://src.seereason.com/happs-logon-example/
04:57:03<stepcut>http://src.seereason.com/HAppS/HAppS-Extra/
04:57:37<stepcut>the logon example depends on some patches that are not in the mainline, but you can just patch the code to fix that. (it's just the validation code, etc)
04:58:05<stepcut>I have implemented some generic session and login stuff. Though it lacks features right now (session expiration, deleting logins, etc)
04:58:43<Arnia>aha. Thank you very much!
04:58:53<stepcut>the example uses happs-hsp-template, but the session and login code it uses does not
04:59:01<stepcut>the actual code is in HAppS-Extra
04:59:05<stepcut>what OS ?
04:59:57<stepcut>feel free to email me if you decide to use it and have questions, etc. the email is in the .cabal
05:00:04<Arnia>atm OS X, but deploying on XP (yes, I'm aware but the deployment choice is forced by those who fund me)
05:00:23<stepcut>ok, just asking because I have .debs for Ubuntu Hardy
05:01:15<stepcut>ACTION goes out for a walk, bbiab
05:02:46<Arnia>Thank you again for your help
05:03:09<stepcut>i do itend to add the missing features this month, btw.
05:04:22<Arnia>That would be great, but it is no hardship if they aren't there
05:05:02<Arnia>(I intend for accounts and sessions to persist indefinitely anyway due to this being an experiment)
05:05:06<T-Cell>Arnia, I like th bird =]
05:05:19<Arnia>T-Cell: hm?
05:06:41<T-Cell>http://seereason.com/bird.html ...from your site
05:06:57<Arnia>oh, that isn't my site
05:07:12<Arnia>This is my site: http://www.dur.ac.uk/j.r.c.geldart/
05:07:45<Arnia>Although it is being redesigned and rethought atm before I apply for post-docs
05:17:58<T-Cell>my assumption.
05:19:53<T-Cell>thanks for that link stepcut. everything helps with HAppS's steep learning curve
08:40:47<Awson>Hi, does anyone know if serialization to (some kind of) Xml is usable in current HAppS?
08:47:30<Awson>AFAIU, it is now abandoned as a State serialization mechanism in favour of Binary. But is there still machinery to more or less mechanically render my data to some kind of XML?

Back to channel and daily index: content-negotiated html turtle