Thursday, April 23, 2009

Update and New Direction

Wow, it's been a long time since I last posted.

Anyway, as for my Erlang project, it's working! Not finished, but it does work for small test cases. I still have to work on a couple things, primarily on distributing the application and getting the data on disk, but I'm happy with the results. It handles Ands (+keyword), Ors (keyword), and Nots (-keyword). It may not be the best algorithm, but it does appear to work well. The key thing was the use of mnesia to store and inverted index to store the keywords/document IDs.

Now, since it does work, I decided to start working on learning D for a while. I've also been itching to start since pure functions are now working and I've been wanting to try out threading in it as well. Remember that Perl script I wrote a while ago? I've been wanting to rewrite it in something more efficient and D looked to be the best choice. It handles regular expressions, threads, associative arrays, etc. all build into the language. Also, I really wanted to try out some of the other cool features, such as design by contract and unit testing. I haven't gotten too far, but I'm definitely enjoying it.

The interesting thing I discovered is that creating the unit test caused me to do more design work. You see, I'm going to create a finite state machine to parse a CSV file. Well, the functions for each state will be deterministic and lend themselves to being unit tested very nicely, so I began setting up all of the different states/inputs that I'll be dealing with. During this, I discovered that my initial design was flawed, however instead of going back to the drawing board, I decided to just continue creating the tests. I think it'll work out better because I think about what I'm doing more while working with code.

You know, the more I develop using D and learn about it, the more I like it. I'm really excited about getting to try out threading. So far, I haven't created much functionality, but I'm leveraging D's debugging capabilities, unit testing, pure/nothrow functions, and documentation comments. Having all of this as part of a language instead of add-ons is pretty nice.

Now, as an added incentive for me to get this stuff done, I plan on using this for a goal at work. Hopefully I'll be able to show off what can be done in both languages because they're both pretty damn cool. That, and I'm not a fan of the trend towards becoming a Java/.NET shop. :-(

Labels: , , , , ,


Post a Comment

Links to this post:

Create a Link

<< Home