Live data from Hacker News

Learning Golang – From Zero to Hero

milapneupane.com.np

51–60 of 76 posts

Re: Learning Golang – From Zero to Hero

#51

Such a great language. If only it had a good GUI library...

This looks interesting.

https://wails.app/

Also there are ways to talk back and forth with Electron for front end.

Full disclosure, have not tried either but just looking around as I get into Go.

I do a lot of web dev so like idea of HTML/JS for front end. I know I know, Electron is awful but maybe less awful if it's light?

Re: Learning Golang – From Zero to Hero

#53
post #8

Earlier quoted context omitted.

I agree. I would guess the "why" is that Rust is capable of everything that Golang is capable of, except more and better. Not to mention that Rust has a very supportive community to help each other.

I would disagree. Rust and Go occupy very different spaces. This is like saying "skip the car, take a rocket ship." Sure, Rust will go faster in some circumstances, but it's a hell of a commitment.

>This is like saying "skip the car, take a rocket ship."

That's exactly what it is like saying. Sure, some people might not want a rocket ship. That's fine. But that is the logic behind "skip go, take rust".

Re: Learning Golang – From Zero to Hero

#54
post #39

Such a great language. If only it had a good GUI library...

I have made very good experiences with the GTK bindings for go ( https://github.com/gotk3/gotk3 ). As the GTK Api is C-Based, it fits conceptually very good to Go. Actually I consider the Go bindings even better than using GTK from C, as the thin object model GTK uses, translates well to Go structures, most functions become methods on those structures. And the Go garbage collector solves the memory handling of the GT…

I mostly have too, but GTK itself is a bummer. Doing most any interesting thing is a ton of work.

Re: Learning Golang – From Zero to Hero

#55
post #41
post #24

Earlier quoted context omitted.

Vague statements like this contribute nothing to the conversation. Specially when they go against data https://www.jetbrains.com/lp/devecosystem-2019/ > Go - The most promising programming language. Go started out with a share of 8% in 2017 and now it has reached 18%. In addition, the biggest number of developers (13%) chose Go as a language they would like to adopt or migrate to. And this https://research.hackerrank…

Not really defending the vague statements of the person you're replying to, but I'd take those surveys with a giant grain of salt. There's just too much selection bias at work. I for one struggle to imagine how any company could ever induce me to take one of these surveys, and I doubt I'm that special a snowflake. 49% of devs have used python in the last 12 months? And 50% java? Huh? Who are these people? Probably th…

Fully agree, but I find surveys better than intuition.

On that matter you'll find plenty of Rust advocates referring to SO's survey stating it's the most loved language. They will however try to downplay surveys which report that Go's adoption is far superior and distancing.

With that said I find comparing Go and Rust an exercise in futility since the usecases rarely intersect.

Re: Learning Golang – From Zero to Hero

#56
post #7

This[0] is the best way I've seen to learn Golang. It's exactly what I needed to make things stick and make sense. 0: https://quii.gitbook.io/learn-go-with-tests/

I have to second this as well. What’s even better is if you require more detail on a subject, there’s often a link to another well-written, detailed Go article.

Re: Learning Golang – From Zero to Hero

#57

Earlier quoted context omitted.

> You don't get simple methods like insert(index,item). This is by design, to lift the CPU and allocation costs to the foreground. You can argue that was a bad design decision, but it wasn't an oversight, as you imply in the OP.

So the AOT makes that more difficult I'm guessing? I think that go does heavy lto so shouldn't inlining at link time give the same opportunity for that? Java's escape analysis has always been dodgy to rely on. I've had some very simple code when I couldn't for the life of me figure out why the allocations weren't being hoisted. So I don't know if gos is better or worse. It most definitely was not an oversight, clearl…

I’m pretty sure Go does not do any LTO at all.

Re: Learning Golang – From Zero to Hero

#58
post #9
post #8

Earlier quoted context omitted.

I agree. I would guess the "why" is that Rust is capable of everything that Golang is capable of, except more and better. Not to mention that Rust has a very supportive community to help each other.

After using Rust for about a year on the side, I get the feeling that it's not quite mature enough yet in some places. On the other hand, I also get the feeling that the development of the language itself has been measured and careful which could also be seen as a bit slow. On the other hand, I hear good things about Go across lots of people I work with although I've yet to sit down and give it a meaningful try. But…

> But I also have concerns about the maturity of a language who has jumped to V2 in what seems like a relatively small amount of time.

Where can I download Go v2? Latest is tagged 1.13beta1

Go authors stated multiple times that there are no plans for a Go 2 at the moment. They rather improve the language in small increments breaking as least as possible.

Re: Learning Golang – From Zero to Hero

#59
post #24

Earlier quoted context omitted.

Vague statements like this contribute nothing to the conversation. Specially when they go against data https://www.jetbrains.com/lp/devecosystem-2019/ > Go - The most promising programming language. Go started out with a share of 8% in 2017 and now it has reached 18%. In addition, the biggest number of developers (13%) chose Go as a language they would like to adopt or migrate to. And this https://research.hackerrank…

It's "vague", because it's a statement about the future. Unfortunately I don't have data from the future, but I do have a good intuition about the future trends ;)

The only way to know that you have previously had 'good intuitions' about the future would be if you recorded them (memory doesn't cut it) and then compared them with a subsequent events. Then you'd have to find a way of demonstrating that past intuitive success is an indicator of future intuitive success. Unless you've done all this, you only have an intuition that your intuition for future trends is good.

It's intuition all the way down.

Re: Learning Golang – From Zero to Hero

#60
post #47

Earlier quoted context omitted.

The default mode is already `auto`, which checks if you're within GOPATH (if GOPATH is set) and defaults to mod if you're not.

don't know this, thanks! I also assume you no longer need set GO111MODULE=on anymore

That depends -- it defaults to "auto" which means that its enabled outside of $GOPATH but disabled inside it. If you're working on a project that makes use of "go mod vendor" and is built from within your $GOPATH (which is true of quite a few free software Go projects) then you'll need it.
Post reply on HN