Live data from Hacker News

Seven years of Go

blog.golang.org

211–220 of 318 posts

Re: Seven years of Go

#211
post #209
post #205

Earlier quoted context omitted.

Since when is powerful reflection a drawback or a sign of a broken language? In my experience reflection is not used all that often in Go and it's nowhere near as powerful as say .NET or JVM reflection - which means package private stuff stays package private, unlike the JVM where the JIT must assume that any type can change at any time. Go has its quirks, and many design decisions that I find dubious, but so does ev…

> Since when is powerful reflection a drawback or a sign of a broken language? When it is not balanced by an expressive type system, it becomes a cop-out where anything goes,including creating adhoc types at runtime ( reflect.StructOf() , reflect.SliceOf() , ... ), because it's the only way to get a little bit of expressiveness of out that language.

If you're doing that all over the place, you're doing it wrong. I've never seen Go code that looks like that in real projects.

Re: Seven years of Go

#212
post #98

Earlier quoted context omitted.

Efficient concurrent programming. I'm not aware of any cross-platform C/C++ or Python libraries that give you async I/O + multi-threaded coroutines. Such a library exists for the Java ecosystem (quasar), but IIRC, it's enabled by clever bytecode tricks, so it's not built with vanilla Java. Further, you still have to take care not to use any libraries that are incompatible with this concurrency model (e.g., anything t…

What about http://libmill.org ? There are also numerous other programming environments with similar constructs.

Not cross platform last I checked.

Re: Seven years of Go

#213
post #182
post #168

Earlier quoted context omitted.

> If you're such a poor programmer, No need for personal attacks. > then just find a different language. What a warm an welcoming community the Go community is /s C++ doesn't have reflection, because it doesn't need it. But somehow Go needs it ? Reflection is a cop-out, especially in a language that has a simplistic type system. And don't get me started on struct tags. If you cant see the obvious issue with all these…

Gotta tell ya, criticizing Go for lacking generics, which Go supporters argue are unnecessary, while simultaneously arguing that C++ doesn't have reflection because it "doesn't need it" is ironic in the extreme.

Very few Go supporters would say that generics are unnecessary, especially not the development team. But they are not required at any price and so far no good solution for implementing them has been found. So they are delayed until that day.

While I miss them certainly, I strongly prefer them being absent to a bad and complex/confusing implementation.

Re: Seven years of Go

#214
post #61

Earlier quoted context omitted.

Even writing Postgres functions, you're still writing the same basic SQL statements (for the 80% of your database interactions that are essentially CRUD) over and over again. People used to defend writing things in assembly language for similar reasons, as a way of getting more machine sympathy. I'm not buying it.

We prevented the grossness of writing things over and over again by just using Golang's script generation and some other stuff. http://github.com/spacemonkeygo/dbx .

Also see https://github.com/go-reform/reform for a stable implementation of a similar idea.

Re: Seven years of Go

#215

Earlier quoted context omitted.

> Precisely as I said, "The only major benefits over, say, C++ or Java (which I don't think are very impressive languages) are a few convenient threading primitives" I commented before your edit. The question I responded to was something like "What can you do in Go that you can't do in C++ or Java?" > 99% of projects don't need green threads. Perhaps not need , but many of those projects are paying a large opportunit…

> And good luck finding Haskell and Erlang developers. Unless you need a massive number of developers, or you're located out in the middle of nowhere, it really shouldn't be too difficult.

I disagree.

Re: Seven years of Go

#216
go is my favorite language period, apps that i write in go seem more stable, easy to maintain because the syntax is quite concise, and the performance of the code seems quite good.

my language history is basic, turbo pascal, c, java, perl, python, javascript, ruby, nodejs, go, swift.

what i really dont like about go or havent mastered yet about the language are error handling and interfaces. error handling forces these oblong parts of code where you check if err is not nil and then do something, that part makes the code look a bit verbose, but i like most other things about the language where i bear and grin.

gobyexample.com is an excellent resource for learning go. i have used go as a restful api backend, a websocket service, and static site generator, all pretty solid code with no errors. i used to run ror and found that not having a good orm at first made programming db apps annoying, but i learned sql syntax long before using orm's and it was just fine.

i have to admit that html templating languages are not that great (ace, amber), but workable.

go apps when written correctly run fast and efficiently.

Re: Seven years of Go

#217
post #66

Earlier quoted context omitted.

Wrapper functions are not the same as full blown ORM. For every heavily used ORM features, there's an opportunity to fall into a trap, e.g N+1, because the surface area of an ORM is wide. In contrast, wrapper functions are low cost, easy to write, and recognizable because you write them yourself.

> In contrast, wrapper functions are low cost, easy to write, and recognizable because you write them yourself. Isn't saying that you should use functions that are "recognizable because you write them yourself" basically saying "you shouldn't use libraries?" This seems like the obvious NIH fallacy.

Not necessarily. It could also mean that these functions are more specific, have names that make sense in the concrete context and don't have any unnecessary parameters you need to think about. When it comes to ORMs it's even worse. They are often not libraries but frameworks with tons of non-local settings and state you need to know about (or else...).

Not invented here also means not invented for the specific task at hand but for a much more general set of use cases. In my view it's a trade-off, not a fallacy.

Re: Seven years of Go

#218

Earlier quoted context omitted.

> Overall though, Go is probably still the more practical choice between the two languages (due to Rust's incredibly high barrier to entry). Does Rust really have an "incredibly high barrier to entry?" I've been using Rust for a few months, and just deployed my first high-throughput application a month ago, and my experience has been the opposite. Yes, the first couple of weeks were a bit rough while I was getting us…

> Yes, the first couple of weeks were a bit rough while I was getting used to the ownership system, but since then I have been progressing at a relatively quick pace. This is the very definition of "high barrier to entry". Clearly it wasn't too much of a barrier for you but I can see how it'd be an issue for people. I'm expecting editor support and wider adoption (differently constructed tutorials, SO answers) to low…

I can see that, but a couple of weeks of investment doesn't seem "incredibly high" to me.

Re: Seven years of Go

#219

Earlier quoted context omitted.

I miss generics, not because I would write new generic functions all the time, but because a few key generics provide infrastructure that increases the beauty of programs dramatically. The tupled (T, error) return types are a key area I think generics would help. The error-tuples themselves aren't the problem, but rather Go's inability to cleanly handle them. Threading error state around requires repetitive glue code…

I miss generics, not because I would write new generic functions all the time, but because a few key generics provide infrastructure that increases the beauty of programs dramatically. The problem is this: Have you ever worked in a mature codebase with generics, where they haven't somehow been overused? Please tell me where that is!

As opposed to codebases that abuse interface {} and reflection ? I'd take the complexity of generics over this.

Re: Seven years of Go

#220
post #211
post #209

Earlier quoted context omitted.

> Since when is powerful reflection a drawback or a sign of a broken language? When it is not balanced by an expressive type system, it becomes a cop-out where anything goes,including creating adhoc types at runtime ( reflect.StructOf() , reflect.SliceOf() , ... ), because it's the only way to get a little bit of expressiveness of out that language.

If you're doing that all over the place, you're doing it wrong. I've never seen Go code that looks like that in real projects.

> If you're doing that all over the place, you're doing it wrong. I've never seen Go code that looks like that in real projects.

Yet it is there in the language. Why is that? how do you justify adding this to a statically typed language?

Post reply on HN