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

runtime: eventual removal of linknamed external modules #67709

Closed
zhangyunhao116 opened this issue May 30, 2024 · 3 comments
Closed

runtime: eventual removal of linknamed external modules #67709

zhangyunhao116 opened this issue May 30, 2024 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Proposal
Milestone

Comments

@zhangyunhao116
Copy link
Contributor

Proposal Details

Personally, I totally agree that the linkname is overused in the Go ecosystem, it is a heavy cost for users to update dependencies when they use the latest Go release.

From the perspective of a Go developer, the overuse of linkname will make some experimental features from Go hard to test and become unstable, for example, if I change some internal functions, some programs will even panic.

From the perspective of a Go library author, I developed the fastrand library (https://github.com/zhangyunhao116/fastrand) because the math/rand is unscalable. Since Go 1.22 was released, the math/rand/v2 and math/rand are scalable, there is no need to use this library. So I upgraded the library to make it just a wrapper for math/rand/v2 for Go >= 1.22, and recommend new users use the standard library instead. This change won't break any existing projects that import it and is also compatible with all Go releases > 1.22.

We should focus on making the standard library faster and better instead of just exporting some unstable APIs if they don't meet the requirements.

I'm not sure if there is a way to remove these notable libraries from the comment. Hope it's a good beginning for preventing new use of the linkname.

Related to #67401

cc @rsc

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 30, 2024
@seankhliao seankhliao changed the title runtime: linkname comment proposal: runtime: eventual removal of linknamed external modules May 30, 2024
@gopherbot gopherbot added this to the Proposal milestone May 30, 2024
@ianlancetaylor
Copy link
Member

I'm sorry, but I don't understand what you are suggesting should be changed.

@zhangyunhao116
Copy link
Contributor Author

zhangyunhao116 commented May 31, 2024

I noticed that my repository is in the Go comment.

// - github.com/zhangyunhao116/fastrand

@ianlancetaylor ianlancetaylor changed the title proposal: runtime: eventual removal of linknamed external modules runtime: eventual removal of linknamed external modules May 31, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/589555 mentions this issue: runtime: remove zhangyunhao116/fastrand from cheaprand linkname comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Proposal
Projects
None yet
Development

No branches or pull requests

3 participants