As the person who added `rightSize`, I agree with those points actually. The 
only slight gotcha is that doing as you suggest would result in old code that 
calls it with (the correct power of two to avoid a resize, or maybe already a 
`rightSize`) would allocate the _next higher_ power, wasting space. That might 
be a price worth paying ease-of-use wise.

We _could_ only call `rightSize` if the argument is not a power of two, but 
it's probably simpler to just always use `rightSize` and just tell people. 
Wasting space isn't quite a "failure". Anyway, you should feel free to file a 
github issue and/or work on a pull request. Maybe I should have pushed harder 
at the time to change the parameter semantics.

There is definitely a learning curve coming from other languages. There are 
definitely more examples of the stdlib not providing the "best in class" for 
various functionalities. There will likely be even more with time. Nim core 
only has so much manpower to write/maintain/support such things.

We discussed doing a "distribution" over at 
[https://github.com/nim-lang/RFCs/issues/173](https://github.com/nim-lang/RFCs/issues/173)
 and elsewhere. This "fusion" repository (see end of that thread) seems to have 
been the output, but not much has been happening over there.

Anyway, I think if you persevere there are good chances you could be a happy 
Nimmer once you've learned your way around. You seem pretty capable of finding 
these issues and you could probably help round some of the sharp edges, if you 
can sustain the patience. There is probably a Porting to Nim From Python 
guidebook or maybe you could help do one!

Reply via email to