News for hackers. Stuff that matters.
Re:Golang: Don't be afraid of makefiles by leggomylibro on Wednesday September 20, 2017 @12:19PM (#15295493)
Yeah, that is what turned me off of Golang. It was kind of a "straw that broke the camel's back" thing, though. Go is just an EXTREMELY opinionated language, and if you don't like that then you won't like it. The Best Way to do everything is decided for you ahead of time, which irks me because it isn't always true. But I can see the frustration it grew from when I use a language like Ruby, which has a half-dozen nearly-identical ways to accomplish most simple tasks.

Anyways, you could muck around with symlinks and crap, but come on. If I can't simply mkdir/vim/compile/run a 'hello world' program, there's probably something wrong with the language.

Re:Golang: Don't be afraid of makefiles by weberc2 on Wednesday September 20, 2017 @12:48PM (#15295814)
> If I can't simply mkdir/vim/compile/run a 'hello world' program, there's probably something wrong with the language.

Like this?

`cat $HELLO_WORLD_PROG > /tmp/hello.go && go run /tmp/hello.go`

Re:Golang: Don't be afraid of makefiles by leggomylibro on Wednesday September 20, 2017 @02:17PM (#15296704)
Yeah, like that!

But you know what I mean; multiple scattered workspaces, project folders on removable storage, etc. That sort of thing should be painless.

Re:Golang: Don't be afraid of makefiles by weberc2 on Wednesday September 20, 2017 @02:56PM (#15297072)
I've definitely had some other minor pain points with GOPATH, and I hate when veteran users of another language trivialize my pain points with their language, but I think all of the use cases you've described are all well within GOPATH's wheelhouse:

export GOPATH=$HOME/go:/media/USB-DISK:/foo/bar/baz

Now Go can find any projects in any of those workspaces. The only caveat is the projects have to be in a workspace, which is a directory with a src folder containing your project. I agree that this is a minor nuisance and I would design it differently, but Go's tooling is still far easier than pretty much anyone else's (it's actually what brought me to Go).

Re:Golang: Don't be afraid of makefiles by vog on Wednesday September 20, 2017 @04:19PM (#15297844)
> but Go's tooling is still far easier than pretty much anyone else's (it's actually what brought me to Go).

Really?

Maybe that's true if you compare it to PIP (Python), Gems (Ruby) or NPM (JavaScript/NodeJS).

But I think that Cargo (Rust) got it almost perfectly right, and Opam+Ocamlbuild (OCaml) is very close.

Re:Golang: Don't be afraid of makefiles by weberc2 on Wednesday September 20, 2017 @07:05PM (#15299152)
Some other languages that make Go's tooling look awesome: C, C++, Java

Cargo is comparable to Go's tooling in my mind (in terms of ease of use; I think it's better in other categories), but figuring out how to use libraries (mod vs use) and organize a multi file project is a notorious pain point with no analog in Go. This means it's harder to get started with Rust than Go (language features notwithstanding), which is pretty much what we're discussing here.

I don't really know what to say about Ocaml. I don't have much experience, but most of it has been bad. It seems like you're supposed to use Makefiles, and an Opam file. The more I learned the less I liked, and it seemed to be the consensus that the build tooling was one of the language's weak points. I will say that installing packages from Opam was a painless experience. The build tooling wasn't the only thing that drove me away, but it was right up there with the poor standard library, ecosystem fragmentation, and low-quality documentation. Which is a shame because the language features look great.

With Go, all you need to know to get started is "go get".

Re:Golang: Don't be afraid of makefiles by ernst_klim on Thursday September 21, 2017 @03:20AM (#15301179)
>poor standard library

What's wrong with containers, batteries and core?

>go get

Wow, once I've tried go the package management was utterly broken, even cabal hell looked better than this. What, no package versions? Downloading directly from git repo, are you kidding me?

Re:Golang: Don't be afraid of makefiles by weberc2 on Thursday September 21, 2017 @10:11AM (#15303574)
> What's wrong with containers, batteries and core?

Well, between those three and the actual std lib, there are four standard libraries, which defeats the purpose of having a standard library.

> Wow, once I've tried go the package management was utterly broken, even cabal hell looked better than this. What, no package versions? Downloading directly from git repo, are you kidding me?

`go get` isn't a package manager. Go's solution to dependency management is vendoring, which has its own suite of problems, but my comment was about getting newbies off the ground, and for that `go get` is suitable.

Re:Golang: Don't be afraid of makefiles by kmicklas on Wednesday September 20, 2017 @01:14PM (#15296073)
If by opinionated you mean it ignores everything that has been learned in the last 5 decades then yeah.
Re:Golang: Don't be afraid of makefiles by cobookman on Wednesday September 20, 2017 @01:44PM (#15296382)
It's how Google does development. There's some big wins by having a mono repo for a large organization. It's a pita though for smaller projects
Re:Golang: Don't be afraid of makefiles by iainmerrick on Wednesday September 20, 2017 @02:16PM (#15296703)
I don't think Google uses the standard Go conventions.

They use their build tool Blaze which I assume is very close to the open-source version, Bazel. Here's how Go works in Bazel: https://github.com/bazelbuild/rules_go