digitalmars.D - std.experimental.safeint.d
- Robert burner Schadek (14/14) Jun 07 2015 SafeInt!T is an integer wrapper struct with an explicit NaN value
- Robert burner Schadek (1/1) Jun 07 2015 PR: https://github.com/D-Programming-Language/phobos/pull/3389
- Jacob Carlborg (6/8) Jun 07 2015 A completely new module should go through the review queue [1] and no
- Robert burner Schadek (2/5) Jun 08 2015 The part about the PR would be a first and quiet useless.
- Dmitry Olshansky (11/17) Jun 08 2015 Actually it became quite common to present it as a pull request along
- Jacob Carlborg (6/11) Jun 08 2015 It's possible to comment on any commit on GitHub. You don't need a pull
- Steven Schveighoffer (4/9) Jun 08 2015 How so?
- Dmitry Olshansky (12/21) Jun 08 2015 Compared to just featuring the code on dub repository:
- Steven Schveighoffer (15/30) Jun 08 2015 Yes, that's true. But we are supposed to be having monthly releases of
- Dmitry Olshansky (9/40) Jun 08 2015 That much is true, I'm just hoping we move on to boost 3rd party
- Robert burner Schadek (2/3) Jun 08 2015 http://burner.github.io/phobos/phobos-prerelease/std_experimental_safein...
- Walter Bright (2/4) Jun 08 2015 Bearophile ought to like this!
SafeInt!T is an integer wrapper struct with an explicit NaN value build on top of core.checkedint. Features: * checks if assigned values can be actually stored * for SafeInt!u(T) NaN is T.max * for SafeInt!T NaN is T.min * SafeInt!T.opBinary("+","-","%","*","/") return SafeInt!T if value can not be store by SafeInt!T returned value is SafeInt!T.nan * should be pretty much a act as any (u)integer type Additionally, the module contains safe ==,!=,<,<=,>,>= comparisons functions assert(-1 == uint.max); // this is wrongfully true assert(notEqual(-1, uint.max)); // this asserts correctly true
Jun 07 2015
PR: https://github.com/D-Programming-Language/phobos/pull/3389
Jun 07 2015
On 2015-06-07 22:27, Robert burner Schadek wrote:SafeInt!T is an integer wrapper struct with an explicit NaN value build on top of core.checkedint.A completely new module should go through the review queue [1] and no pull request should be created until it's passed the review. [1] http://wiki.dlang.org/Review_Queue -- /Jacob Carlborg
Jun 07 2015
On Monday, 8 June 2015 at 06:43:59 UTC, Jacob Carlborg wrote:A completely new module should go through the review queue [1] and no pull request should be created until it's passed the review.The part about the PR would be a first and quiet useless.
Jun 08 2015
On 08-Jun-2015 09:44, Jacob Carlborg wrote:On 2015-06-07 22:27, Robert burner Schadek wrote:Actually it became quite common to present it as a pull request along with documentation (where's DDoc, Robert?). It makes commenting on code a breeze. Plus re-use of auto-tester - author has more time to fix his stuff should something not work on some platform. OT: I'm not quite sold on std.experimental as it 100% certain to be a breaking change once a module is promoted to std proper or phased out for that matter. And, of course, updating anything in std.experimental module is going to be a long tedious string of pull requests. -- Dmitry OlshanskySafeInt!T is an integer wrapper struct with an explicit NaN value build on top of core.checkedint.A completely new module should go through the review queue [1] and no pull request should be created until it's passed the review. [1] http://wiki.dlang.org/Review_Queue
Jun 08 2015
On 2015-06-08 12:33, Dmitry Olshansky wrote:Actually it became quite common to present it as a pull request along with documentation (where's DDoc, Robert?).Yeah, I've noticed.It makes commenting on code a breeze. Plus re-use of auto-tester - author has more time to fix his stuff should something not work on some platform.It's possible to comment on any commit on GitHub. You don't need a pull request for that. -- /Jacob Carlborg
Jun 08 2015
On 6/8/15 6:33 AM, Dmitry Olshansky wrote:OT: I'm not quite sold on std.experimental as it 100% certain to be a breaking change once a module is promoted to std proper or phased out for that matter.That's the point of it. "If you use this, your code may break."And, of course, updating anything in std.experimental module is going to be a long tedious string of pull requests.How so? -Steve
Jun 08 2015
On 08-Jun-2015 16:36, Steven Schveighoffer wrote:On 6/8/15 6:33 AM, Dmitry Olshansky wrote:Okay.OT: I'm not quite sold on std.experimental as it 100% certain to be a breaking change once a module is promoted to std proper or phased out for that matter.That's the point of it. "If you use this, your code may break."Compared to just featuring the code on dub repository: a) Release cycle tied to dmd b) All changes must be reviewed c) Changes got to be small enough to not require long review Thus overhauls of internals are not going to be easily deliverable, nor bug-fixes can be got out of band with D distribution. If anything I'd love to see more 3-rd party stuff that is easily installable. -- Dmitry OlshanskyAnd, of course, updating anything in std.experimental module is going to be a long tedious string of pull requests.How so?
Jun 08 2015
On 6/8/15 10:03 AM, Dmitry Olshansky wrote:On 08-Jun-2015 16:36, Steven Schveighoffer wrote:Yes, that's true. But we are supposed to be having monthly releases of DMD with bug fixes at least. std.experimental is supposed to be relatively stable as compared to an outside project. It is going to be tested with auto tester, and ensured to work on every PR. I think this is a good thing. What we CAN do is redesign the API if we don't like it. I look at std.experimental as "This should have gone into Phobos, but we're unsure of whether this API design is the right thing". Currently, changing API in phobos is near sacrilege. Essentially, std.experimental was born out of the realization that std.xml API is bad, but we need to keep that API and introduce std.xml2. Also, using a 3rd party repository does not reach the full audience.On 6/8/15 6:33 AM, Dmitry Olshansky wrote:Compared to just featuring the code on dub repository: a) Release cycle tied to dmd b) All changes must be reviewed c) Changes got to be small enough to not require long review Thus overhauls of internals are not going to be easily deliverable, nor bug-fixes can be got out of band with D distribution.And, of course, updating anything in std.experimental module is going to be a long tedious string of pull requests.How so?If anything I'd love to see more 3-rd party stuff that is easily installable.I think code.dlang.org covers that, no? -Steve
Jun 08 2015
On 08-Jun-2015 17:18, Steven Schveighoffer wrote:On 6/8/15 10:03 AM, Dmitry Olshansky wrote:On 08-Jun-2015 16:36, Steven Schveighoffer wrote:Yes, that's true. But we are supposed to be having monthly releases of DMD with bug fixes at least. std.experimental is supposed to be relatively stable as compared to an outside project. It is going to be tested with auto tester, and ensured to work on every PR. I think this is a good thing. What we CAN do is redesign the API if we don't like it. I look at std.experimental as "This should have gone into Phobos, but we're unsure of whether this API design is the right thing". Currently, changing API in phobos is near sacrilege. Essentially, std.experimental was born out of the realization that std.xml API is bad, but we need to keep that API and introduce std.xml2. Also, using a 3rd party repository does not reach the full audience.On 6/8/15 6:33 AM, Dmitry Olshansky wrote:Compared to just featuring the code on dub repository: a) Release cycle tied to dmd b) All changes must be reviewed c) Changes got to be small enough to not require long review Thus overhauls of internals are not going to be easily deliverable, nor bug-fixes can be got out of band with D distribution.And, of course, updating anything in std.experimental module is going to be a long tedious string of pull requests.How so?That much is true, I'm just hoping we move on to boost 3rd party projects instead of dumping modules in std.exp adding more strain on the relatively scarce forces of the core team. I have no specific plan though, but surely it needs a bit of help. Maybe adding some flags so that "good" projects that pass builds/tests with recent DMD or LDC/GDC are highlighted. -- Dmitry OlshanskyIf anything I'd love to see more 3-rd party stuff that is easily installable.I think code.dlang.org covers that, no?
Jun 08 2015
On Monday, 8 June 2015 at 10:33:12 UTC, Dmitry Olshansky wrote:along with documentation (where's DDoc, Robert?).http://burner.github.io/phobos/phobos-prerelease/std_experimental_safeint.html
Jun 08 2015
On 6/7/2015 1:27 PM, Robert burner Schadek wrote:SafeInt!T is an integer wrapper struct with an explicit NaN value build on top of core.checkedint.Bearophile ought to like this!
Jun 08 2015