Beaker - Yet Another Web Server

In the pursuit of learning a new language I picked up Programming in Scala. I had fumbled around the Scala examples and read some of their documents like Scala by Example. I did replicate one of their examples by implementing a Quick Sort. I don't feel it's sufficient to know the language by taking an example they have provided and merely reimplement it, so I've decided to try my hand at a web server from scratch. So far it's been quite fun. At first I figured, "All I have to do is spawn some threads and write to the output stream". Then, my curiosity got the best of me, per the usual, and I thought, what about if I just take the bytes from the files and write those instead of just reading lines from HTML. Then I can support any content types. Obviously just using file extensions wasn't going to be enough for me so I figured I'd integrate mime-util as I've had some good experience with that in Axiom Stack. And, I've been working on a implementing Handlers in the way that allow different handlers to manage different paths. So, now what do I have? I have a functional web server that provides 200, 404, and 500 level response codes. Ultimately I have an experiment that has gone pretty well. To get a feel for whether I was actually headed in the right direction with web servers and Scala I decided to take a peak at the Lift source. While I'm obviously not there yet, it seemed as though I had the right idea in terms of how they thought it should work which is comforting to me (something to keep in mind is that I do have some experience with web servers since I'm an active committer to Axiom Stack). So. While it's great to have a static content web server, that's really just the tip of the tip of the tip of the...stack overflow...iceberg. I'd like to bring this server into a better set of compliance, make it faster, and truly test the "scalability" of the server. I know that it handles me slamming on F5 pretty well but that is the only kind of testing I've really done with it so far. Additionally, I'd like to figure out what it would take to get the distributed requests and such working well within it. I might try to bring in Terracotta for that portion of it. There are a lot of things I'd like to do with Beaker but I just don't know whether it is worth my time to continue to develop the server. We'll all find out together I guess. ;D Also, while all this is great, the biggest reason for doing this is to really get a good personal comparison of Scala and Erlang. While the threading model for Scala is stolen from Erlang, the language similarities essentially stop there. I may try my hand at replicating this server in Erlang at some point.
Media_httpdigitaltumb_vpadp
If you're interested and haven't yet fallen asleep you can grab the source for Beaker on Github. Fork it, hack it, let me know what a noob you think I am. I can handle it. Enjoy. *Update 1* I suck at art. No making fun of the beaker - it's hawt (on second though, maybe I should lace it with bacon...).
Posted
Views | Favorited 0 Times

Comments (0)

Leave a comment...