-
Notifications
You must be signed in to change notification settings - Fork 40
extract uint128 package? #131
Comments
I guess "no new dependencies" isn't a great argument when we already depend on intern and its It is kinda nice having it in the same package so it's easy to quickly add another operation when needed. Maybe it's done-ish, though, and we won't need more stuff for a bit. The name will be worse in a new package too. |
I think it’s done enough to be extracted without much pain. The name is a bummer though. Ideas:
|
I kinda like the "universe" option. If you really wanted to, you could even dot import it (yuck, I know) to remove the package name. |
Another reason to do this (eventually) is that they'd be useful in finishing up a SMART implementation. My personal favorites, some days later, are |
What about |
Unsure how useful this is, but I wrote a uint128 package a while back that has proved somewhat popular. My solution to the naming problem has been...to just copy over the implementation and rename the identifier. Often your program only needs a handful of methods anyway, so you can copy a small amount of code, slap a nice identifier on it, and avoid a dependency to boot. The copying approach might be less viable if you add serious optimizations, though (particularly asm). |
I suggest we refactor out our 128 bit support in a go4.org package.
Perhaps it will be of use to the people engaged in golang/go#9455 —and perhaps uses of that package will help make the case for a uint128 in the language. And it’d also provide a nice foil for compiler optimizations I have pondered to provide hardware support for some 128 bit operations using the existing language, like shifts.
The text was updated successfully, but these errors were encountered: