Skip to content

runtime: eventual removal of linknamed external modules #67709

@zhangyunhao116

Description

@zhangyunhao116

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions