New semester, new software
Aug 24, 2008       1:09 am

I've fallen quite easily back into the routine of the school semester. It's probably because I didn't take any time off between semesters, so I didn't have any time to develop that supreme lethargy that comes from having nothing to do for a week or more. I just woke up a bit later on Monday, and walked past the office a few hundred yards to campus.

I'm been having fun with some new software this past week.

LaTex + graphviz

Languages & Computation assignments all need to be done in LaTex, presumably because no one wants to grade the usual half-legible proofs that students turn in for homework. I can't imagine why I've never used LaTex before. It produces some nice looking documents, and is especially great for math. It's quite easy to learn - I picked up the syntax a few days ago while drinking (just to verify that my math skills still work with booze).

This assignment involves a ton of state machine diagrams. LaTex isn't natively up to that task, but thankfully there's graphviz. This marvellous application generates an image based on a textual description of a graph. There's also a nifty utility called dot2tex, which runs graphviz and outputs a tex source file.

So I have around 30 graph files that need to be built and included in this document. LaTex has the \input command which includes the generated .tex files, so to put it all together, I just need to run dot2tex on each of the graphs, copy everything into one directory, and run latex on the main document. This is easily achieved with a Makefile. It may be a bit overkill to have a build process for a weekly homework assignment — but (as is the case with most linux tasks) now that I'm used it, the whole process is quite efficient.

Ruby

I've also started to poke around with Ruby, because that's what all the cool kids are writing these days. It seems to be exactly the language I've been looking for.

Reading the Ruby documentation convinces me that this is exactly what I would make if I were to design a language.

  • I'm really starting to feel more constrained than assisted by Java these days. My experience with strong typing has become rather disillusioning; it's mostly more trouble than it's worth.
  • Working with javascript has made me appreciate functional programming constructs. I ended up looking at Ruby because I started going back to PHP, and was immediately frustrated by the lack of anonymous functions.
  • I appreciated the idea behind Smalltalk when I took Objects & Design, but found the implementation entirely impractical. It's very clear that Ruby takes a lot of inspiration from the good theoretical points behind Smalltalk, but takes a much more pragmatic approach.
  • A lot of my language discussion recently has dealt with the problem of wanting some sort of quasi multiple inheritance. Ruby has the mixin concept, which seems to be the perfect solution I've been looking for.

I haven't actually started writing any Ruby code yet, so my praises may be premature. But I have a feeling I'll end up writing a longer article later extolling Ruby's virtues. It feels like someone was listening to me bitch about languages for the past year, and then made this for me. I plan on rewriting the blog again to ditch this PHP junk, so we'll see what Ruby can do.

new comment >