News for hackers. Stuff that matters.
Re:Sub-millisecond GC pauses in Go 1.8 by PeCaN on Friday October 28, 2016 @10:13PM (#12822260)
The compiler provides you no help at all with them, and no syntax that makes error conditions and handling separate. It also mixes application logic and recovery logic.

Basically everything that's problematic with returning a status int in C, but all new, hip, and backed up by Rob Pike's pseudointellectual bullshit and a bunch of Silicon Valley 20somethings.

They could at least, you know, have an Either type or something. Anything?

Re:Sub-millisecond GC pauses in Go 1.8 by leaveyou on Saturday October 29, 2016 @07:15AM (#12823496)
>It also mixes application logic and recovery logic.

When did this separation become law ? What if the "application logic" requires recovery ?

>They could at least, you know, have an Either type or something

(int64, error) in func ParseInt() (int64, error) is your Either type. And checking if you got the "left or the right side of the Either" is IMHO much shorter and clearer than in Scala.

https://golang.org/pkg/strconv/#ParseInt

http://www.scala-lang.org/api/rc2/scala/Either.html

>backed up by Rob Pike's pseudointellectual bullshit and a bunch of Silicon Valley 20somethings

Why the ad hominems ?

Re:Sub-millisecond GC pauses in Go 1.8 by premium-concern on Saturday October 29, 2016 @09:48AM (#12823906)
cringe.

How ecactly is having to check twice the amount of cases an improvement (note btw, that checking for Left/Right is doing it wrong)?

Re:Sub-millisecond GC pauses in Go 1.8 by weberc2 on Saturday October 29, 2016 @11:17AM (#12824289)
You only have to check 1 case in Go (`if err != nil { ... }`). What language lets you check half a case?
Re:Sub-millisecond GC pauses in Go 1.8 by premium-concern on Saturday October 29, 2016 @12:29PM (#12824696)

  (int64, error)
gives you exactly four possibilities.

Either gives you exactly the two you want.

Re:Sub-millisecond GC pauses in Go 1.8 by weberc2 on Saturday October 29, 2016 @01:52PM (#12825258)
Please feel free to enumerate them.
Re:Sub-millisecond GC pauses in Go 1.8 by premium-concern on Saturday October 29, 2016 @02:00PM (#12825311)

  (value, no error)
  (value, error)
  (no value, error)
  (no value, no error)
Re:Sub-millisecond GC pauses in Go 1.8 by leaveyou on Saturday October 29, 2016 @03:22PM (#12825809)
The convention is that if the err == nil then the value is not nil. The exceptions to this rule are very few and usually specified in the documentation. Normally you only have to check for error.
Re:Sub-millisecond GC pauses in Go 1.8 by bluejekyll on Saturday October 29, 2016 @06:07PM (#12826687)
The fact that it's a convention, and not a compiler error is the entire issue at debate here.
Re:Sub-millisecond GC pauses in Go 1.8 by weberc2 on Saturday October 29, 2016 @04:20PM (#12826130)
There is no "no value" representation for int64. The only two cases are "<int64>, nil" or "<int64>, <error>".
Re:Sub-millisecond GC pauses in Go 1.8 by pjmlp on Saturday October 29, 2016 @05:28AM (#12823281)
Yes, but at least they are making the tools we may eventually have to rely on due to market pressure (Docker, K8s, ...) in Go instead of C.
Re:Sub-millisecond GC pauses in Go 1.8 by Artemis2 on Friday October 28, 2016 @10:23PM (#12822295)
Don't forget Brian Kernighan and Ken Thompson!