Incorporate gopkg.in/yaml.v3 in the standard library as encoding/yaml

225 views
Skip to first unread message

Sylvain Rabot

unread,
Mar 21, 2023, 3:23:33 PM3/21/23
to golang-dev
Hello,

gopkg.in/yaml.v3 is a library heavily used is the Go ecosystem but Gustavo Niemeyer, its author, has no time left to maintain it anymore. There are a lot of Pull Requests which people would really like to see merged but remain un-answered.

Gustavo told me he is not against a change of maintainership but he would like an experienced team to take over. I don't see a better team than the Go core contributors for this and I think it would make sense to have yaml side by side with json in the standard library.

Thoughts ?

Regards.

Ethan Reesor

unread,
Mar 21, 2023, 6:08:23 PM3/21/23
to Sylvain Rabot, golang-dev
As a Go developer (not part of the Go team) who uses YAML, I would be happy to see YAML support in the stdlib, but the Marshaler and Unmarshaler interfaces of gopkg.in/yaml.v3 have always bothered me. Every other marshalling package (at least in the stdlib) defines the equivalent interfaces as Marshal<type>() ([]byte, error) and Unmarshal<type>([]byte) error. I can see the value of gopkg.in/yaml.v3's interfaces, but the asymmetry and Unmarshaler's dependence on a package type bothers me.

--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-dev/632c11b9-ee38-40ab-822c-babf508d62e2n%40googlegroups.com.

U Cirello

unread,
Mar 22, 2023, 12:38:02 PM3/22/23
to golang-dev
At the time when Brad F. was still part of the Go team, he had a shortened link to a spreadsheet that analyzed the reason of packages being part of the stdlib. I do not remember all the details of the conversation of the time, but I believe the gist was that, if anything, the stdlib should be small rather than large. 

I could see though, a version of an yaml parser being part of the extended library though (golang.org/x/encoding).

Every new package in the stdlib translates into more work back to the core team, and longer iteration cycles (as a change may not make in time for the merge window). The extended library doesn't suffer from this problem.

--

Rob Pike

unread,
Mar 22, 2023, 3:43:20 PM3/22/23
to U Cirello, golang-dev
Reply all
Reply to author
Forward
0 new messages