3 ms·
Why isn't this released as a library (as opposed to a program)?
by amelius 6y ago
Why isn't this released as a library (as opposed to a program)?
- enriquto 6y agoA program is easier to use. You do not need to link to it, just run it! Do you have trouble running programs?
- macintux 6y agoPer another thread it sounds like Frink is what you want. https://frinklang.org/ https://frinklang.org/
- devenblake 6y agoIn the README in the GNU units source code (2.21): 203: Ideas the future (may or may not happen): 204: 205: * Bundle up the units conversion stuff into a library. At the end of units.c, too: 6280: /* NOTES: 6281: 6282: mymalloc, growbuffer and tryallunits are the only places with print 6283: statements that should (?) be removed to make a library. How can 6284: error reporting in these functions (memory allocation errors) be 6285: handled cleanly for a library implementation? 6286: 6287: Way to report the reduced form of the two operands of a sum when 6288: they are not conformable. 6289: 6290: Way to report the required domain when getting an domain error. 6291: 6292: */ My prowling of the source code is probably uninformed because I'm not a C expert by any means but it seems like you could include units.h and use many of the useful functions in another program.
- rubenbe 6y agoYou might also be interested in boost::units. It implements units using a ton of templates and "compile-time metaprogramming". [0] The nice thing is that it has no runtime overhead as all templates are "compiled away". The disadvantage is that when you make a mistake against units, it results in a "template compiler error explosion". [0]https://www.boost.org/doc/libs/1_65_0/doc/html/boost_units.html https://www.boost.org/doc/libs/1_65_0/doc/html/boost_units.h...