Live data from Hacker News

Go 1.13 Release Notes

golang.org

191–200 of 264 posts

Re: Go 1.13 Release Notes

#191
post #176

Earlier quoted context omitted.

> Small stacks (and M:N threading) are needed to efficiently implement tens of thousands of goroutines. Tens of thousands of threads are no problem with 1:1 threading on Linux. > They paid with slow threads. I would not call 1:1 threads "slow threads". If they were slow, then the 1:1 NPTL would have not defeated the M:N NGPT back in the day when this was being debated in the open source OS community. > complex rewrit…

> tens of thousands of threads are no problem with 1:1 threading on Linux Yes it's a problem, even on modern kernel, memory, context switch ... there is a reason why high performance code uses small thread pool.

Given the context, it's not a memory problem was implied, because small stacks are not actually relevant, because C stacks are not committed upfront (at least on unices, not sure about linux). So your threads are more likely to take up a page each (plus kernel datastructure overhead) than the 8MB allowed to a C stack.

Re: Go 1.13 Release Notes

#193
post #192

> The existing octal notation indicated by a leading 0 followed by octal digits remains valid. Oh my god why?

To not break go1 backwards compat?

Compatible with what exactly. No one uses octal.

Here is a link to Pike fucking it up 10 years ago.

https://github.com/golang/go/issues/151#issuecomment-6604830...

Re: Go 1.13 Release Notes

#194

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..

Without the : it means every assignment might be a declaration so you need a "declaration inference" system, and every language which does declaration inference has odd tradeoffs and corner cases e.g. implicit declaration in the local-most scope (Python), implicit method-wise non-local (ruby), implicit global (javascript), …

Explicit declaration is a very good decision I think. As far as I'm concerned it's one of Python's big annoyances (and javascript but there it's easy to lint away as you also have explicit declarations, you can just ban implicit ones).

Re: Go 1.13 Release Notes

#195
post #76

Earlier quoted context omitted.

It's to avoid typos. Imagine there is no colon. When you type foo = 3 fooo = foo + 1 Did you mean to create a new variable called `fooo` or was it a typo? Did you mean this: foo := 3 fooo = foo + 1 // oops, typo found at compile-time or that: foo := 3 fooo := foo + 1 // Yep, new var, everything is ok

Why not just have var foo = 1

[deleted]

Re: Go 1.13 Release Notes

#196
post #76

Earlier quoted context omitted.

It's to avoid typos. Imagine there is no colon. When you type foo = 3 fooo = foo + 1 Did you mean to create a new variable called `fooo` or was it a typo? Did you mean this: foo := 3 fooo = foo + 1 // oops, typo found at compile-time or that: foo := 3 fooo := foo + 1 // Yep, new var, everything is ok

Why not just have var foo = 1

That works actually.

The weirdness is that ":=" allows redeclaration (within a scope) but only partial, whereas `var` completely forbids redeclaration.

That is:

    var a, b = f()
    var a, b = f() // NO

    var a, b = f()
    a, b := f() // NO

    
    // note that the second declaration only partially overlaps with the first
    var a, b = f()
    var a, c = f() // NO

    var a, b = f()
    a, c := f() // yes

Re: Go 1.13 Release Notes

#197
post #134
post #130

Earlier quoted context omitted.

Why the odd one? D has been replacing the C++ code with D, .NET made a major reboot with Rosyln where VB.NET and C# got bootstraped (F# was already bootstrapped), OCaml and Haskell have only the runtime in C due to convinience with everything else bootstraped, FreePascal is bootstraped, OpenJDK has the long term goal of replacing C++ with Java/Graal, Jikes was bootstraped in Java, ...

You are misunderstanding me. I don't have problems with the fact that Rust is bootstrapped, but with the high rate this bootstrapping is happening. That a 12 week old compiler is already considered as too old to compile the newest rustc. This seems wrong.

Ah, yes that is indeed a bit too much.

I also agree an yearly baseline would be much better.

Re: Go 1.13 Release Notes

#198
post #174
post #128

Earlier quoted context omitted.

Installable binaries, around 2000, when the first commercial JDKs started having AOT compilation to native code. Currently available on PTC, Aicas, IBM, OpenJDK AppCDS (originally from BEA J/Rockit), GradleVM native images, Android ART AOT compilation. Dynamic heap size, since ever. Every JDK vendor had their own specific switches to configure it. Versioned modules, since Java 9 alongside Maven/Gradle. Value types, y…

Except that in the real world no one use installable binaries and everyone is embedding 150MB of JRE / JDK.

If that would be the case, the companies that sell commercial JDKs would be out of business, and yet here they are, selling Java tooling since around 2000.

Maybe you are referring to the "real world" where developers don't pay for their tools.

As for embedding 150MB of JRE / JDK, it is hardly any different than embedding the Go's runtime into every static compiled executable.

Re: Go 1.13 Release Notes

#199

Earlier quoted context omitted.

Strings are fixed-size, though. A string is a pointer and a length. It's true that you can't use a slice as a map key, though, even though slices are also fixed-size (pointer, length, and capacity). As I recall, the argument is that the equality rules for slices are unclear. (maps and funcs can't be used as keys either, for the same reason: they're not comparable.) Is a 0-length slice equal to a nil slice? Is a slice…

Maybe "fixed size" was the wrong way to phrase it. What I meant is that a string points to an unlimited amount of data and all of that unlimited amount of data is taken into account when deciding equality of strings. And my question should have been, is string the only datatype with that feature? If it is, it means Go is like Lua, where if you want to use any compound data structure as a key in a map, you either mars…

> In Python you are allowed to use tuples of immutable objects as keys

You can do this in Go too with structs.

Re: Go 1.13 Release Notes

#200

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..

I remember Rob Pike ever said that one if the reasons of needing := is to avoid declaring many error variables in a function, such as err0, err1, err2, ..., and at the same time we don't need declare then as uninitialized variables.

With :=, they can be all called "err".

Personally, I do prefer to try to avoid using :=.

Post reply on HN