News for hackers. Stuff that matters.
Re:Microfeatures I'd like to see in more languages by int_19h on Friday January 06, 2023 @02:55AM (#34272114)
They can be implemented as a library C++ thanks to templates and user-defined literals, and there's a proposal to add them to stdlib based on one of the existing implementations: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p19...
Re:Microfeatures I'd like to see in more languages by kwhitefoot on Friday January 06, 2023 @04:05AM (#34272593)
You can implement it in C# too with zero run time cost.
Re:Microfeatures I'd like to see in more languages by int_19h on Friday January 06, 2023 @11:42PM (#34285275)
I don't see how, except for manually rolling a struct for every new combination of units. The C# generic system is not flexible enough to define things like "m / s / s = (m/s^2)".