Sunday, December 25, 2005

Looking for the ideal mp3 player

Looks like I am on a roll today, third post in a single day ;-). Anyway, I am looking for a flash based mp3 player with the following features. The following are the must have features:
  • Flash based
  • Removable battery
  • 512MB+ capacity
  • USB 2.0
  • FM
  • FM and Voice Recording
The following are nice to have features:
  • Built-in Speaker
  • FM Transmitter
  • Expandable media
  • Color Display
I've been shopping around and narrowed it down to a few choices but can't decide between them. Before I post my choices, any recommendations off hand? Note that the iPod Nano is out of question because it lacks FM and removable battery.

My other favourite scripting language - Lua

Scripting languages like Tcl/Perl/Python/Python can be embedded into a big program written in a traditional language or like extended by writing glue code to existing libraries written in traditional languages. The latter is definitely much easier, especially with a generic tool like SWIG or a specific one like Pyrex. Most Python experts recommend extending rather than embedding.

However, there are times when embedding is more useful. Also, in many commercial settings, it's sometimes impossible to convince management to write the program in a high level language like python. It's far easier to sneak in, I mean embed ;-), a language into a big C/Java program or framework. A language ideally suited for this is lua, for several reasons. The winning points in personal opinion are (in no particular order):

  • Simple API for embedding.
  • Language is quite small.
  • Minimal external dependencies.
Of course, all embedding scenarios will also require extending because the embedded script needs to hook back into the embedding code.

Thursday, December 22, 2005

More on Ruby

I've spent some more time with ruby. I'm not decided yet whether I like it. Perl was my first very high level programming language (unless you count Bourne Shell) and I fell in love with Perl when I learnt it. Even though I've moved on to Python for most of my stuff, Ruby reminds me of some of the nicer aspects of Perl. There's no question that Ruby is definitely a bettern Perl than Perl, at least syntax wise (as far as performance is concerned, Perl is still king).

Ruby syntax quite different from mainstream programming languages like C++/Java/C# because of statement modifiers and all those weird characters. On the other hand, it's object oriented syntax (i.e class definitions etc) is more traditional. There are private and protected methods. However, instance variables are always private and require method accessors (though it's easy to define them). Python is quite different, there is no protection at all at class level. On the other hand, Ruby classes are always "open", so you can just add another public method to access class internals. You can happily add attributes to objects after they've been instantiated in both languages (though ruby syntax is a bit tricky).

Oh, by the way. I didn't like the online book "Programming Ruby" first edition by the Pragmatic Programmers. Personally, I also didn't like "Pragmatic Programmer" very much, I think The Practice of Programming is a much better and lesser hyped book, but I am digressing. Coming back to Ruby, I found Ruby in a Nutshell a better a read.

One aspect of Ruby that I found frustrating is that most existing documentation covers Ruby 1.6 and there doesn't seem to a good changelog between 1.6 and 1.8 or even what's the changelog from 1.8.x to 1.9. Python changelogs on the other hand are very comprehensive and readable. And finally, of the three languages (Perl, Python and Ruby) Python development appears to be moving forward the fastest. Perl 6 is horribly developed and Ruby 2.0 and Ruby VM also seem to be badly delayed. In contrast, python appears to be making steady progress. Even projects like Jython, IronPython and PyPy have a vitality that's lacking in Perl and Ruby development. However, I must admit that Parrot development appears to be picking up recently and at least one Ruby VM, YARV, appears to be moving along quite well.

Monday, December 19, 2005

Starting to learn ruby

I've now started learning ruby in earnest. Why, you may ask? Because it's out there ;-). I made two earlier attempts to start on ruby but didn't really get going. This time I am starting in earnest with the Programming Ruby (1st Edition) book which is conveniently available online. First impressions: Language looks clean - it's definitely more "pure" than Python.

The line noise Perl like syntax (@, @@, #{}) is a distraction, but I can live with it. No bytecode yet. Performance is a bit of a concern. Rite is horribly late (though not as bad as Perl's Parrot). More opinions after I dig in a bit.

Trying out Google Ads

I created a google AdSense account but never really activated it in my blog. I am activating it today to see how this thing works.