status-im / nim-stew

stew is collection of utilities, std library extensions and budding libraries that are frequently used at Status, but are too small to deserve their own git repository.
133 stars 18 forks source link

intops: core integer primitives #187

Open arnetheduck opened 1 year ago

arnetheduck commented 1 year ago

This, together with bitops2 and endians2, forms the core primitive offering for working with integers as the computer sees them.

The focus of intops is to expose a number of common integer operations typically used to build more complex abstractions such as bigints, mp-ints etc while having access to the best performance the compiler and cpu can offer.

There is more to do here, but this provides an outline of what this module could look like.

Obviously, there are no exceptions or defects around - the point of these utilities is to stay as close as possible to bare metal. They could be used to implement such features however (similar to how system/integerops works).