3 ms·
I've recently written a units library for Nim [0]. It's still WIP, but it's already proven extremely useful for me as a physicist. Thanks to Nim's strong type
by V1ndaar 5y ago
I've recently written a units library for Nim [0]. It's still WIP, but it's already proven extremely useful for me as a physicist.
Thanks to Nim's strong type system and metaprogramming features, it allows for a fully compile time design, without any runtime overhead (in form of special unit objects or such things; everything is a `distinct float`).
In addition Nim's unicode support, the code even looks nice!
A more complex use case (I can link more if desired): [1]
[0]: https://github.com/SciNim/Unchained/ https://github.com/SciNim/Unchained/
[1]: https://github.com/SciNim/Unchained/tree/master/examples https://github.com/SciNim/Unchained/tree/master/examples