Open timotheecour opened 4 years ago
That's a good link, but it's also as expected, right? You don't use this to store a 4-digit decimal, right? What do you use? A string.
Also there is already a nim port https://github.com/LemonBoy/dtoa.nim
dtoa is a different algorithm (and IIUC not expected to produce the most compact stringification) but would be a great thing to compare against (eg for performance)
@alaviss is writing a nimish version of Ryu that should deprecate this repo. So, the goal of this effort is to flesh out tests and benchmarks so that we can vet future implementations. I expect that the next implementation will be much friendlier to inclusion in the stdlib, for example.
consider rename to
nim-ryu
or similarthe nimble package name can/should stay
ryu
, but the github repo name should probably be changed tonim-ryu
otherwise it increases chances of conflict with original https://github.com/ulfjack/ryu (eg for users having forks + your package), since your package is not a fork but a portthanks for working on this btw
status
looks good so far! not quite correct yet wrt https://github.com/nim-lang/Nim/issues/13196, eg:
links
python implementation of dtoa: https://github.com/python/cpython/blob/master/Python/dtoa.c
benchmark discussion https://www.reddit.com/r/ProgrammingLanguages/comments/930pch/ryu_a_new_algorithm_to_quickly_convert_floating/