Experimenting

I ran across Smisk two days ago and though. "Hmm, someone should write a wsgi adaptor for that".

Maybe an hour after I had that thought, I started working on one. It was pretty easy. Smisk's classes seem to be inspired by WSGI, all the wsgi environment variables had a Smisk equivilent. So the adaptor was basically putting tab A in Slot B and Tab B is slot A, etc.

If you noticed in my del.icio.us feed. I bookmarked Smisk itself and three hours later, I bookmarked my launchpad branch of smisk-wsgi. Pretty cool.

Fifteen hours later across the globe in Sweden, Smisk's project owner Rasmus Anderson, merged my code in with some changes.

So in a total of 3 hours, something went from concept to reality thanks to Python. I don't think the quickness is a testimate to my mad hacking skills. It's really a testimate to Python's agility.

So what is Smisk and why is it cool? Smisk is a low level web framework built in C but controled by Python. Basically it's a fastcgi interface to Python with some really well thought out classes bolted on.

What does the wsgi adapter get you? It basically allows you to expose your wsgi based framework/app (Django, Cherrypy, etc) to fastcgi via C. Now, what does that get you? Well it gets you a faster fastcgi protocol (I think).

Now, I don't have any quantifiable evidence if it's actually faster or not. Rasmus has some performance tests on the Smisk wiki. Logic would say it would be. If it is faster, it's probably in the range of miliseconds, so it's probably not something to lose sleep over. Generally your application slows down due to database performance.

Is the WSGI adaptor compliant? For the most part. I'm doing tests with the wsgiref's validator app. There are some methods that we have to add to smisk's Stream class to make it valid. That means C work, so I have to brush up on my skills, but it shouldn't be long.

I'm currently running this blog on Django on top of Smisk. I found some nasty bugs (causes segfaults on POST) that were in the Stream class, so I wouldn't recomend doing the same until Rasmus merges the changes I sent him.

Will this replace flup as a fastcgi to wsgi adapter? I doubt it at this point, flup has some nice pooling features that would have to be built into Smisk in order for Smisk to have the flexibility of flup. I don't know if those features are in Rasmus' plans for Smisk or not.

Eric Moritz
: django / programming / python / smisk

Comments !