05.16.07

Beginning Python

Posted in python at 6:15 pm by bmccosar

Today I started Beginning Python by Magnus Lie Hetland.

Every summer, I start a computing project. For example, two years running, I built my own Linux from Scratch systems (I’m in the LFS user database as user 13279). Right now, my main distro is Debian, but the rock solid core LFS system I built, codenamed Gibraltar, is my “rescue partition” — a hardened version of Linux that is responsible for my periodic system backups.

Over the years, I’ve studied many programming languages. I started, many years ago, on TRS-80 Basic; that led to Alcor Pascal. My next computer, a Commodore Amiga, got me into Amiga basic and graphical programming (the Amiga, by the way was years ahead of its competition, and I’ll never understand how IBM became the dominant architecture).

When I shifted to PCs, I left programming for a while — I was stuck with Windows, which is to programming what the Company Store was to mine workers.

Then came the Linux era. Of course that got me into Bash scripting, the C programming language, and eventually Perl. But beyond that core, I tried a few things that were different — Java, Objective Caml, and Prolog, to name a few.

Well, every year I try a big project, and every year I fail. Always there is some problem I call the Achilles Arrow (after all, the heel wasn’t a problem until the arrow struck).

One year I was trying to write a program to create computer generated bass lines for any given chord progression. The problem? No matter how hard I tried, any bass player with more than a month’s experience on the instrument will sound better than any computer. A lot more of it is in the feel and the phrasing than in something as apparently obvious (yet incorrect) as note choice.

Last year, I attempted to write a gigantic solar system gravitational simulation program called Kythera (long story behind the name, but if I told you it had to do with the Antikythera Mechanism, you might be able to piece it together). I used a language called Objective Caml, and everything was fine until I realized the dynamical systems I was using needed something called adaptive precision. This is the ability to use higher resolution calculations when needed, and to use standard resolution when not needed. Simple to say, hard to do. Without this, my equation-of-gravity planetary orbits never worked better than your typical empirical formula.

Also, in every language I’ve tried, GUI programming is a disaster of pointless verbosity. I guess I was spoiled by Amiga Basic.

So here I am, starting a new project this summer, learning Python. Without going into too much detail, I’ll tell you one of my projects is based on musical set theory. If it works out, I’ll say more; otherwise, I’ll just keep my nutbar theories to myself ;-)

I’ve already done a little bit of Python programming, just testing the waters, and so far I like it. It’s easy to read, and has a few stroke-of-genius features I’ll talk about later on.

Leave a Comment