Live data from Hacker News

Go 1.13 Release Notes

golang.org

31–40 of 264 posts

Re: Go 1.13 Release Notes

#31
post #17

Earlier quoted context omitted.

I kind of wondered that myself. All the completely automatic marshalling using tags seemed like it assumes things are very nice (which they aren't when working with some of the terrible data sources I've seen). Everything else feels very cool to use Go though, I just used it on my first real project.

> I just used it on my first real project. Have you got any relevant advice I can take? Interested to hear how people feel about the language before I dive in.

Yes I do actually -- my best advice is to watch this course. It's hands down the best course I've ever seen (across any language, actually), and he jumps RIGHT into it, almost from a computer science aspect.

He doesn't talk about learning the language at all (he assumes you know all that), instead he fills in all the gaps in a very thorough way that are left out from all the tutorials and such you'll read. I've read dozens and dozens of Go articles while learning and I would say 85% of those 15 hours was NEW information to me, that's how good it is.

https://learning.oreilly.com/videos/ultimate-go-programming/...

There are 2 versions, I watched the older version because he's more lively in it, however I have heard the newer version is better because he does cover a lot more up to date tooling. I went and rewatched the section on debugging and structs on the new version.

For example, its 15 hour course, and in the literal first 5 minutes of the first coding video, he talks about struct field memory alignment on different CPU architectures. That's when I refilled my coffee and said 'dis gon be good'.

Aside from that, I would say pick a good project structure that works well, invest time time into researching the different ways (also covered in that course)

I also use go modules which are new, and make things way easier as far as packages.

Definitely make sure your editor has gofmt and goimports set to auto-run on save, those are lifesavers. Goimports is smart enough to look across packages and in your own package, which is cool

All the other suggestions about actually writing code is basically covered entirely in the ultimate go course (when to choose pointers vs structs, how to structure code, good error handling practices, etc)

Re: Go 1.13 Release Notes

#32
post #29

How does Go compare to Rust these days with respect to language maturity, community size and general maturity/availability of libraries? So far I've found Rust more interesting and pushes the envelope a bit more. But what is the sales pitch for Go?

“Go is to services what Rust is to systems.”

Would it be fair to say that Go's concurrency support makes it a good match in the network services space? I see Go more often in Docker and cloud contexts.

Re: Go 1.13 Release Notes

#33
post #14

I occasionally use Python for large-scale processing of structured data (XML, JSON) and the data's really messy as you'd expect (malformed responses, missing fields, normalisation, etc..). One of the things putting me off of Go for these kinds of projects is it's much more verbose/harder to handle edge cases - it feels like I'm less productive writing the program, but end up building something much more stable than t…

> is it's much more verbose/harder to handle edge cases - it feels like I'm less productive writing the program, but end up building something much more stable than the Python equivalent This is exactly how I felt moving from a Python codebase to Go. But you realize on the 100th or so Python stacktrace that it's worth the investment up front, if not for type safety alone. > I really need the performance for my worklo…

> on the 100th or so Python stacktrace

Go's not perfect in this respect, either. I had your typical map[string][]interface{}, because the data in the map was an array of records, but different records in different cases, and made an error in an append(), so ended up with nested arrays. That's correct according to the type definitions, but unwanted. Generic could have helped here. So I think the language still needs to grow a bit.

Re: Go 1.13 Release Notes

#34

I like the way Go proceeds as a language, with features added very very slowly and the compiler and tools regularly improving. I hope Rust can settle down into a similar focus soon.

Rust has a focus - it is articulated through the roadmap.

- 2018 roadmap https://blog.rust-lang.org/2018/03/12/roadmap.html

- 2019 roadmap https://blog.rust-lang.org/2019/04/23/roadmap.html

It's a big community, and it has time for a lot of development

Re: Go 1.13 Release Notes

#35
post #29

Earlier quoted context omitted.

“Go is to services what Rust is to systems.”

Would it be fair to say that Go's concurrency support makes it a good match in the network services space? I see Go more often in Docker and cloud contexts.

Rust has broadly the same concurrency support, with a more powerful compile-time race detector (but one that also comes with a learning curve). The main difference is that Go uses M:N threading, while Rust uses 1:1 threading with optional explicit async/await constructs.

Re: Go 1.13 Release Notes

#36

I actually just started to use go on windows just to check it out. First impressions from a newbie: - Getting started with go and vscode is kinda bad right now. I installed go, set up GOPATH, installed all kinds of extensions in vscode and then, somewhere down the official tutorial I learn about GO111MODULES, go mod init, vendor folders and the language server... I was completely confused and still am. I removed all…

> Why does go need := with the colon? I know it's a declaration, but I haven't figured out the reason for the colon.. Seems weird..

It's called a short variable declaration that can be used in place of `var` and the type is implicit.

    var s string
    s = "foo"
vs

    s := "foo"

Re: Go 1.13 Release Notes

#37
post #27

Earlier quoted context omitted.

Underscores are nice. 10 * 1000 * 1000 worked pretty well too.

Compile-time integer exponentiation in Go would be neat, e.g. 5 * (1000**4). I know we have scientific-notation integer literals, but it's not the same thing, especially when trying to calculate e.g. Mebibytes.

In go you can use scientific notation for integers

   var x int = 1e9

Re: Go 1.13 Release Notes

#38
post #8

Honestly, and I don't think I'm snarking (but would have to reflect a bit on it), "0b", "_", and signed shifts are probably going to make Go more pleasant for me than generics would have. This is my favorite release in years.

Hmm... do you really hardcode big numbers that often?

Re: Go 1.13 Release Notes

#39
post #38
post #8

Honestly, and I don't think I'm snarking (but would have to reflect a bit on it), "0b", "_", and signed shifts are probably going to make Go more pleasant for me than generics would have. This is my favorite release in years.

Hmm... do you really hardcode big numbers that often?

You mean, do I work with binary constants? Yes.

Re: Go 1.13 Release Notes

#40
post #36

I actually just started to use go on windows just to check it out. First impressions from a newbie: - Getting started with go and vscode is kinda bad right now. I installed go, set up GOPATH, installed all kinds of extensions in vscode and then, somewhere down the official tutorial I learn about GO111MODULES, go mod init, vendor folders and the language server... I was completely confused and still am. I removed all…

> Why does go need := with the colon? I know it's a declaration, but I haven't figured out the reason for the colon.. Seems weird.. It's called a short variable declaration that can be used in place of `var` and the type is implicit. var s string s = "foo" vs s := "foo"

I know. The question is, why does it need a colon? It seems completely superfluous, from a syntax perspective.
Post reply on HN