[phobos] RFC: units type for D

Benjamin Shropshire benjamin at precisionsoftware.us
Wed Aug 25 20:11:17 PDT 2010


Andrei Alexandrescu wrote:
> This is a very interesting discussion, with great points. Here's what 
> I think - in brief, my experience time and again has been that stuff 
> that has a strong champion behind it succeeds, and stuff that doesn't, 
> doesn't. In light of that, if Benjamin and/or David are enthused about 
> pushing their libraries into Phobos, and furthermore maintaining and 
> enhancing them, and further-furthermore contributing in new ways to 
> Phobos, then I think it's not crucial that dimensional analysis (and 
> possibly rational numbers) are of narrow utility.
>
> One less positive example is std.json - after adding it to Phobos, 
> Jeremie didn't hang around to maintain it, bring its style on par with 
> the rest of Phobos etc. Right now it's a library in need of a 
> champion. Not to mention the likes of std.xml :o).
>
> So, subject to the rest of the team being approving too, I'd say let's 
> give dimensional analysis (and rational numbers too if David wants) a 
> fair shot at inclusion in Phobos. Be prepared for ruthlessness though 
> :o).
>
Bring it on! :)

>
> Andrei
>
> On 8/25/10 19:37 PDT, David Simcha wrote:
>> One comment I want to make is that, if we're going to include this, I
>> have a rational number library on Scrapple that I've been meaning to put
>> up for review for a while. I noticed that you roll your own somewhat
>> ad-hoc rational numbers for the units type and don't really expose them
>> in any more general way. IMHO if both rational and the units lib make
>> the cut for Phobos, they should be integrated with each other. I'll
>> clean up my rational library and do a commit, since it's succumbed to
>> some degree of bit rot. It's at
>> http://dsource.org/projects/scrapple/browser/trunk/rational/rational.d.
>>
>> On 8/25/2010 10:09 AM, Benjamin Shropshire wrote:
>>> I have offered up a library that supports statically encoding units in
>>> the type system so as to prevent unit errors (adding distance and
>>> time) and to enforce correct conversions all around.
>>>
>>> http://d.puremagic.com/issues/show_bug.cgi?id=3725
>>>
>>> I'm looking for comments: What's holding it back from inclusion? What
>>> would need to be improved? The API? Better comments? (I haven't tested
>>> it recently so; make it build again?)
>>> _______________________________________________
>>> phobos mailing list
>>> phobos at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>>
>>
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>



More information about the phobos mailing list