It's amazing how Go caught on. It's not well designed -- lots of special cases reserved just for the compiler, some bizarro decisions, etc. It's not modern (with the possitive associates of modern, not fadish, and modern being "the last 30 years of experience" which is still like a millenium in IT years). It's implementation is not great either. Not a very good compiler, not a very good GC, not good tooling. My theor…
> It's easy to get started with, and made converts from scripting languages feel empowered, as if they were "real programmers" writing C, what with "pointers" and static types. What is wrong with this? Exposing people to pointers and static types might give them confidence when writing or reading in "real programmers" code in C I find the level of sneery nose turning in this thread quite abhorrent to be honest.
A year with Go
161–170 of 235 posts
Re: A year with Go
#162I think the author gets closest to the mark in the Conclusion, but still falls short. Go is very attractive as an "upgrade" from Ruby/Python or Java. It's a good replacement for the interpreted languages when speed/performance matters and it makes the async paradigm feel much more accessible. And compared to Java, the fact that Go compiles to a native binary is a huge benefit. It's not a replacement for C or a good "…
Java has multiple native code compilers, how is it a benefit when Java can do the exact same thing? (FWIW I learned recently that C# also has at least one native code compiler).
Re: A year with Go
#163Earlier quoted context omitted.
Things get ugly when your code grows. I had cases where I started with passing pointers to structs around directly, but at some decided that having dedicated interfaces would be better. But as soon as you're talking interface, pointers don't work as expected anymore, because Go (at least that's how I'm explaining it in my head) passes magic interface values to functions. So you can't just change `func foo(s MyStruct)…
One of the most unhelpful things about Go's pointer syntax is that it collides with HN's italics syntax. Hence, in your second paragraph, i see declarations which differ only in the slope of the type. Really, does nobody think of this when designing a language?
Re: A year with Go
#164Earlier quoted context omitted.
You can do that by storing `Box ` in your vector. In fact, that's the equivalent of what Go does in your example.
That's fantastic to know. I might just switch back to rust because of this.
For more information on that, check out "trait objects" (http://doc.rust-lang.org/book/trait-objects.html).
The gist of the issue is this: a Vec (and most other collections) needs all items to be sized and of the same size in-memory to lay itself out (know how much memory to reserve for each item for instance), and it stores its stuff inline. So a Vec's buffer looks like this:
[u8|u8|u8|u8]
and a Vec for a struct { u8, u32, u8 } looks like this (ignoring padding): [u8,u32,u8|u8,u32,u8|u8,u32,u8|u8,u32,u8]
If you want to store both A and B inline in a Vec you've got trouble: that they both implement Foo doesn't mean they have the same size at all (and they often don't), and Rust's type system doesn't allow it anyway (`A: Foo` says that A implements Foo, but the function or collection still gets an A via reification and monomorphisation).The alternative is to do what languages Java or Go do under the covers: add a fixed-size pointer as indirection between the collection and the actual items (the pointer is actually fat, you get a pointer to the instance itself and a pointer to the vtable for the trait implementation, I think Go does the same but java doesn't as each instance has its classpointer), so you get e.g.
[&A|&A|&B|&A]
all pointers are the same size and things work out. More generally than trait objects, you need to do this to store any unsized type (http://doc.rust-lang.org/book/unsized-types.html) in something which only accepts sized types.Re: A year with Go
#165The point isn't about learning something new. It's about trying to apply those things into a language they think is easier to work with.
I'd argue the point is the opposite of learning new things. As the Go team themselves say, Go is an engineering project. It's about sticking to well understood, well defined ideas that allow large teams of typical skill to develop and maintain good software. Go is boring compared to some other languages that push the envelope and try new things. But that can be a good thing if you start thinking like the business own…
Re: A year with Go
#166Earlier quoted context omitted.
In some ways, this is correct. Go is much more simple and consistent than Ruby or Java, has a better deployment story, and better tooling in some ways. As a language, it's much less enjoyable to write. Yes, the concurrency primitives are much better, and that's a good programming tool. But to a developer coming from Ruby, code is often needlessly repetitive and obtuse to write. It ends up being overly verbose, full o…
"code is often needlessly repetitive and obtuse to write." I think it helps to remember that Go's use case is a lot of teams interacting to produce fairly large code bases, i.e., at Google. I'm getting into it for my job because it has the same use case, and I find it hits a nice sweet spot in what you can do, vs. what you can't do, and I happen to be in a position in which I am routinely hit hard by other people's "…
Re: A year with Go
#167Funny how HN was on the Go bandwagon just a few years ago, and now an article like this is almost unanimously upvoted (without much contrarian discussion(!)). I contributed to Go in the early phases and I really enjoyed using it and learning it, but I found myself going to either Java if I wanted to write something for production or Node if I wanted to write something as a prototype. Unfortunately, I haven't used it…
The HN guidelines were changed (or defined more precisely...) and many people might shy away from posting negative comments about submissions.
I have to compliment the author on omitting complaints about lack of generics.
Re: A year with Go
#168Earlier quoted context omitted.
How so ? It takes minutes to install it. Just download it, copy it and set JAVA_HOME to make it easier for other applications. I've done this on hundreds of servers during my lifetime and never once had an issue.
Oh, look, there's already an antique jre installed on my os, not compatible with the particular jre needed by this application, which I first need to uninstall. And then hope that it doesn't break anything else in the process, because I haven't been following the minutae of java development environments for the last n+1 years... I think it falls solidly in the "easy if you know it, and a wasted q hours if you don't"…
Re: A year with Go
#169Funny how HN was on the Go bandwagon just a few years ago, and now an article like this is almost unanimously upvoted (without much contrarian discussion(!)). I contributed to Go in the early phases and I really enjoyed using it and learning it, but I found myself going to either Java if I wanted to write something for production or Node if I wanted to write something as a prototype. Unfortunately, I haven't used it…
Most Gophers just get tired of defending against the same arguments over and over. At least this guy actually used it for more than an afternoon... Though anyone who says they don't understand go's pointers after that length of time is a somewhat questionable source. I've been using go full time for two years and love it.
Tip: you're not required to be a defender/evangelist.
Re: A year with Go
#170There is nothing special about Go. It's simple and just works.
Every time I used Go for a project it just worked. No fuss. With very little effort. And that's the point.