9fans archive / 1996 / 07 / 56 /    prev next

From: Howard Trickey howard@pla...
Subject: limbo
Date: Thu, 18 Jul 1996 08:09:39 -0400

> would it be possible to implement a qsort replacement in limbo ?

It is possible, but the answer is so ugly that the real answer is "no".

(The caller could pass in a channel, and then be willing to answer
questions like "is element 5 greater than element 3" over the channel;
the answer could be an array of element indices in their sort order.  Channels
of ascii can be a universal way around type checking.)

So, for instance, there is a module for sorting directory entries (in various
ways), but no general purpose sorting module.

Actually, the thing that bugs me more is the need to write what should
be generic list functions (e.g., rev, nth) for each element type.

Limbo currently doesn't have polymorphism or (discriminated) union types
because of the tradeoff decision about usefulness vs implementation cost
(the garbage collector would need more in the presence of the above).
But the language isn't embalmed by a standards committee yet...

Howard Trickey (Limbo programmer and language design kibitzer)