News for hackers. Stuff that matters.
Re:Go 1.4 Beta 1 is released by Strom on Thursday October 30, 2014 @04:56PM (#8535768)
The encoding/gob package has been rewritten to eliminate the use of unsafe operations, allowing it to be used in environments that do not permit use of the unsafe package. For typical uses it will be 10-30% slower

This seems like a highly questionable decision to me. I've invested a lot of time into optimizing my code that uses encoding/gob, so to now get hit by a wholesale 30% slower stamp from the Go team is a bit weird. These environments that can't use encoding/gob with unsafe, can't be that common, however it seems that everyone will suffer from their limitations.

Re:Go 1.4 Beta 1 is released by kjksf on Thursday October 30, 2014 @07:33PM (#8536479)
Trivial solution: "fork" the old, fast version of std library code into its own repo and the only change you need is to import that repo instead of "encoding/gob"

I did that few times (mostly in the other direction, where I wanted features from unreleased version of Go)

Re:Go 1.4 Beta 1 is released by shurcooL on Thursday October 30, 2014 @09:17PM (#8536817)
> These environments that can't use encoding/gob with unsafe, can't be that common

They aren't, but I will provide one example that benefits from this change. As of 1.4, because of this change, it will be possible [1] to use encoding/gob (and other packages that import it) in the frontend via the GopherJS project.

[1] https://github.com/gopherjs/gopherjs/commit/7d67c77e85187c7f...

Re:Go 1.4 Beta 1 is released by pjmlp on Thursday October 30, 2014 @05:01PM (#8535795)
Maybe their target is the App engine.
Re:Go 1.4 Beta 1 is released by Strom on Thursday October 30, 2014 @05:10PM (#8535851)
It's true that you can't directly import unsafe in your own Go code on App Engine. However importing standard library packages like encoding/gob, which then proceed to use the unsafe package for themselves, works just fine on App Engine.

App Engine is actually the biggest reason why I don't immediately like this change. For other environments I can just fork the Go 1.3 encoding/gob implementation and use that. However on App Engine I can't import unsafe myself, so the only way to run really fast unsafe code, is to use the standard library. This latest change removes that option from me.

Re:Go 1.4 Beta 1 is released by enneff on Thursday October 30, 2014 @08:33PM (#8536677)
It's more that by removing the use of unsafe it will play more nicely with the new concurrent garbage collector (slated for Go 1.5 in June).
Re:Go 1.4 Beta 1 is released by pjmlp on Friday October 31, 2014 @04:51AM (#8537851)
Thanks for the heads up.

Are also there plans to expose more primitives in unsafe?

I remember seeing some posts related to possible required features as part of re-writing the whole stack in Go.

Re:Go 1.4 Beta 1 is released by duaneb on Friday October 31, 2014 @01:10PM (#8539837)
It would make more sense to me to have an safe but api-compatible library version that doesn't use unsafe.

Not a great sign for lib updates in the future.

Re:Go 1.4 Beta 1 is released by howeman on Thursday October 30, 2014 @08:36PM (#8536683)
They also found (and fixed) some bugs and the code will be more robust to future implementation changes.