It seems gauche to insult Rails for being bloated, while bragging that you can write your own framework in 43 lines of code -- while using ActionDispatch::Routing::RouteSet, a fairly complicated, very powerful, part of <i>Rails</i> which takes way more than 43 lines to express.<p>(735 lines, not counting any of it's own dependencies inside Rails. <a href="https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/route_set.rb" rel="nofollow">https://github.com/rails/rails/blob/master/actionpack/lib/ac...</a>)<p>Sure, you wrote your own framework in 30 minutes -- by using a part of Rails which many many developer-hours have gone into, over many calendar years. (<a href="https://github.com/rails/rails/commits/master/actionpack/lib/action_dispatch/routing/route_set.rb?page=7" rel="nofollow">https://github.com/rails/rails/commits/master/actionpack/lib...</a> history stops at rails3 four years ago, when they moved the router from one project to another... the actual history goes back further)<p>Rails may arguably be bloated, but as of Rails3 it's also amazingly modular and decoupled, allowing you to use just the parts of it you want. And OP thought the Router was awesome enough to want to reuse it. At least give it the credit it deserves, for that, when you're using Rails to write a framework you say shows how Rails is awful!
The issue is that by the time you bring in an ORM/database migrations, form builder, link builders, asset pipeline, admin panel, etc you have basically hobbled together your own ghetto version of Rails without the vast resources/support that Rails has. One of the benefits of Rails is that it has all of those features mostly baked in - at the cost of some bloat.<p>But my project doesn't need all that, you might say. Well, that's fine, then use something like Sinatra. But I wouldn't build a non-toy web application without the above things.
For what it's worth, I was dissatisfied with most Ruby frameworks (aka. Rails & Sinatra), so when it came time to build up a massive project on a Ruby backend, I rolled my own minimal (<1kloc) Ruby framework.<p><a href="https://github.com/kballenegger/kenji" rel="nofollow">https://github.com/kballenegger/kenji</a><p>I, too, find Rails to be a bloated mess. Here's what I wanted out of my ideal framework:<p>- The "framework" has one single task: providing a DSL for routing requests, and dealing with the HTTP nitty-gritty.<p>- The default would be build for JSON APIs. The return value of routes gets serialized to JSON.<p>- Everything is explicit. No magic.<p>- You can organize you code in simple, maintainable units (files), grouped by functionality. (This is achieved through a tree routing structure, where controllers can pass / forward certain routes to other controllers.<p>- Code can be namespaced, can be tested easily, can be scripted easily. Functionality does not depend on naming conventions.
If you are curious about a roll-your-own article similar to this, but for Python: <a href="http://docs.webob.org/en/latest/do-it-yourself.html" rel="nofollow">http://docs.webob.org/en/latest/do-it-yourself.html</a>