You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
ianlancetaylor
changed the title
proposal: runtime: eventual removal of linknamed external modules
runtime: eventual removal of linknamed external modules
May 31, 2024
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, themath/rand/v2
andmath/rand
are scalable, there is no need to use this library. So I upgraded the library to make it just a wrapper formath/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
The text was updated successfully, but these errors were encountered: