Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 22827 - Deprecate 128-bit cent and ucent types #13730

Merged
merged 1 commit into from Mar 8, 2022

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Feb 27, 2022

Pave the way for making an exit for these types in the compiler.

After removal both can be moved to be aliases in the object module.

Actually issuing a deprecation message in the parser would break everyone, and keeping the error in the semantic makes it consistent with the deprecation->error path for complex numbers.

@ibuclaw ibuclaw added Needs Approval Needs Changelog A changelog entry needs to be added to /changelog Easy Review labels Feb 27, 2022
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
22827 normal Deprecate 128-bit cent and ucent types

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#13730"

@ljmf00
Copy link
Member

ljmf00 commented Feb 27, 2022

Are we removing those built-ins from the language? Will we reserve these keywords for future use?

@ljmf00 ljmf00 added the Needs Spec PR A PR updating the language specification needs to be submitted to dlang.org label Feb 27, 2022
@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 27, 2022

Are we removing those built-ins from the language? Will we reserve these keywords for future use?

There are no 128-bit built-ins in the language. As for the keywords, they have always been reserved. The keywords aren't going to stop being reserved. The reservation of them just may not necessarily be done by the compiler (i.e: an alias in the object module).

@ljmf00
Copy link
Member

ljmf00 commented Feb 27, 2022

Are we removing those built-ins from the language? Will we reserve these keywords for future use?

There are no 128-bit built-ins in the language. As for the keywords, they have always been reserved. The keywords aren't going to stop being reserved. The reservation of them just may not necessarily be done by the compiler (i.e: an alias in the object module).

So the plan is to do alias cent = Cent; on the object.d?

@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 27, 2022

So the plan is to do alias cent = Cent; on the object.d?

I can't see any reason why not to. Ditto complex numbers too (alias creal = __c_complex_real;).

@ljmf00
Copy link
Member

ljmf00 commented Feb 27, 2022

So the plan is to do alias cent = Cent; on the object.d?

I can't see any reason why not to. Ditto complex numbers too (alias creal = __c_complex_real;).

Cool. So since this is already an error and, realistically, no D compiler implements cent (which is reserved in the spec, but with a defined behaviour), we don't need to deprecate this or at least have a long deprecation process for this keyword?

@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 27, 2022

10 releases follows the process of DIP1013. Yeah, this is an edge case, where we're just changing an error to a more informative one that directs people to a library solution. I'd still prefer to wait a while, and give time to iron out the library implementation before removing support from the compiler proper.

@ljmf00
Copy link
Member

ljmf00 commented Feb 28, 2022

10 releases follows the process of DIP1013. Yeah, this is an edge case, where we're just changing an error to a more informative one that directs people to a library solution. I'd still prefer to wait a while, and give time to iron out the library implementation before removing support from the compiler proper.

I think applying the deprecation process here is a bit weird and unnecessary, but, strictly speaking, sure, it should be that way. Perhaps, GDC implements cent and ucent?

I mean, my whole point is that we are deprecating an error, when the deprecation process ends we deprecate the error to a non-error? This, in particular, doesn't affect the end-users and, if we transit to an alias, the feature behaves exactly how it should.

If GDC implements this type as built-in on a stable release, I think this makes sense, otherwise, if there is no real D compiler implementing it, I think this is a bit unnecessary.

@RazvanN7 RazvanN7 merged commit 89a7588 into dlang:master Mar 8, 2022
@RazvanN7
Copy link
Contributor

RazvanN7 commented Mar 8, 2022

I got here through #13506 and didn't see the labels (needs changelog, needs spec PR). This was an error anyway so I did not hesitate to merge. However, do we really need a changelog and a spec entry for this?

@ibuclaw ibuclaw deleted the issue22827 branch March 8, 2022 10:51
@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 8, 2022

@RazvanN7 the spec (probably the deprecate.dd page) should have an entry for completeness sake.

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 8, 2022

dlang/dlang.org#3247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Review Needs Approval Needs Changelog A changelog entry needs to be added to /changelog Needs Spec PR A PR updating the language specification needs to be submitted to dlang.org
Projects
None yet
4 participants