[m-dev.] proposal: add uuid module to the standard library

Julien Fischer jfischer at opturion.com
Sat Oct 31 17:41:39 AEDT 2020


Hi Peter,

On Sat, 31 Oct 2020, Peter Wang wrote:

> On Sat, 31 Oct 2020 16:47:53 +1100 Julien Fischer <jfischer at opturion.com> wrote:
>>
>> Some time ago I wrote a library for handling UUIDs in Mercury.
>> Initially, it was just a wrapper around libuuid, java.util.UUID etc.  I
>> have recently added a Mercury implementation of UUIDs to it, removing
>> the need for any external libraries.  I think it would be worth adding
>> this to the standard library.  Any objections?
>
> I'm not really in favour.
>
> We do have a uuid module in Prince but all it does is generate random

It being in Prince is not really use to anyone else ...

> UUIDs by reading from a cryptographic RNG (which is platform specific)
> and knocking out the relevant bits, and converting the uuid to a string
> or byte array representation.

Which is basically what this module provides (minus the system
specific cryptographic RNG, but that's another story ...).

> I'm not sure why anyone ever needs to inspect the internal structure
> of a UUID.

You don't.  You need to understand the notional representation that RFC 4122
defines for UUIDs only to understand the lexicographic ordering that
is usually used with UUIDs (except in Java for some reason).

Julien.


More information about the developers mailing list