You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that changing the nanoflakes spec to use an unsigned 64 bit integer would drastically improve its implementation in a lot of languages, and here are my arguments for it:
To correctly implement a nanoflake generator and other auxiliary functions, we heavily depend on bitwise shift operations. The problem is that multiple languages have different ways of dealing with bitwise shift operations on signed integers, especially right shifts. Some languages use aritmetic shifts, some use logical shifts and some use both (you can read more about this in here ). Using an unsigned integer would standardize and simplify implementation because we could always default to logical shifts.
It would double the nanoflakes's lifespan.
I understand that twitter snowflakes are signed integers, but twitter only has to worry about implementing it in Scala, while we are (hopefully) implementing it in a lot of other languages, so we do have to worry about how to make the spec implementation as consistent as we can across various languages.
I believe that these 3 points are the best arguments I came up with as to why we should change to unsigned 64 bit integers.
The text was updated successfully, but these errors were encountered:
I believe that changing the nanoflakes spec to use an unsigned 64 bit integer would drastically improve its implementation in a lot of languages, and here are my arguments for it:
I believe that these 3 points are the best arguments I came up with as to why we should change to unsigned 64 bit integers.
The text was updated successfully, but these errors were encountered: