« Collections | Main | ODBC »

November 04, 2004

SLinks

I have now more or less finished the "sufficient part" of the work outlined in Tuesday's post. That is, I have a version of my program that types and interprets SLinks expressions with records, variants, lists, sets and bags. It supports simple operators for the basic types (boolean, integer and float; string is supported but has no operators), and all operators described earlier in this weblog for records, variants and collections, including full comprehensions. I had forgotten in tuesday's post that I would need a 'define' operator (like caml's 'let' without 'in' operator), and this has been added also.

Of course, the interpreter is still a little bit 'rough on the edges': it doesn't have the nicest error handling available out there (to say the least), the lack of recursive function is annoying, and the code for the unification algorithm for rows is not as nice as it could be. There is also another problem with collections: The 'collection with many elements' operator is syntactic sugar for the union/concatenation of single element collections, and the compilation/typing phase for this is slow. That means there is a visible wait to compile a list of 50 elements. I am not quite sure yet whether this inefficiency can be optimised away, or if I will have to add the multi-collection as a base operator for the language. Interpretation does not have the same problems since it represents lists as lists.