haskell-hvr / uuid

A Haskell library for creating, printing and parsing UUIDs
http://hackage.haskell.org/package/uuid
61 stars 38 forks source link

New random #53

Closed lehins closed 3 years ago

lehins commented 4 years ago

Support for new version of random-1.2.0

Also newer version of criterion depends on uuid. Circular dependency like that is a bit problematic, so I switched benchmarks to use gauge. If that is a problem, I can submit a PR just with support for new random.

lehins commented 4 years ago

@hvr FYI, current uuid version is compatible with random-1.2 as well, it is just not as fast. So you can relax the upper bound to random < 1.3 for current releases

Jonathas-Conceicao commented 4 years ago

I too had a problem while building uuid-types from my dependency tree. This fork seams to fix it. I've added this to my cabal.project file until this get merged:


source-repository-package
    type: git
    location: git@github.com:lehins/uuid.git
    tag: a744cd0a72f984793fd48b93ca4b6aee54fa8358
    subdir: uuid-types
LeventErkok commented 4 years ago

Just wanted to chime in and express support for this PR to be merged and released. It's causing issues in downstream tools. Thanks! @hvr

phadej commented 4 years ago

I made a revision: https://hackage.haskell.org/package/uuid-types-1.0.3/revisions/ so this PR is not urgent.

lehins commented 4 years ago

@phadej thank you for the revision. FYI, this PR speeds up uuid generation by a factor of x10. If anyone really wants fast uuid generation with better quality of randomness they can use my fork of the repo.

phadej commented 4 years ago

One should not use Uniform for UUID generation if the goal is to adhere to the RFC (version 4), which is the "random UUID". I suggest reading through https://www.ietf.org/rfc/rfc4122.txt

In my private discussion with @hvr we thought of dropping random dependency and instance completely, as these are "wrong" (and uuid uses entropy)

dbaynard commented 4 years ago

Would it be possible to revise the uuid upper bound too to allow random 1.2.0.0?

lehins commented 4 years ago

Yes, at least an update to upper bound upgrade would be nice. It of course will not have as much of a performance improvement, but at least it will not prevent people from using uuid with newer random.

phadej commented 3 years ago

I added Uniform instance and modified Random instance in https://github.com/haskell-hvr/uuid/pull/61

However, gauge is still not an option, so if you want to improve the benchmarks, check the new setup.

lehins commented 3 years ago

@phadej This is great, thank you for doing this! I don't particularly care about gauge vs any other approach, most important for me was the random support.