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

Accept f32/f64 as aliases for float32/float64. #1356

Merged

Conversation

sunfishcode
Copy link
Member

In WebAssembly/component-model#277 there seems to be consensus emerging to rename float32/float64 to f32/f64. This PR just adds support for parsing f32/f64, and changes nothing else for now, to start preparing for this change.

In WebAssembly/component-model#277 there seems to be consensus emerging
to rename `float32`/`float64` to `f32`/`f64`. This PR just adds support
for parsing `f32`/`f64`, and changes nothing else for now, to start
preparing for this change.
@alexcrichton
Copy link
Member

Before committing to this could a rough plan of how to make this transition be written down first? I suspect it'd look pretty similar to other historical transition plans, but it'd be good to have it in words somewhere. I'm retroactively wishing we had a list of active transitions happening at any one point in time because I've long forgotten what's needed any more at this point, but that can be handled later.

Can you additionally add some tests which assert that the syntax parses and works correctly?

@esoterra
Copy link
Contributor

esoterra commented Jan 4, 2024

Maybe we could get the ;, ///, and f32/f64 changes all figured out and put onto some sort of combined WIT transitions roadmap before getting started on this (not that ; isn't figured out, just that it's in this category and ongoing).

I think they're the main changes and we can probably try to synchronize them to some extent.

@sunfishcode
Copy link
Member Author

Before committing to this could a rough plan of how to make this transition be written down first? I suspect it'd look pretty similar to other historical transition plans, but it'd be good to have it in words somewhere. I'm retroactively wishing we had a list of active transitions happening at any one point in time because I've long forgotten what's needed any more at this point, but that can be handled later.

A plan for f32/f64 is:

  • Make wit-parser accept f32 and f64 as aliases for float32 and float64. Accept f32/f64 as aliases for float32/float64. #1356
  • Wait until that's in a release and the major tools have updated.
  • Update Wit files, documentation, pretty-printers, etc. to f32/f64.
  • After some time, add a deprecation warning for float32/float64 pointing users to f32/f64
  • After some time, remove float32/float64

The other transition in flight is documentation comments. That one's simpler because wit-parser already accepts /// and most Wit files and documentation already use it.

The semicolon transition is already done. Wit-parser is already requiring semicolons.

Do these look reasonable? If so, I can file new issues in this repo to track them.

Can you additionally add some tests which assert that the syntax parses and works correctly?

I've now added a test.

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, and thanks! And yeah if you wouldn't mind opening issues that's probably the best way to track things for now.

Like with // as well this is probably a good time to go ahead and implement wearnings for float{32,64} and just have them disabled by default until we decide to turn them on.

@alexcrichton alexcrichton merged commit 0616ef1 into bytecodealliance:main Jan 5, 2024
@sunfishcode sunfishcode deleted the sunfishcode/float-type-names branch January 8, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants