Epoll Egg Released for Chicken Scheme
Quite a few people suggested I turn the core technology that powers Rooster into a Chicken Egg. Eggs are Chicken Scheme's version of third-party libraries/extensions. Rooster used epoll on Linux by interfacing the C sys/epoll functionality with Chicken Scheme. I spent some time getting feedback in the IRC channel (#chicken on freenode) yesterday and today. I'm happy to announce that I've released a brand new egg that brings epoll support to Chicken Scheme. There are a couple places you can get the epoll egg:
$ git clone git://github.com/davidreynolds/epoll.git$ sudo chicken-install epoll
If you cloned the git repo:
$ cd epoll $ sudo chicken-install epoll.setup
I also rewrote Rooster as a Chicken Scheme module and made it use the epoll egg. I had some difficulty coming up with a good way to return a vector of pairs from C into Scheme. I didn't exactly want to use my old way of calling back into Chicken from C because a user would then have to provide their own Scheme callback. That's basically what I ended up doing, however.
I wrapped C epoll_wait so that it calls into the epoll egg with the vector of pairs. Where this differs from the old Rooster code is that the interface to Chicken epoll-wait that a programmer has access to actually takes a callback function as an argument. This callback function is defined by the programmer and accepts a list of (fd . events) pairs. The epoll egg callback, SCM_epoll_wait_cb converts the vector of pairs into a list of pairs and passes it to the user-defined callback function.
It seems to work pretty well. As for the future of Rooster, I'm considering breaking it into a couple different projects. I'd like to create a web server with the epoll egg. I also need to work on getting some documentation up for the epoll egg and for Rooster.
To the Chicken Scheme Community
Thanks for the great feedback you've been providing and for helping me get my first Chicken Egg released. Hacking on Chicken is pretty neat and it's definitely a great Scheme implementation. I'm looking forward to producing some more eggs and interesting software in Chicken.