Readit News logoReadit News
crtc commented on Show HN: Go Plan9 Memo   pehringer.info/go_plan9_m... · Posted by u/pehringer
crtc · 10 months ago
https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs since the author seems to be confused in this regard.
crtc commented on Stop Building on Corporate-Controlled Languages   blog.deckc.hair/2023-01-1... · Posted by u/nandalism
JustSomeNobody · 3 years ago
I'm confused. When I go get ... is it "phoning home" to Google? I could wireshark it, but since we're all here...
crtc · 3 years ago
It accesses the module proxy proxy.golang.org, which is run by Google. If you want to opt-out of this module mirror, you can turn it off by setting GOPROXY=direct.

The proxy has a clear privacy policy: https://proxy.golang.org/privacy It collects anonymized usage metrics like other package registries (rubygems.org, nuget.org, crates.io) do.

crtc commented on Stop Building on Corporate-Controlled Languages   blog.deckc.hair/2023-01-1... · Posted by u/nandalism
mseepgood · 3 years ago
Which package management system doesn't do this?
crtc · 3 years ago
True, I quickly checked

https://rubygems.org/

https://www.nuget.org/packages

https://crates.io/

... they all show download statistics of their packages.

Deleted Comment

crtc commented on Evolved Virtual Creatures (1994)   karlsims.com/evolved-virt... · Posted by u/sirnicolaz
crtc · 3 years ago
His name is really Sims?
crtc commented on Go 1.18   go.dev/blog/go1.18... · Posted by u/mjlee
drdaeman · 3 years ago
Not for me. There is no ?: ternary operator. Having to write 6 additional lines of code for each tiny conditional sucks. It's not frequent, I think I've only had a single case in a few years where I had difficulty working around, but when it happens - it's not fun.

  err := h(cond(x) ? f(x) : g(x))
vs

  var temp T
  if cond(x) {
    temp = f(x)
  } else {
    temp = g(x)
  }
  err := h(temp)
Hopefully, this can be improved with generics, e.g. now it should be possible to create e.g. `func Coalesce (type T) (...args T) T` function to simplify common scenarios.

crtc · 3 years ago
This is by design: https://go.dev/doc/faq#Does_Go_have_a_ternary_form

Ken Thompson added ?: to B / C and then he took it from us in Go due to the wisdom he gathered in between.

crtc commented on Go 1.18   go.dev/blog/go1.18... · Posted by u/mjlee
crtc · 3 years ago
Finally! This will be the last day I see the words "Go" "lack of"/"no" and "generics" in one sentence.
crtc commented on Generics facilitators in Go   rakyll.org/generics-facil... · Posted by u/throwaway894345
erik_seaberg · 4 years ago
Except that reflection-based tools work with methods but not functions.
crtc · 4 years ago
Yes, but reflection is part of the problem:

"And even that traversal is not sufficient in the general case when type reflection gets involved, as reflection might look up methods based on strings input by the user. So in general instantiating parameterized methods in the linker might require instantiating every parameterized method for every possible type argument, which seems untenable."

So methods with type parameters would a) not be usable with interfaces and b) not be usable with reflection.

crtc commented on Three Minor Features in Go 1.18   blog.carlmjohnson.net/pos... · Posted by u/throwaway894345
naikrovek · 4 years ago
where does one find a comprehensive list of new things for each version? the release notes never seem to know everything that people in here know.
crtc · 4 years ago
The release notes usually contain everything.
crtc commented on Generics facilitators in Go   rakyll.org/generics-facil... · Posted by u/throwaway894345
kubb · 4 years ago
I wouldn't call it lengthy, but if anyone is wondering, the proposal points out that parametrized methods don't have an obvious behavior _inside interfaces_. No mention of why they left them out in non-interface types.
crtc · 4 years ago
> No mention of why they left them out in non-interface types.

Actually it does:

"Or, we could decide that parameterized methods do not, in fact, implement interfaces, but then it's much less clear why we need methods at all. If we disregard interfaces, any parameterized method can be implemented as a parameterized function."

https://go.googlesource.com/proposal/+/refs/heads/master/des...

u/crtc

KarmaCake day60November 29, 2016View Original