Jerith online [entries|archive|friends|userinfo]
jerith

[ website | jerith.za.net ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Ubuntu, Erlang and Launchpad [Jan. 31st, 2009|05:11 pm]
[Tags|, , , ]

Ubuntu Hardy has an old version of Erlang. Ordinarily this wouldn't be a problem, but it turns out that R12B (the current release) added a few libraries that I use in my Project Euler solutions. Upgrading to Intrepid isn't really something I want to do at the moment (for reasons that I'll happily discuss over a beer) and language interpreters don't get backported.

This left me with two options: Rewrite my code to not use the new regular expression library and the not-quite-an-array data structure that Hardy's version of Ubuntu lacks or build and install a modern Erlang from source. Fortunately, a little investigation turned up a third: Launchpad's Personal Package Archives.

I was surprised at easy it is to rebuild a deb source package and get it into Launchpad's build system. Since I didn't have to make any changes, it was merely a matter of downloading the source files from Intrepid's Launchpad page, adding a changelog entry to get my own version number and email address (for pgp signing) in there and running a couple of commands to build and upload the new source package.

There are a couple of caveats to adding packages to a PPA, though. It's generally a good idea to at least build and test the binaries locally before uploading. Not only is this polite (in that you're less likely to tie up shared build resources with broken code), it also saves time waiting around for builds to be scheduled only to discover that they're broken. In addition, there's a bit of a lag between Launchpad claiming that a build is complete and the binaries actually being available. In particular, it took quite a while for launchpad to make my i386 packages (which includes all the architecture-independent stuff) available despite announcing a successful build in the web interface.

All in all, I'm very impressed with PPAs. In half an afternoon, I have managed to add custom (sort of) versions of several packages to my PPA and install them on my local machine. Not only that, but they're available for anyone who wants to use them with no extra effort on my part.
LinkLeave a comment

Houses and hacking [Oct. 7th, 2007|04:11 pm]
[Tags|, , , , ]

As of this afternoon, I have the keys to my new (temporary) residence in Observatory. It has two spare bedrooms, so if you want to visit me in Cape Town, do it before the end of January. :-)

I have been playing with Project Euler quite a bit recently. It's a fun little project where they give you a bunch of short mathematical programming problems. Most of the problems are less than an hour's work to solve, although there are a few that take longer. I've been using them to get some Erlang experience, and you can find my solutions in a darcs repository at http://darcs.jerith.za.net/projecteuler/ or you can grab projecteuler.erl directly.
LinkLeave a comment

Happy hacking [Aug. 19th, 2007|06:22 pm]
[Tags|, , , , , ]

I wrote a satisfying amount of Python this weekend. I am currently in the throes of rewriting bits of my website backend, and one of the things I'm replacing is the syntax highlighting code. The present system shells out to vim and munges the HTML it gets back into a useful form. The new plan is to use pygments, a python syntax highlighting library. The problem with pygments is that it doesn't handle all the languages I want to display.

One of these languages is Erlang, which I have a tendency to wax enthusiastic about. Since there are unlikely to be too many other people who want to highlight it in a Python library (although Haskell's there, so maybe not) I decided it would be worth the effort of writing a lexer for it. This was easier said than done, however. The vim and emacs syntax files were both slightly broken (I'll be looking at them next) so I ended up doing a lot of the work by referring to the docs and experimenting with the interpreter.

Along the way, I ran into an issue with the Java lexer. Some badly formatted code tickled a pathological case in one of the regular expressions and took exponential time in the length of an exception class name. Anything longer than about 24 characters (which includes a lot of Java's standard exceptions) and the lexer would never come back. This was resolved with the help of the people on #pocoo (pocoo is pygments' parent project) and ended up in a simplification of and fix to the Java and C# lexers.

Anyways, I've submitted the patch for the Erlang lexer and I'll see if it gets into trunk. It was a fun experience, combining two of my favourite languages.
Link1 comment|Leave a comment

I made reddit! [Mar. 16th, 2007|12:56 pm]
[Tags|, , ]

It seems someone over on the erlang-questions mailing list liked my socket programming tutorial enough that they posted it to the programming subreddit.

It seems to have peaked at 8 (yay single digits!) but I'm still rather pleased with myself that I got noticed.

My referrer logs also point at some other sources:
Link7 comments|Leave a comment

Bogochat and Erlang hacking [Mar. 10th, 2007|08:32 pm]
[Tags|, , ]

I spent a large part of today sitting in bed with the laptop playing with Erlang. The result can be seen on my website.

It took a few iterations to get this far, and the experience was incredibly enlightening. When I have time and my brain isn't so tired (tomorrow, perhaps) I'll write up a proper tutorial running through the same steps my vaguely directed hacking took.
LinkLeave a comment

Erlang and online games [Jan. 11th, 2007|06:04 pm]
[Tags|, , , , ]

Taken verbatim from an email I sent to a programmer's mailing list I'm on:

I have decided that the only way for me to finally get around to
learning Erlang is to write a nontrivial project in it.  To this end, I
have decided to implement a multiplayer online game of some kind.

I'm only really interested in the Erlang backend, so I'm thinking a
text-based MUD of some kind that players can telnet to, but if someone
wants to write a graphical client or something that's also good.  A
frontend can be in any language/platform combination as long as I can
run it in Linux for testing.

I could probably do the whole backend thing myself given enough time,
but collaborators make things easier and more fun, especially to bounce
ideas off and discuss bits of code.  This is a learning project, so I'm
not expecting anyone to know Erlang at all before they join.

Also, people interested in the game design and worldbuilding aspect are
welcome to help out in just those areas without having to write any
code.


The offer stands here as well. Tell your friends, the more the merrier!
Link5 comments|Leave a comment

navigation
[ viewing | most recent entries ]

Advertisement