About Operating Systems, Abstractions and APIs

Introduction

Charles Petzold, in its book “Code”, states the following:

In theory, application programs are supposed to access the hardware of the computer only through the interfaces provided by the operating system. But many application programmers who dealt with small computer operating systems of the 1970s and early 1980s often bypassed the operating system, particularly in dealing with the video display. Programs that directly wrote bytes into video display memory ran faster than programs that didn’t. Indeed, for some applications – such as those that needed to display graphics on the video display – the operating system was totally inadequate. What many programmers liked most about MS-DOS was that it ‘stayed out of the way’ and let programmers write programs as fast as the hardware allowed.

(Charles Petzold, “Code”, pages 332 & 333)

This paragraph shows the state of things during the MS-DOS & early Windows versions timeframe (from late 1970s until 2000 approximately). During this time, programmers could directly access computer memory, bypassing the APIs offered by the operating system, and thus having total control of the hardware.

This shows two different trends in computer programming, one that respects the functionality offered by the operating system, and another that bypasses it. There are advantages and disadvantages to each approach, and the following paragraphs shows some of them. Continue reading

Updating RubyGems and Rails in Leopard

If you just installed Leopard and the developer tools, you’ll find out that Ruby on Rails is there, ready to be used. But of course, it’s Rails 1.2.3, which is fine, but it turns out that last Friday Rails went 2.0. Not only that, but RubyGems was updated to 0.9.5 lately too… and you’re dying to have everything up and running on your system.

So how to proceed? Follow these instructions:

  1. Open Terminal.app
  2. $ sudo gem update --system
  3. $ sudo gem install rails
  4. $ sudo gem update

If you just do “gem update”, then the current Rails installation will be broken. You must do ‘gem install rails” (which seems odd, because it was already installed, after all). The thing is that since you’ve updated RubyGems with the command 2) above, then you need to re-install Rails. I haven’t tried with other gems, but it could be the same situation for them.

Update, 2007-12-19: Here’s another solution for this problem!

Blog coverage for Paris on Rails 2007

I found the following articles about Paris on Rails 2007:

I will add more links as I find them; and don’t hesitate to add yours in the comment section below!

Paris on Rails: Afternoon

(See the morning report, if you haven’t already)

After the lunch break, these were the highlights of Paris on Rails:

  1. Christophe Porteneuve talked about Prototype, the project where he is one of the core developers, and also author of THE book about Prototype! Great stuff: he explained everything there’s to know about JavaScript bindings (and the Prototype “bind” method); he also gave an excellent overview of the enumeration methods of Prototype (incredible stuff!), the new Response object in the latest version of Prototype, and also a nice talk about event bubbling. JavaScript 2000%!! To sum it up: this guy is a great presenter, very funny and knowledgeable, and his speech is more than worth the trip to Paris!
  2. Sylvain Perez and Guillaume Desrat (president of Ruby France and rubyist since 2002!) enlightened us about how they introduced Rails in RBC Dexia Investor Services making it interact with their SOA, DataWarehouse and backend services, what were the challenges (some), the rewards (many) and the tradeoffs (a few) during that integration. Maybe that “Thought Leader” of James Mc Govern will finally understand that not only Rails is ready for prime time… but it is already used in big “enterprisey” environments!
  3. Alexis Moussine-Pouchkine and Jean-François Arcand gave an extremely interesting talk about JRuby, GlassFish and Java in general, and how Ruby is slowly gaining momentum in the Java world! And Jean-François made it really fun to follow thanks to his nice Canadian accent :)
  4. David Heinemeier Hansson himself direct from Chicago! He talked over the iChat link about all the new features of Rails 2.0, about backward compatibility issues and how to solve them.
  5. Finally, Jean-Michel Garnier from 21croissants (a Barcelona-based RoR company) convinced us that testing is a really important thing to do (which you already knew, by the way, isn’t it?) and how to use RSpec, rcov, CruiseControl.rb, Test::Unit and Selenium in your applications, putting it in context (historically, citing Fred Brooks and Kent Beck, and methodologically, citing Martin Fowler). As Jean-Michel said in his speech, 2008 will be the year of RSpec; and when I look at it, I think he’s right: in RSpec, the spec is the test; the spec is the doc; the doc is the spec. And the other way around, too :)

It is interesting to see some trends in the current Rails landscape:

  • There’s an interesting ongoing debate about IDEs: Aptana (ex-RadRails), NetBeans, Visual Studio or… TextMate?
  • JRuby is available in stable form: there’s a bunch of new opportunities opening right now!
  • Ruby and Rails are both getting the “acceptance status seal” of big companies: it is no longer a “toy” technology.

