-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Remove complex and imaginary types from language in Edition v2024 #12069
base: master
Are you sure you want to change the base?
Conversation
ca1a819
to
42b61bf
Compare
If I understand correctly, when this switch is enabled, code that uses |
No, However, because some people still need to be able to interface to extern C libraries, some magic enums have been added in order to treat When testing this, I have ran into many bugs in DMD though. Which I could infer to mean that nobody can be using complex types in D if there's this many problems with them. |
Then why use a preview flag? Preview flags usually add a new feature, whereas for removing features we do a deprecation cycle. Is there something preventing us from going down that path? |
Removing a feature is still a new feature... :-) If complex numbers get removed outright, then the |
Complex native types were a bad idea, and were deprecated long ago so there was no point to fixing bugs in them. Except that they were never actually deprecated. |
42b61bf
to
f432256
Compare
Is it close to being done? |
The implementation is "done", just slowly rolling out the scaffolding for the library support. It would be good to get |
Present in 7 commercial products.
We need that preview flag please. |
It would be nice to have preview flag become default in more than just 2 months? We. are. using. this. Preview flags not exactly simple with DUB. |
f432256
to
6b591d2
Compare
The transition flag has been in the compiler for a few years now. Phobos is built with it, but druntime isn't because there's still a couple of places still using complex types ( Honestly, even before you chimed in my timeline was approximately around in two years time as per DIP 1013. |
In case you missed it, you can still pull out native types for ABI purposes (#12167), these magic enums will land in druntime And no, it is not trivial, otherwise it would have been done 3 years ago when the process was started. :-) |
@ibuclaw status of this PR? |
OK I didn't know about the transition flag. |
Rebased, I'll write up a changelog and bring this out of draft phase when #12390 is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB this is still draft
I don't really understand the point of this. Once we're deprecating imaginary / complex, we wait the 10 releases, then remove them. So why an extra |
Allows introducing new library code that was previously impeded by There is no rush, however, so I'm fine just leaving this pr for 10 releases to remind what needs to be done to initially remove them. There'll be many follow-up PRs to clean up the now dead parts of the AST. |
0b4183d
to
dfac252
Compare
Thanks for your pull request, @ibuclaw! 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 + dmd#12069" |
Rebased, let's see where we're at. |
dfac252
to
3b19493
Compare
Looking good! |
Original implementation using FYI @dkorpel |
@ibuclaw status? |
Add
-preview=complex
, an option that removescfloat
,cdouble
, andcreal
from the D language.For C/C++ compatibility, new special enums have been added - and will likely be used for a
std.complex.Complex!(T).toNative()
function.Example implementation: