15 points · by laurent123456 · 13y ago · 22 comments
Syntax errors:
"Firstly, the source simply doesn't compile."
Performance problems: "...it's horribly slow."
Bad version control: "... the original code [has] ... potentially significant differences"
Those sorts of mistakes seem consistent with the type of coder who wouldn't set aside the 3 minutes it takes to understand Go's dependency system and either use it correctly or build a super-simple makefile to pull the correct versions of code from elsewhere.Also, pedantic but worth noting: Golang is not the name of the language.
Also, just because it doesn't work the way NPM does doesn't mean it doesn't work.
[1] http://golang.org/doc/code.html#remote
[2] http://golang.org/cmd/go/#hdr-Remote_import_path_syntax (linked from [1])
* Go 1.0 had a terrible GC, especially on 32-bit platforms (their target platform)
* No manual memoray management (and unlikely to ever exist)
* Can't bind to C++, can't cross-compile cgo (gccgo can though)
Go is really cool, and I use it every day, but it doesn't make any sense for games, especially not for their target platform. Maybe in a few years the GC will be more reliable, but I wouldn't try to build a game in Go if I thought I might want to try to sell it.
I would say that "new and not well supported" makes this a potentially bad choice for shipping code. Not to say that it can't be used but the problem with new technologies is that not all warts have been properly exposed and you can open yourself up to major headaches.
"Original author didn't localize dependencies, obviously caused problems."
Remote packages in Go are like DLLs for other languages. Yes, if you edit a DLL locally, and other people download the public version of that DLL, they won't be the same. DON'T DO THAT.
Make your own copy of the public Go repository, so you can merge in changes from the main branch as you see fit. This is akin to making a copy of the DLL and using that to distribute with your code, rather than just telling people "go download the newest version of the DLL from github".
It's also good practice for go authors to keep any one repository backwards compatible, make it clear when the code is in flux and may have breaking changes... and to make new branches if they have to make significant changes to their code.
Of course it does! All they had to do is fork the project (which they have) and reference that it instead. Viola, problem solved!
You don't bet your production software on things randomly downloaded from the internet at compile time. This is why go never auto-updates when you do "go get", you have to explicitly use "go get -u".
Always localize what you depend on, you never know when a github repo could be pulled, go offline, be renamed, a lawsuit could break out making the library vanish. There are TONS of reasons you should ALWAYS localize your dependencies for building software.
EDIT: This has the amazingly cool side-effect of meaning even on complex projects, you can just do a git clone and then go build FOO and it just works, no nonsense, no fuss, and it is EXACTLY in the state it was when it was checked in -- no surprises.
While that is true, it doesn't solve the problem with distributed teams. The library path MUST be pointing to a 'localized' repository to solve the problem the Haunt guys are having.
When you have import "github.com/gorilla/mux"
it will look in
$GOROOT/src/pkg/github.com/gorilla/mux and $GOPATH/src/github.com/gorilla/mux
if it is missing, you can fulfill it with
go get github.com/gorilla/mux which will place it in the first place in $GOPATH
What are you talking about breaking with distributed teams? Since $GOPATH/src/github.com/gorilla/mux is in source control you NEED NOTHING and it will be a known working git clone.
EDIT: Additionally, it will never auto-update those dependencies (and break your build) unless you explicitly tell it to with "go get -u".