15 May 2011
For me, as for a whole lot of other people, Rails take about 30 seconds to start-up, regardless of whether it is starting the server, running the tests or firing up the console. For a professional Rails developer this means starring at a black screen and waiting impatiently many times a day and wasting a lot of time. People have been complaining about this on the web, but the answers people give to this seem to be evasive and do not really hit the issue. Turns out there is a really simple reason why the start-up is so slow and the only question remains why this wasn’t fixed a long time ago.
16 December 2009
After using Ruby massively for a few years, I think I have now enough understanding to finally see its main flaw. As a starting point to try to see it too, consider mentally splitting the Ruby language into two parts - “programming part” and “metaprogramming part”. This is of course a fully artificial distinction, as in reality they are closely tangled together, but I find such an attempt a useful experiment.
What I would consider a part of Ruby’s normal programming features are the things programmers who ship end-user applications use everyday - classes, objects, methods, loops, variables etc. The metaprogramming features are what is mostly used by people who build applications for other programmers, but normally not by the “average Joe”, so the techniques behind things like Rails, RSpec, Rake, Rack and other major Ruby frameworks and libraries. Much of the appeal of those projects lies in the elegance of the languages they make available to their users, making it easy to describe solutions to problems the given framework is targeting. The specific features I have in mind are things like metaclasses, instance_eval, class_eval, method_missing, alias_method an so on, all hidden behind an easy to use abstraction layer.
19 April 2008
On this year’s RuPy I gave a talk about Metaprogramming Ruby. Unfortunately I didn’t have the time to prepare the presentation exactly the way I wanted, nor did the organisators gave me enough time to present what I wanted to present. Anyway, I made some changes to the slides, which are now of some value on they own I believe, so I put them here for everybody to enjoy. Things covered include: Ruby’s object model, differencies between instance_eval/class_eval, hooks, reflection, wrapping methods, DSLs, Higher-Order Messanging, getting the parse tree from Ruby code and vice versa, and so on. There is also a nice resources section, where you will find the gems I found across all the available material about the topics covered, and from which I’ve picked up a lot of really interesting meta-ideas. If you find any errors, please let me know, this stuff is really fuzzy, and I really want to have it covered in a clear and precise way.
Despite the quirk with my own presentation, I really enjoyed RuPy as a participiant and I think it’s a great event. Zed Shaw had a really nice presentation, with some funny bits, but also with many things you can pick up and use weeks after the conference ended. I also liked the talk about PyPy by Carl Friedrich Bolz, even through I’m a Ruby guy - they really have some interesting ideas about compiling/interpreting dynamic languages and they made a hell of the effort to push it forward. I hope I will be able to visit Poznań again the next year and I encourage you to do the same too.