Tuesday, September 30, 2008

API-based queries

I'm a big fan of API-based queries. Even though I really appreciate query languages (e.g. SQL), the impedance mismatch of using them inside your favorite programming language is too high, even more when you're dealing with dynamically generated queries. So much string manipulation is really error-prone.

So I really like approaches such as Lucene's or Hibernate Criteria API. However, API-based approaches are normally low-priority (above all when dealing with SQL), so standards like JPA doesn't even have such an API and in Hibernate it is far more limiting than HQL, and issues like this are real showstoppers.

Update: typo

Sunday, September 7, 2008

Types and Programming Languages

Putting my money where my mouth is, in my last order to amazon (dollar is still cheap) I got Pierce's Types and Programming Languages, after having it in my wish list for a long time.

I expect it to be a long read, as it is pretty long and dense. In any case, even though it is quite academical, I'm sure it'll be eye-opening. Stay tuned.

Refactoring lucis...

These days I've been spending a little time refactoring lucis. In these early stages of development, the public API is being continuosly changing, as I look for better ways to provide the intended service.

Through this process, I've faced what I think is one of the most difficult problems in computer science: naming things.

In this case, there are some classes that deserve names already used by Lucene (Query, Searcher, etc.), and many source files (from users of lucis) may reference both Lucene's and Lucis' classes. Even though this is not a problem, I don't like fully-qualified names, so I've had some thesaurus time :) 

Thursday, August 28, 2008

Neil Gafter is leaving Google...

Via twitter. It will be interesting to know about his new gig...

Update: New employer revealed...

Thursday, May 22, 2008

On breaking Java

After Ola Bini's post on a list of features he would like to see in a compatibility-breaking version of Java, everyone seems to have his own, so here's mine:
  • No primitives.
  • Closures and arrow (function) types. This would also open the door to using methods as values and method names as first-class identifiers.
  • Non-nullable types by default. Use of something like Scala's Option.
  • Better support (syntactic sugar, friendlier APIs) for immutable types (and maybe explicit pure functions?).
  • Reified generics, with some improvements as well.
And the most important thing for me would be to clean up the APIs, removing obsolete ones and retrofitting the others to the new features.

Sunday, May 18, 2008

Feeding the Rumor Mill

A good way to generate expectations :)

I, for one, would really like to see zfs on linux.

Friday, May 16, 2008

On Types and Programming Languages

Programming languages and type systems are two fascinating subjects inside computer science, and there are plenty of sites devoted to them. They are great fields of research for academics (and the industry) and source of endless debate in the open source world and the blogosphere.

This week, static vs dynamic typing has been brought again to the front page by this (lengthy as usual) post by Steve Yegge. If you go through the transcript of this pretty interesting presentation you'll see that in the end,  he really focuses on dynamic just-in-time compilation techniques, which are also available for statically typed languages (provided they are run through some kind of vm, such as the hotspot java virtual machine). Anyway, after (or in reaction to) this post a great amount of content in the subject has flourished.

As a debate in itself, it is really interesting because it's a good way to  get introduced to new advances in both camps (and to discover the past, there many things that sound new but were invented decades ago). And in my opinion, it's endless in nature, as the only absolute truth may be that there is no language (nor type system) that fits best in all situations.

So in the end, in many cases is just a matter of personal preference. And even though I really get the value (and in many cases even the need) of dynamically-typed languages I have some personal bias towards static typing (I'm nearer to Cédric's position).

Ironically, I've found myself limited many times by the type system of the programming language at hand (mostly Java) but that has only increased my interest in learning the possibilities provided by languages with more expressive type systems (ML family, Haskell, Scala...).