News for hackers. Stuff that matters.
Re:Go 1.4 is released by mholt on Thursday December 11, 2014 @01:01AM (#8733409)
Once Go is installed, I can make a simple web app from scratch that displays parameters from the URL or request body in just over 95 seconds with Go, using only the standard library. I can cross-compile it for another OS and architecture, then deploy a single binary file without worrying about dependencies, dynamic linking, or segfaults.

Try doing that in C/C++.

Maybe a better comparison is to more systems-level applications like you might code up in C. The same benefits carry over to those, without a significant performance hit (usually).

(And to be fair, sometimes C/C++ is the better tool for the job. But give it a shot; Go is pretty handy when you don't need to drop down to lots of unsafe memory and CPU operations.)

By the way, your existing C skills will be very useful in Go. For example, struct fields will still be padded unless you pack them carefully. Your experience with buffers, streams, memory allocation, and data structures will definitely not be wasted in Go.

Re:Go 1.4 is released by blakecaldwell on Thursday December 11, 2014 @01:38AM (#8733519)
Concurrency with goroutines and channels in Go is pretty awesome, as is the tooling: race detection, code formatting, PPROF performance monitoring, vetting (finding incorrect printf strings), and a great test framework with parallel execution support. The standard library is enough for most of what you'll need, and it's all open source, so you can learn to write idiomatic Go from it.
Re:Go 1.4 is released by howeman on Thursday December 11, 2014 @01:10AM (#8733437)
And if you want to use external code, you can download it with and integrate it into your main package in about 90 seconds (go get + go install). In order to learn to use it, godoc is there.
Re:Go 1.4 is released by hk__2 on Thursday December 11, 2014 @03:28AM (#8733782)
You can get static linking in C/C++ with `gcc -static`.
Re:Go 1.4 is released by pjc50 on Thursday December 11, 2014 @05:15AM (#8734039)
Sort of. On Linux, libstdc++ depends on the NSS system which dynamically loads libraries to implement things like getpwent(). Last time I had to actually make a portable static executable (admittedly some years ago) this was a real problem, and it was easier to statically link everything except libstdc++, then ship a copy which was loaded using RPATH in the linker settings.
Re:Go 1.4 is released by pjmlp on Thursday December 11, 2014 @05:25AM (#8734059)
This is however a tooling issue, not a programming language one.
Re:Go 1.4 is released by jimbokun on Thursday December 11, 2014 @01:19PM (#8736243)
And Go's tools have a great reputation.

(Disclaimer: Not a Go programmer, just read articles about it.)

Re:Go 1.4 is released by fit2rule on Thursday December 11, 2014 @01:28PM (#8736294)
>>>>Try doing that in C/C++.

Lua.

Re:Go 1.4 is released by codexon on Thursday December 11, 2014 @03:18AM (#8733751)
You can still get segfaults in Go.

"panic: runtime error: invalid memory address or nil pointer dereference"

Re:Go 1.4 is released by howeman on Thursday December 11, 2014 @03:29AM (#8733789)
But you also get a stack trace without needing an IDE and debugger.
Re:Go 1.4 is released by Morgawr on Thursday December 11, 2014 @06:11AM (#8734175)
I've been working with Go daily for a few months now at my job and I'd like to point out that Go stack traces have a really big signal to noise ratio. There is a lot of cruft that mostly nobody cares about and sometimes it can be hard to pinpoint exactly where something crashed (at which line) with a panic.

Just saying, they should probably improve it to be less verbose and more concise.

Re:Go 1.4 is released by riobard on Thursday December 11, 2014 @10:41AM (#8735334)
In that case you would say it has a really low signal-to-noise ratio.
Re:Go 1.4 is released by Morgawr on Thursday December 11, 2014 @11:01AM (#8735446)
Yes, you are 100% correct, I dun goof'd. I would edit the post but apparently I can't, so I'm sorry for that. Same for the other person commenting on it.
Re:Go 1.4 is released by unwind on Thursday December 11, 2014 @10:56AM (#8735423)
I realize I'm perhaps somewhat annoying, apologies, but that would make the signal to noise ratio _small_, not big.

It's literally (SIGNAL) / (NOISE), so if the noise is larger than the signal, the ratio goes down.

Re:Go 1.4 is released by kisielk on Thursday December 11, 2014 @04:04PM (#8737058)
The stack trace contains the stacks of all the goroutines. The running goroutine which caused the panic is printed first, so it should be pretty easy to find the source of the problem. At least I haven't had any issues in debugging complicated apps with thousands of goroutines...
Re:Go 1.4 is released by codexon on Thursday December 11, 2014 @03:27PM (#8736887)
But you can get that in C++ if you really wanted to as well.

I just wanted to point out that not having to worry about segfaults is clearly wrong.

Go doesn't really take any steps from preventing pointers from being null or forcing you to deal with possibly null pointers, or accessing uninitialized maps or slices.

Re:Go 1.4 is released by codexon on Thursday December 11, 2014 @09:34PM (#8738345)
I'm wondering why I'm being downvoted for a factual statement.

The parent of this comment said "without worrying about dependencies, dynamic linking, or segfaults".

This is blatantly wrong. Pretty sad what HN has become.

Re:Go 1.4 is released by cheepin on Thursday December 11, 2014 @01:33AM (#8733499)
> Once Go is installed, I can make a simple web app from scratch that displays parameters from the URL or request body in just over 95 seconds with Go, using only the standard library. I can cross-compile it for another OS and architecture, then deploy a single binary file without worrying about dependencies, dynamic linking, or segfaults. Try doing that in C/C++.

NodeJS runs on top of C++ :P

Re:Go 1.4 is released by bradfitz on Thursday December 11, 2014 @01:35AM (#8733512)
"then deploy a single binary file without worrying about dependencies, dynamic linking, or segfaults"
Re:Go 1.4 is released by coldtea on Thursday December 11, 2014 @02:31AM (#8733633)
Yeah, he meant do it WITHOUT implementing an app server and a JIT for another language first.

With std.

Re:Go 1.4 is released by pjmlp on Thursday December 11, 2014 @05:27AM (#8734066)