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

I/O module: deprecate I/O operator <~> #19501

Closed
mppf opened this issue Mar 18, 2022 · 4 comments
Closed

I/O module: deprecate I/O operator <~> #19501

mppf opened this issue Mar 18, 2022 · 4 comments

Comments

@mppf
Copy link
Member

mppf commented Mar 18, 2022

  • The <~> operator exists today for I/O
  • Like ‘readwrite’, it is designed to support one set of code for both reading and writing
  • It also supports chained I/O e.g.
    mychannel <~> myint <~> " " <~> myrecord;
  • Has not stood the test of time in Chapel due to ‘read’ and ‘write’ being varargs
    • In practice <~> is almost exclusively used in readThis / writeThis / readWriteThis
      • Due to historical differences in how errors were handled between <~> and channel.write
    • Instead of the above chained example one can write
      mychannel.write(myint, " ", myrecord);
    • Chapel programmers seem to use this form instead (including myself)

Proposal:

  • Deprecate the <~> I/O operator
  • Leave it available in the parser as an operator available for custom use
@bradcray
Copy link
Member

bradcray commented Apr 1, 2022

I think if we deprecated it, I'd probably also remove it from the parser as soon as I could b/c it seems arbitrary to support this one operator in case someone needs it rather than defining a bunch of symbolic combinations someone might want, or to introduce the idea of a more general operator identifier.

@benharsh
Copy link
Member

My PR #20467 deprecated the <~> operator in the IO module, and deprecated the operator in general. I believe we decided this was the right approach elsewhere/offline, but I wanted to check in on this issue before closing.

Does anyone involved here feel that the general-purpose <~> operator is worth preserving? If so I can remove the current compiler deprecation warning fairly easily.

@bradcray
Copy link
Member

Does anyone involved here feel that the general-purpose <~> operator is worth preserving?

Not I.

@benharsh
Copy link
Member

In that case I'm closing this issue. I believe the only remaining work here is to remove the <~> operator from the compiler, modules, and tests in its entirety. This should be a fairly small task that I can do post-release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants