News for hackers. Stuff that matters.
Re:On the uses and misuses of panics in Go by platinumrad on Thursday August 09, 2018 @04:22PM (#17728116)
I also prefer the option monad, etc. over returning (result, result..., err) tuples but terseness of error handling is as much a property of the language (i.e. operators, features, etc.) as it is a property of the type system. Consider the "try!/?" pseudo-macro from Rust. If Go had macros, there would be nothing preventing something similar from being implemented.
Re:On the uses and misuses of panics in Go by cesarb on Friday August 10, 2018 @06:29AM (#17732082)
> Consider the "try!/?" pseudo-macro from Rust.

On Rust, try! is not a pseudo-macro, it's an actual macro (which could be defined by anyone, since it uses only the public API for Result and From). Go to https://doc.rust-lang.org/std/macro.try.html and click on the [src] link at the top to see its current definition.

Re:On the uses and misuses of panics in Go by platinumrad on Friday August 10, 2018 @05:51PM (#17736988)
I called it a pseudo-macro because while "try!" is a macro, its usage is discouraged in favor of "?", which is an operator.
Re:On the uses and misuses of panics in Go by majewsky on Thursday August 09, 2018 @06:28PM (#17729101)
If Go had macros, it wouldn't have been as successful as it is. The appeal of Go is that it's both very readable and very writable, even if verbose.
Re:On the uses and misuses of panics in Go by bbatha on Thursday August 09, 2018 @09:03PM (#17729897)
Go already has code generation built into the standard tooling. It also has reflection which is arguably worse because the generated code is totally opaque. Good macros would cover most of the uses cases for the tools in a more cohesive and more tooling friendly way.