Parsing OPML in Squeak

I started writing an OPML parser in Smalltalk using Squeak and YAXO this weekend. At the risk of sounding like a Squeak/Smalltalk fanboy, I was once again left with a warm afterglow. I had a blast and I was able to write most of it in a couple of hours. The only part that I have unfinished is taking an RFC822 date and parsing it into an internal date. (Anyone have Smalltalk code? Anyone?)

I decided to write an OPML parser because I:
  1. Wanted to play more with Smalltalk.
  2. Wanted to play with parsing XML in Smalltalk.
  3. Had written an OPML parser in Common Lisp and wanted to compare.

So, I hate to say it, but I like my Smalltalk version better than my Common Lisp version. When I compare the code between the two, the Smalltalk version is much easier to follow. I think the key difference is that in Smalltalk I focused on the data structures (objects) and not on the algorithms (parsing and populating). Even though I used an XML parser in both languages (XMLS for Lisp), in Lisp there's alot of code around populating my object model. Not sure why the difference. Maybe the slot accessor syntax vs. method syntax?

Does this mean I love Smalltalk more than Lisp. No. But, I think it means I'm starting to love them both.

No comments: