3 ms·
I'm a bit surprised that the Go team did this. They already have a Go code generator for Google protocol buffer marshaling code. (https://github.com/golang/prot
by Animats 12y ago
I'm a bit surprised that the Go team did this. They already have a Go code generator for Google protocol buffer marshaling code. (https://github.com/golang/protobuf https://github.com/golang/protobuf) This new generator scheme doesn't seem to be suitable for integration with that.
(Why does every language now have to come with its very own build/packaging environment, with its very own directory structure conventions? Go has one, Rust has a different one, Java has several, and a new one for Python was discussed here yesterday.)
- dsymonds 12y agoThe protobuf code is a concrete instance of a code generator. `go generate` is a general mechanism for triggering a code generator. They are complementary, and you could imagine the former using the latter.
- twotwotwo 12y agoI'd guess Go has one to avoid ending up with several like Java, to do Go-specific things like extract the dependency graph from the source code, and to have one fewer dependency on the platform--I don't know much about how you build on plan9 or Solaris, I know go build is the same program on each. That said, go tools are canonical but not mandatory. If switching to this doesn't work for the protobuf foks, it's simple enough not to switch.
- twotwotwo 12y ago(and as dsymonds points out, go generate is not a replacement for a code generator, so "switch" isn't even the right word.)