jump to navigation

Programming & the Tower of Babel 31 May 2008

Posted by Oliver Mason in programming.
add a comment

I’m having a problem with languages. Not that there is something I cannot do in my favourite language, but rather that there are distinct ecosystems for various languages, and they are usually fairly exclusive. For example, in order to program in a web context you need either PHP, or alternatively be prepared to run your own server if you want to use Java or Erlang. I’m not talking about businesses or commercial operations here, just the private/academic/small scale non-funded project range.

Most of the language processing software I’ve written is in Java, because it works well and can run almost everywhere (but not on shared webhosts). It’s useful to distribute applications, as people can use it on Linux, Macs and even Windows. But I’ve now pretty much switched to Erlang, as I put high hopes on the future of parallel programming, and I want my software to take advantage of multi-core processors. However, Erlang programs are not as easily shared and distributed as Java apps are. Problem.

Ideally I’d like to write all my programs only once. This was kind of the promise of Java, and it worked mostly. At some point I even considered working on an interpreter for JVM bytecode written in PHP (so that my Java classes would work without having to be re-coded in PHP itself), but aside from the possibly terrible performance it seemed too daunting a project. Maybe Erlang could be compiled into JVM bytecodes? Of course you’d lose all the concurrency features etc, but at least you could deploy it together with a Java app. A bit like Scala, almost.

If PHP wasn’t such a ghastly language I’d be happy to code everything in that, but it seems too much of a sacrifice. But for most purposes I would need at least those three:

  • Java for applications to be deployed to other people
  • PHP for stuff running on shared webservers
  • Erlang for research and cutting-edge stuff

And there is little to no common ground between them. Sigh.


Power supply woes 9 May 2008

Posted by Oliver Mason in Apple.
add a comment

Yesterday the power supply of my MacBook started playing up; intermittently it would stop either charging the battery, or would come up as disconnected (ie fail completely). The cable from the brick to the laptop is rather ‘molten’ near the brick-end, and by bending it and winding it around the two fold-out hooks I could get it to remain stable. But today it suddenly looks brown as well–it obviously can’t cope with the heat.

On the web I’ve read that the power supply (which provides 60W) was originally designed for 50W only, which would explain why it gets so hot, and why lots of other people have had problems. With my Sony Vaio I never had any issues with the power supply, apart from the plug becoming wobbly after the kids ran into the cable a couple of times (which is an advantage of the MagSafe plug!).

I also read a recommendation to use a MacBook Pro supply, which has a 85W rating. This is supposed to remain cooler. So when I noticed the alarmingly brown/black cable I went straight to the local Apple Store in town and asked for one of those. But the ‘geniuses’ said it would mess up the battery by overcharging it, so I went for a 60W model again to be on the safe side. Of course my MacBook is 22 months old and beyond warranty, so I had to shell out the £60 for the new power brick. The genius also said “this should not happen”, and looked at me as if I had submitted the cable to a barbecue or something. However, I never even wound it up on the hooks, as the cable seems so feeble. Stylish looks, but rather impractical. I’ll have to think of some cooling solution, I guess.

I’ve kept the dodgy supply to repair the cable at some point, and when I do so I’ll post some photos here. One thing that I find amazing is how grubby the cable looks after almost two years of constant use.