I implemented the server using both frameworks for comparison. Here’s what the code for each looks like, with Bottle on the left and Sinatra on the right (click to enlarge):
The Bottle version of the server is several lines longer and not quite as succinct. While I’m still new to Ruby, there are several things I like better about its syntax than Python’s (e.g., the
.to_i operator, beestings, better handling of “global” variables–settings in this case).
I think Sinatra wins here. What do you think?