Live data from Hacker News

What Golang Is and Is Not

danmux.com

231–240 of 279 posts

Re: What Golang Is and Is Not

#232
post #111

Earlier quoted context omitted.

OTOH maybe we will be surprised by the name of first language with working compiler to web assembly.

Ohhh that would be amazing, have you got inside information that you can share?

No, it was just wishful thinking, based on "given the 1ML inventor's main job".

Re: What Golang Is and Is Not

#233
post #174

Earlier quoted context omitted.

> Go is a language that pushes remembering corner cases and failure conditions onto the programmer Can you elaborate on this? I write go for 3+ years and I have no idea what corner cases and failure conditions do you mean.

A corner case about Go which makes me absolutely crazy: calling Reset() on a timer which has already fired has the biggest gap between "What I expect to happen" and "What actually happens" of any stdlib I've ever worked with. https://gist.github.com/patio11/bc883d566778c323742432c203e6... (You can see it here in the playground, but try it on your local machine if you don't believe me and/or think the playground has a…

This particular issue is unfortunate - it can't be changed without potentially breaking existing programs.

See https://github.com/golang/go/issues/11513 and https://groups.google.com/forum/#!topic/golang-dev/c9UUfASVP... for some background.

Re: What Golang Is and Is Not

#234

I'm not a Golang programmer, but the mere fact that GOOG decided Java for android is convincing enough that even GOOG does not believe in its Go. (Frankly, I doubted that a little, until I realized Al-*-Go was not actually written in Go!)

Android predates Go. And it wasn't even started by Google.. Android was it's own company and had already made it's decision on Java well before Google decided to buy it. Not to mention Go is focused on a different use case. Go is gunning for microservices (with it's concurrency chops) and CLI based tools (being a single compiled binary).. whereas Android apps are a totally different beast that stands little to gain f…

> Android predates Go...

So? Apple introduced Swift after Obj-C to make developing iOS apps easier. What about GOOG? Couldn't they at least use Dart or Go (both of which they developed) for android app development after Java? BTW, last time I checked, they're still in for a lot to come from Oracle.

> Again, Al-*-Go was based off technology from ...

So let me get this straight. They bought a technology which was apparently written in C++/JS and rewrote it in another lang, but then again, they did not choose Go or Dart.

Seems like some one needs a wikipedia browsing...

Re: What Golang Is and Is Not

#235
post #231

Earlier quoted context omitted.

And yet there is a generic in array function.

...which is O(n). Unless the set is trivially small, better to coerce your data to key types and use array_key_exists().

I never said it was good, but it exists. Most of my PHP code utilizes kv arrays everywhere possible.

Re: What Golang Is and Is Not

#236
post #174

Earlier quoted context omitted.

> Go is a language that pushes remembering corner cases and failure conditions onto the programmer Can you elaborate on this? I write go for 3+ years and I have no idea what corner cases and failure conditions do you mean.

Examples that bother me sometimes. YMMV of course. Writing to a closed channel panics, but writing to a nil channel blocks forever. Appending to a nil slice works fine, but inserting into a nil map panics. If you have a function that returns an error struct, and you wrap it with another function that returns the error interface, nil returns from the inner function will no longer test equal to nil. Defining a method w…

What you describe is all true, but honestly, this is such a small number of corner cases compared to traditional languages(C, C++, python, javascript, etc.), that it is really not a big deal. Also most of this is clearly documented.

Re: What Golang Is and Is Not

#237

Earlier quoted context omitted.

As someone who writes Go every day for work, I can't agree that Go is simple. You may be confusing "simple" with "good". A simple solution to a complex problem may not be a good one. Go can be simple and still not a great solution because it pushes complexity to a higher level.

Go handles simple problems well but copy pasting more "simplicity" as complexity scales results in a complex program.

I'd say Go defines "simplicity" as "simple to write (good enough to run for non-critical parts)"

Re: What Golang Is and Is Not

#238
post #30

Earlier quoted context omitted.

Go (the language) have at least two implementations: the official Go implementation and GCC (yes, Go is included in GCC, along with Fortran and Ada). The latest Go implementation (Go 1.7) has made Go a lot faster. I would argue that it closer the speed of executables generated with GCC (gcc/g++) than OpenJDK, the Oracle JVM, Mono or the .NET compiler for C#. Go (the language) can be made just as fast as C (the langua…

> The latest Go implementation (Go 1.7) has made Go a lot faster. I would argue that it closer the speed of executables generated with GCC (gcc/g++) Go 1.7 performs nowhere near the set of optimizations that GCC and LLVM do. GCC/LLVM have a huge number of algebraic simplifications (InstCombine), aggressive alias analysis, memory dependence analysis, instruction scheduling, an optimized instruction selector, a highly…

Everything you wrote is true, but I think you're overstating the performance cost of Go design and implementation choices. I think the parent comment is fair in saying that Go is somewhere between GCC and the JVM in terms of performance. But I agree that Go is not designed for extreme performance (the kind of software where even a 1% gain matters), and that C/C++/Rust are better for these purpose.

Re: What Golang Is and Is Not

#239

Earlier quoted context omitted.

> Nim is a very good language… Is it as good at concurrent services as golang is?

There are many use cases for which Nim might very well be a very good language other than concurrency.

Yes, but since we're talking about golang, it's the info I'm looking for here.

Re: What Golang Is and Is Not

#240

Accusing other languages of suffering from paralysis of choice and fragmentation and offering "go get" as an example of solving this is truly ironic: https://github.com/avelino/awesome-go#package-management

Why? `go get` is an obvious default choice for package management. You don't have to make a choice. There would be paralysis of choice if when you install Go you were forced to choose from that list, but you aren't.

> Why? `go get` is an obvious default choice for package management.

I thought go get wasn't a package manager /s

Post reply on HN