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

proposal: add shape package to stdlib for holding gcshape instance types #49268

Closed
randall77 opened this issue Nov 1, 2021 · 7 comments
Closed

Comments

@randall77
Copy link
Contributor

I'd like to reserve the shape stdlib package to hold compiler-generated gcshape types. Right those types live in the .shape package so it won't conflict with any real package name. But that makes generated code look ugly, in particular the leading dot gets escaped to %2e so there's a smattering of those escapes throughout the generated code for generics.

In addition, if we reserve the shape package it gives us a place to put some documentation, so that when someone disassembles their code and sees references to a shape package, they can find documentation on what that means.

Related: #37641

@randall77 randall77 added this to the Go1.18 milestone Nov 1, 2021
@mvdan
Copy link
Member

mvdan commented Nov 2, 2021

I think this is a subset of #32819. Assuming we document that restriction during the freeze, then this proposal will already be de facto accepted and implemented :)

@rsc
Copy link
Contributor

rsc commented Nov 3, 2021

We've used go.string for a long time for string data. Can we use go.shape instead of reserving 'shape'?
I've never seen go%2estring - I'm not sure if it's a special case or not, but if so we could special case go.shape too.

@rsc
Copy link
Contributor

rsc commented Nov 3, 2021

I don't believe this is a subset of #32819 btw. #32819 says no one else can use 'shape'. But we might still have a use for a standard library package named 'shape' in the future, and continuing to use 'go.' for our internal symbols seems cleaner than cutting out real names.

@mvdan
Copy link
Member

mvdan commented Nov 3, 2021

That's a fair point - I wasn't aware that go. as a prefix had a precedent.

@rsc
Copy link
Contributor

rsc commented Nov 3, 2021

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@randall77
Copy link
Contributor Author

Withdrawn - looks like go.shape should work.

@rsc
Copy link
Contributor

rsc commented Nov 10, 2021

This proposal has been declined as retracted.
— rsc for the proposal review group

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

No branches or pull requests

4 participants