One thing is fundamentally true: this platform has taken the world as a storm. I’ve first blogged about it in July 2005, and I firmly believe today that any serious software developer should (at least) learn a little bit about it. Rails is here to stay, whether you like it or not. Compare my reports to what happened in Paris on Rails 2006: lots of things have happened in the Rails world, and more are bound to happen in 2008.

All in all, an excellent conference, with around 220 people attending it, from France, Switzerland, Luxembourg, Belgium and even Spain! I’d be happy to talk here next year ;)

Update, 2007-12-11: Peter Sayer, whom I met yesterday in the conference, and shared a few impressions about the current Rails landscape, has published a very good article about it!

Paris on Rails: Morning

The morning sessions of Paris on Rails can be summarized as follows:

  1. An introduction to Ruby and Rails done by Laurent Juillard from nuxos: interesting for those that never used Ruby before, and a good thing to do given the number of people in the room that are new to the platform in general. Otherwise, quite boring for those of us who already use it :) But the right thing to do nevertheless.
  2. A real-life use case of Ruby on Rails, shown by Aurélien Géron from Wifirst: a very interesting explanation of a company that chooses to jump on the Rails wagon, with answers to both the “why” and the “how”. Very funny explanation of how they had to deal with the Pythonistas inside the company who wanted to use Django instead :) The most interesting thing about this talk is the fact that they will release their webmail application as open source!
  3. Yann Lugrin, CTO of Liquid Concept (from Lausanne!) explained about the trouble to “internationalize” a Rails application (particularly about the IMHO biggest problem in Ruby: the lack of direct UTF-8 support!), and how you can use the Globalize plugin to make your sites multi-lingual and multi-cultural. I’m happy I’ve used it to make Parking Friend available in several languages :) Globalize rocks!
  4. Finally, Nicolas Mérouze from Yeastie Mobs talked about HAML as an alternative to ERB as the template language for Rails, and how it compares to other options like Markaby or DRYML or MasterView. Very interesting! HAML seems a little bit “Pythonesque” for my taste :) but that’s my opinion. Nicolas also made an interesting comment about SASS and Blueprint, which I had heard about, but never looked at in detail.

In any case, I still have trouble with the technical names and buzzwords in French :) I’m too used to the English versions! Other than that, a nice first part. Let’s see what comes in the afternoon! Now it’s time to have something to eat :)

Update: Read the afternoon report!

Miopia

Reacción a algunos comentarios debajo de la nota “Gran Bretaña endurece las condiciones de los inmigrantes” en Clarin:

“Deberiamos hacer lo mismo”… “Me parece estupendo”… “Perfecto”… parece mentira lo que se lee en los comentarios. Puede ser que nos estemos encerrando todos? Cada uno en su rincon de mundo, teniendole miedo al otro, haciendole la vida imposible al viajar, al moverse, al tratar de zafar de la miseria por cualquier medio?

No es una cuestion de “seguridad”, no me vengan con eso; es una cuestion de que nos tenemos miedo unos a los otros, y no nos queremos hacer cargo de una verdad muy simple: el bienestar de la pequeñisima fraccion de la humanidad que vive “bien” DEPENDE EXCLUSIVAMENTE de que otros miles de millones no tengan nada de que comer. NADA. Y para no tener que hacerse cargo de esto, nada mejor que una buena aduana y fronteras con alambre de pua y perros policia y detectores de metales y mil cosas por el estilo.

La raza humana debe recordar que estamos de paso en esta Tierra, y que encerrar un par de personas detras de una frontera no ayuda en nada al bienestar del otro. No es mi trabajo de hoy que esta en juego con estas politicas: es el mundo que le dejaremos a nuestros niños. Es increible que seamos tan miopes y ridiculamente miedosos del otro.

Y al que comento que cuando se inunde Gran Bretaña por culpa del recalentamiento global, me gustaria saber que piensa al saber que Buenos Aires tambien quedara abajo del agua (ya se inunda con dos gotas de lluvia, imaginate con un par de icebergs menos, sonaste). Me gustaria ver la cara de los cordobeses, riojanos, mendocinos y patagonicos, cuando millones de porteños tengan que migrar hacia el interior del pais.

Las migraciones son parte de nuestra naturaleza. Evitarlas es algo que ya se intento, que ya no funciono, y que tampoco funcionara esta vez; aun peor, nos llevara a una destruccion total.

(este comentario lo habria puesto entero en la pagina, pero el maximo permitido es de 240 caracteres, asi que por eso lo puse completo aqui)