Conversation
|
Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#7702" |
|
@pbackus thank you for your work on sumtype! It's an excellent high-quality module that I've used successfully in various projects, as I'm sure many other D developers have. I believe that adding it to phobos (and later druntime), would be an excellent addition to D's standard distribution! @atilaneves What's the DLF's latest position on adding new modules to phobos? Is there a checklist from your side about about what a pull request like this one should fulfill? I see several options:
|
|
Re: stabilization, my view is that stabilization can and should happen on code.dlang.org. |
Good question. Given that this is the first time it's happened since I became the deputy leader, I'm going to have to think about it. |
|
My latest news about adding modules to Phobos is that they need to bring great merit since removing them later is a breaking change. @pbackus Can you outline why adding this to Phobos is a big win? Especially, why DUB isn't enough? |
|
@Bolpat I'd be glad to. Here's something I wrote about this on the D forums [2] that I think summarizes the argument pretty well:
I would add to this that the reasons to prefer a new module over an in-place upgrade of Please feel free to ask if you have any more questions. [1] https://www.oreilly.com/library/view/mastering-the-c17/9781787126824/c6737dd3-47fa-4719-a459-72afac90857c.xhtml |
|
@atilaneves Have you come to a conclusion regarding this addition? It is going to require some work to review this. @andralex @wilzbach @jmdavis @CyberShadow @MartinNowak @thewilsonator and everyone else who has the time. Maybe we can coordinate to review parts of this addition? |
|
@RazvanN7 No, not yet, sorry. I know I should do that soon. |
|
@atilaneves Can you give any kind of estimate for when we can expect some progress on this? If not, what would it take to generate such an estimate? I'm happy to help in any way I can, but complete radio silence from you/the DLF means my opportunities to do so are severely limited. |
pbackus
left a comment
There was a problem hiding this comment.
Kicking things off here with a self-review. Any and all feedback is appreciated, but I'm especially hoping to hear from experienced Phobos developers regarding the build-system changes.
| betterc-module-tests: $(ROOT)/betterctests/betterc_module_tests | ||
| $(ROOT)/betterctests/betterc_module_tests | ||
|
|
||
| $(ROOT)/betterctests/betterc_module_tests: test/betterc_module_tests.d $(addsuffix .d,$(BETTERC_MODULES)) |
There was a problem hiding this comment.
Not sure if I ought to be re-using this directory from the regular betterC tests or not, but it seems to work.
| # Test full modules with -betterC. Edit BETTERC_MODULES and | ||
| # test/betterc_module_tests.d to add new modules to the list. |
There was a problem hiding this comment.
Having this information duplicated in two different files is not ideal. One possible alternative would be to put the list in its own file, and have both posix.mak and betterc_module_tests.d read it in via $(file ...) and string import, respectively, but the extra layer of indirection would make each file harder to read in isolation.
| static immutable bettercModules = [ | ||
| "std.sumtype" | ||
| ]; |
There was a problem hiding this comment.
This list is repeated in posix.mak. See the comment there for discussion.
| SRC_STD_7a= \ | ||
| std\sumtype.d | ||
|
|
There was a problem hiding this comment.
Splitting this into a new object file is probably not necessary, but I don't have a Windows dev environment set up that I can test in, so I didn't want to risk it.
| SRC_STD_7a= \ | ||
| std\sumtype.d | ||
|
|
There was a problem hiding this comment.
See comment in win32.mak.
| -std.socket,\ | ||
| -std.stdio,\ | ||
| -std.string,\ | ||
| -std.sumtype,\ |
There was a problem hiding this comment.
The rationale for these disabled checks, copy+pasted from the relevant commit message:
- assert_without_message: flags asserts inside invariants, even though
their messages are ignored. - could_be_immutable_check: flags variables inside unittest blocks.
- has_public_examples: flags SumType because its examples are attached
to the module rather than the SumType symbol itself. - object_const_check: does not acknowledge a template this parameter as
a valid alternative to inout on opEquals and toString. - opequals_tohash_check: fails to detect SumType.toHash.
- properly_documented_functions: requires 'Params' documentation for
template this parameters and parameters of private (but documented)
functions.
I'm giving myself until next Wed. Keep me to it. |
|
@atilaneves Ping. What's the next step here? |
|
Ping @atilaneves Decision still needed |
Atila is off for a while for personal reasons. @WalterBright should be able to help in the interim. What is the decision to be taken? |
The decision is whether to merge into Phobos or not. I think sumtype is of Phobos-quality but the decision is two-fold:
|
As I read it, there are three questions that need to be answered here:
Both 1 and 2 require input from Walter and/or Atila, so progress on those fronts is blocked until one of them is available. The rest of your comment falls under 3, and I will address it in a separate reply. |
I'm agnostic on this, but I think it's important to mention that
I am not sure it would be wise to give up on useful, working code today in favor of a hypothetical future language feature that hasn't even had a DIP written for it yet, much less an implementation. D's history is littered with ambitious projects that looked promising early on, generated a bunch of excitement, and eventually ended up abandoned. By all means, we should consider our options, but let's be realistic about what those options actually are. |
|
Auto-tester is currently red because one of the Darwin runners timed out while attempting to build DMD. It should fix itself the next time a new run is triggered. Edit: and indeed it has. |
Also change the description of std.variant to focus on Variant rather than Algebraic.
They distract from the example's main topic, and are potentially confusing to readers unfamiliar with them.
Corresponds to the following sumtype commits: - 97fc38e4ac6c18e049c90f5a7657997155af198e - 7e6ee90e4b8bc8bdda65af8c24c945aa3577e5c6 - 2032c14b0a7d29c445700068c92e513b2ad0619c - dc461a4c2c1644b0073c57c5d87f251cd2ecb70a - 72b4936d92875583eeb1454d70f76f3309930e85 See pbackus/sumtype#50 for more details.
Previously, the tests were only compiled, not run.
Corresponds to the following sumtype commits: - 22e0a99160db61ede4516b686c4fe363f86a0035 - b54769701c34f8da79a18a17816a45e39630f465 - 1218f8f97372d00071856b4f9da1c7990a8a2e0f See pbackus/sumtype for more details.
It was added originally to maintain compatibility with multiple versions of Phobos.
"Obsolete" may imply that a formal decision has been made to deprecate or remove Algebraic, which is not the case.
|
I think that all the tests that have Other than that (minor anyway) and my question just now, should be good to go. |
The tests that used to do this now simply attempt to compile the code in question directly.
|
@atilaneves Should be ready to merge now. |
|
Thanks to @pbackus for this awesome addition and to everyone involved in the review process. |
Based on version 1.0.3 of the
sumtypepackage on code.dlang.org. See individual commit messages for a summary of changes.