modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo
Other
22.35k stars 2.55k forks source link

[mojo-stdlib] Remove deprecated register_passable __init__ -> Self #2037

Open Benny-Nottonson opened 3 months ago

Benny-Nottonson commented 3 months ago

Review Mojo's priorities

What is your request?

Replace uses of __init__() -> Self, as well as the use of return Self {key: value} for register passable structs.

What is your motivation for this change?

As noted in earlier discussions and release notes, the use of this formatting for register passable structs is now deprecated, and the standard __init__(inout self) is expected.

Any other details?

No response

JoeLoser commented 3 months ago

Thanks for filing this issue! This would be a great starter task — I went ahead and added the "good first issue" label as such.

StandinKP commented 3 months ago

Is this supposed to be done also in the examples/*.ipynb and .md files? Also I would be happy to pick this up if anyone else is not working on this

JoeLoser commented 3 months ago

I removed the "good first issue" and added a new "hold off" label to mention to not work on this right now. As I mentioned here, we're seeing some increases in IR size and potential negative performance with this change, so internally, we'll want to dig into that before replacing it everywhere, especially for core low-level types like AnyPointer we did in https://github.com/modularml/mojo/commit/958ae276b3e7574950264014b8721c7ec0375c81.

Benny-Nottonson commented 1 month ago

I removed the "good first issue" and added a new "hold off" label to mention to not work on this right now. As I mentioned here, we're seeing some increases in IR size and potential negative performance with this change, so internally, we'll want to dig into that before replacing it everywhere, especially for core low-level types like AnyPointer we did in https://github.com/modularml/mojo/commit/958ae276b3e7574950264014b8721c7ec0375c81.

Is this still true?