Monthly Archives: May 2006

Ruby on Rails

I’ve been thinking of trying out Ruby on Rails (RoR) for a few weeks now, but finally decided to give it a try. Basically it’s an application server suite based around Ruby. I’d assumed that Ruby was a newish programming language, but was surprised to find out that it’s been around since the early 90s. Only recently has there been a lot of interest in it, and seemingly only really in conjunction with the Rails framework.

Ruby itself is a highly object-oriented language, and although I haven’t seen much of the language itself yet, apparently has similarities to the simple-but-strong features of Python and Ada.

Despite its reputation for simplicity and getting things done quickly, I’d heard that setting RoR up was a little fiddly. Certainly it didn’t seem quite as straightforward a process as the python-based Zope application, but I guess it only took about an hour or so to set up, configure, and write a simple application in Windows. Anyway the following excellent tutorial was really useful for getting started with RoR (although it seemed slightly out of date compared with the setup I’d downloaded): Rolling with Ruby on Rails

Once set up, you quickly realise how model-view-controller are nicely separated in the Rails framework, yet are well integrated. eg. create a db table, and with one simple command line instruction you can create what amounts to a class file which will forever be linked with that table. And I thought PHP was well-integrated with MySQL (Well, it is, but not quite this tightly.)

Hmmm ok so I’m sure there’s a lot more to it than that, but it does look pretty simple to get some kind of a dynamic site up and running very quickly.

Would I use it for anything other than as a toy? Not yet, but then it’s still only on 1.1. For one thing, I’d imagine very few hosting companies would support RoR yet, meaning it’s something you can only really do on a self-maintained server. Another slight drawback for me seems to be its reliance on command-line instructions. Maybe somewhere there’s a gui interface, but otherwise it feels like a pain to have to switch between command line and code views to get anything done. That said, I’m guessing that once you’ve got the basic structure of the site done (with the command-line instructions) you can code/markup away merrily to your heart’s content with very few other command lines.

I guess only time will tell whether this, Zope, or some (currently lacking) PHP application server will emerge as the de facto quickie web developer tool of choice…

Zoped!

Been looking at alternatives to Apache (as part of my now ever-present shourt ou course… anyway I found Zope. It’s a totally different approach to designing and building web pages, based mainly around Python. Well it’s different from anything I’m used to.

It’s essentially an application server, web server, templating system, etc, etc – all in one. Also a curious but attractive language called DTML (document template markup language). Would I put lots of time and effort into learning it to build the kinds of things I already can? Well, just maybe. There are of course other similar all-in-one application servers available – like ruby on rails

Trans Canada Highway

I’ve just ordered BoC’s latest EP Trans Canada Highway from Warp Records. Described as darker and icier than the relatively light, airy, sunny Campfire Headphase – released just a few months ago.

It’s unusual for BoC to release things in such close succession. Of course, leaked versions have been turning up all over the place, some genuine others not. But I really can’t be bothered going through all the hassle of trying to find these leaks. I’d prefer to just listen to the real thing on a CD.

You can always join the boards-of-canada@yahoogroups.com forum for all kinds of talk about the band. Much of it verges on obsession, but it’s generally well-moderated and things rarely get out of hand…

What I don’t like about PHP

I’ve been going over my OU notes, week 3 – web server operation. It’s starting to get a little more interesting, although still only covering general concepts behind web servers such as HTTP headers, multithreading (or not), database connections, MIME types, logging, authentication, path name resolution, modules and plugins, etc.

An interesting point which I’d never really considered before (although I’d heard something about) is thread safety. Apache 2 was developed to be multithreaded – it could pass requests over to different threads rather than forking child processes to deal with each new request. A lot better, but sadly Apache’s (increasing) reliance on PHP as part of the standard LAMP setup has meant Apache 2 has taken off very slowly.

Why should this reliance on PHP be detrimental? Because although the core of PHP is thread-safe, many 3rd party modules are not. Thread-safety basically means that if there are lots of requests going on at the same time for the same code, the system can guarantee that one request won’t affect any variables in such a way that other requests will get errors. This is generally called a race condition. See also the article: What I don’t like about PHP, which itself has some interesting links. Also this

Generally, and as far as I can see for now, thread safety is an uncertain issue in PHP. It can be avoided in general PHP scripts by only using global variables in situations where they’re not going to change (ie constants). But I’m sure there’s more to it than that…

john whitney music box var. 3 – harmonics of 48hz, reversed

Found a site which converts graphics into sound. The following link is one of 13 variations on a theme: whitney music box var. 3 – harmonics of 48hz, reversed

John Whitney Sr was a pioneer in computer animation and computer-generated music. Try these links: official Whitney site; wikipedia

It might be interesting to try something similar, although the only reasonable way I know to do this would either be in Flash (too rusty at that) or python or similar, which would mean learning not just a graphical API but a sound API too. That’s all a bit of a murky area for me at the moment.

gnozu blog on Bloglines

Progressing slowly on my OU server admin course. There always seem to be so many other things to do. For example going to Paris for a couple of days, work, taking photos, this… At the moment I’m trying to learn Python as well as covering some search algorithms in Artificial Intelligence: a modern approach. The book has a website all its own with lots of code samples in Python. I think I’ve just about worked out the python version of a Boggle search space problem. Anyway it’s a good way to actually learn python, as opposed to reading a book about it.
Peter Norvig (one of the authors of AI:a modern approach) has actually written this about the futility of trying to learn a programming language in anything less than 10 years. PHP has only been around for about 7 or 8 in its current form, so…

PS I’ve started another gnozu blog: gnozu blog on Bloglines