Feeds:
Posts
Comments

Posts Tagged ‘programming’

Go

Call me Ishmael.

Over the past few years I’ve rather lost sight of the joys of programming. In fact, the whole business was causing me to grow grim around the mouth. I therefore accounted it high time to learn a new programming language.

I’ve picked Go.

It’s a bit too early to say where that might lead: so far all I’ve done is to run through the introductory tutorial and attend a meetup in a pub. So far, though, it seems quite jolly.

The last exercise in the tutorial involved implementing a parallelized web crawler. I was a bit surprised that the sample solution involved explicit locking, but rather pleased to discover that the trick I used to avoid this in my solution (namely, having a counter for the number of worker threads) isn’t unique to me. (See, e.g. the crawler in Russ Cox’s introduction to the language.)

Read Full Post »

I’ve previously mentioned Rodney Brooks approach to robotics, and also “bottom up” views of knowledge. Here’s a nice quote (from Brian Rotman, Mathematics as Sign, p115):

Brooks’ attachment to the bottom-up procedure is also performative, ruling the description as well as the content of his approach. Thus, not only mind—problem solving, central control, representation—is subordinated within his model of intelligence but also its sociocultural correlates—philosophy, abstract thought, theory—are likewise invoked by him on a minimal, need-to-know basis.

This appeals to me, in part, because it chimes with my views about another form of abstract knowledge that’s central to programming: knowledge of programming languages.
(more…)

Read Full Post »

Kevin Simler’s recent posting on ethics and programming features one of my favourite Brian Kernighan quotes. (I won’t repeat it here, as you can read it there.) This reminded me of another favourite thing: the cover illustration to The Practice of Programming, which features a little dog pointing out the book’s trio of key concepts.
(more…)

Read Full Post »

SDBM

I’ve been a bit slow in my learning of Ruby. This time around I’ve re-written Ozan Yigit’s ndbm clone: sdbm.

I’ve cheated a bit. My general plan has been to pick things up through re-writing bits of existing code in Ruby: but to do them from memory (swotting up if necessary) rather than translate them directly. In this particular case it was convenient (for testing) to ensure that my implementation produced files that were bit-for-bit identical to those produced by the original (as incorporated into Perl). So, to avoid incompatibilities, I wrote down the string hash algorithm and the block sizes used for reading and writing the files. It was only a tiny cheat.

(more…)

Read Full Post »

This is the first step in the Burrows-Wheeler (bzip) compression algorithm. It doesn’t compress anything in itself, but re-orders the characters of the input in such a way that they will then be easy to compress:
(more…)

Read Full Post »

I thought I’d have a crack at learning Ruby. Strictly speaking this isn’t my first encounter, and so my title isn’t quite true, since a few years ago I did work through the “Rolling with Ruby on Rails” tutorial on the O’Reilly site. But as I was just copying and pasting code from a website, that doesn’t really count. (My opinion of Rails at the time was that barring some quibbles about the JSP-like HTML generation it seemed to be very good for the sort of thing it was aimed at, but that I was very happy not to be doing that sort of thing for a living.)

I’ve decided not to learn the language by buying a book or working through tutorials or suchlike. Instead, the plan is just to re-write tiny programs that I find interesting for any reason, relying on nothing much but whatever online reference documentation I can find together with my acquaintance with Perl and Python. This isn’t likely to be the best way of learning, but I want to see how far I can get with it.

(more…)

Read Full Post »