Live data from Hacker News

Why I Program in Go

tech.t9i.in

121–130 of 171 posts

Re: Why I Program in Go

#121

As an ex-Ruby cum Node.js lover recently converted to Go... Programming in Go, once it clicks, really does feel relaxing and productive. If you're a decent Node.js programmer, it's like stepping up to "Node Pro", in the sense that you work close to the metal with your web server so everything feels clean and easy to wrap your mind around. But Go code is cleaner and tighter. The code formatting conventions contribute…

> I do wish the documentation convention included not only a brief description each function, etc., but also a brief example.

It is getting there. If you run godoc locally with tip, you will find many more examples than there were previously.

See http://golang.org/pkg/path/ for a current example. And the source for those examples can be found here: http://golang.org/src/pkg/path/example_test.go. Note that this technique will work for your own packages as well.

The technology is there, the implementation is still incomplete; but more progress has been made than is easily visible.

Re: Why I Program in Go

#122
post #86

Earlier quoted context omitted.

Yeah- that is great as long as you don't care about using 30x times more memory.... The awesome bloat cough I mean power of the JVM in action. Go vs Scala: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t... It will be interesting to re-visit this when Go 1.1 is out as well. Go being even younger than Scala has a lot of low hanging optimization fruit. :) P.S. If Go didn't exist I would still be using Java…

> Yeah- that is great as long as you don't care about using 30x times more memory.... > Go vs Scala: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t... . There is no such thing on that page. You see 30x times win for go only where program uses very small amount of memory. When memory consumption is big(regex-dna and binary trees), memory footprint is very similar for both scala and go(+-10%).

Makes me wonder why people don't use Free Pascal more ... It shares many of Go's advantages described here (simple language, powerful libraries) and is frequently faster and uses less memory (8KB memory in 4 cases where Go uses 700-1200KB!) on the Benchmark Game programs. It's probably the C-like syntax that tips the scales every time ...

Re: Why I Program in Go

#123
post #27
post #18

Earlier quoted context omitted.

My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…

Oh, I don't doubt many things can be done much better in other languages than Java, only why stop at Go? Clojure pretty much hits every single one of your requirements, it's more modern and expressive than Go, gets concurrency better, and it's about as slower than Go as Go is slower than Java -- and getting faster. Also, you don't have to give up the monitoring and instrumentation the JVM gives you, as well as the va…

It depends what you want to build I guess. Go has a much smaller surface or things to learn if you know POSIX already. It's fast startup times makes it also a good contender for command-line tools.

Re: Why I Program in Go

#124

Earlier quoted context omitted.

Go is a bit like C but it has GC so it depends on how much you value the fine degree of control of memory allocation that you get with C. Personally I think Go has a lot cleaner syntax than C and the tools give a lot more "friendly" error messages when compiling your applications. You do still get nullpointerexception runtime errors though but that's an inherent problem with the nil/null type.

Thanks for replying. It seems GO is not for me at least now. What I want is an optional strong typed script language with highest performance. Lisp serves me well here. I have only three real things to care about a language: 1. Performance and thus optional strong typed is required. Go can have optional strong typed system, so performance may be improved in future, but its GC seems a big warning for me. I want to hav…

You might get a bit of mileage out of 3., you can write go applications quite quickly and the optional typing makes it feel script-ish.

Also Go does compile on ARM.

Re: Why I Program in Go

#125
post #18

Earlier quoted context omitted.

My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…

+1. For me a killer feature is that I easily create executables for lin/mac/win on my machine and don't have any dependencies at all (JVM for example).

Oh, absolutely! Small executables would be a good fit for Go (provided you don't need a GUI, since AFAIK Go doesn't have a UI toolkit). Only, in that case, isn't a whole new language ecosystem a bit of an overkill to avoid some of the inconveniences you'll have using C/C++?

Sorry, I've yet to be shown a large enough class of problems where Go would give a significant enough an advantage to abandon rich and well-established ecosystems.

Look, there's no doubt Go is nice, and, as such, some people would use it for some tasks, just because it's there. But if I run a company building large software, why would I switch to an entirely new ecosystem that's incompatible with just about everything unless there is something spectacular that Go can do that no other solution can? Or, at the very least, something extremely hard that Go does very easily. Erlang, which is also incompatible with just about everything (though it might even be more compatible with C than Go is) does some spectacular things. If Go's killer feature is small console programs that don't require dependencies, then, well, it will see very little serious adoption.

Re: Why I Program in Go

#127
post #125

Earlier quoted context omitted.

+1. For me a killer feature is that I easily create executables for lin/mac/win on my machine and don't have any dependencies at all (JVM for example).

Oh, absolutely! Small executables would be a good fit for Go (provided you don't need a GUI, since AFAIK Go doesn't have a UI toolkit). Only, in that case, isn't a whole new language ecosystem a bit of an overkill to avoid some of the inconveniences you'll have using C/C++? Sorry, I've yet to be shown a large enough class of problems where Go would give a significant enough an advantage to abandon rich and well-estab…

> Only, in that case, isn't a whole new language ecosystem a bit of an overkill to avoid some of the inconveniences you'll have using C/C++?

Sure. I've started from scratch and Go seemed to me like the perfect match (not that there aren't any other choices, but it came right into my front door and I said: why not?)

Re: Why I Program in Go

#128
post #65
post #57

Earlier quoted context omitted.

My claim is that Go's advantages are far, far too small to outweigh not running on the JVM. (also, I think Clojure > Go -- no need for Java in the equation -- but that's not my main point)

You see the JVM as an asset. Many consider it a liability. And programmers in the New Jersey school (see Worse is Better) are unlikely to ever stomach Clojure. These differences are more in the realm of deep allegiances and HN comments will probably be limited to revealing allegiances--they have little chance to sway the reader one way or the other. Might as well say, "MIT type with love for the JVM? Choose Clojure.…

I have another problem with the JVM and it's oracle.

Re: Why I Program in Go

#129

Earlier quoted context omitted.

Really? I remember reading all kinds of problems when trying to run go on 32-bit machines, like: http://news.ycombinator.com/item?id=3805302

You are correct, but the none of those problems happened on 64 bit machines which I find to be more prevalent these days.

Still, this story seems much more crazy than any other gc issue I have ever heard of with the jvm.

Re: Why I Program in Go

#130
post #18
post #10

For the life of me I can't understand why anyone would give up the power (in terms of profiling, monitoring and ecosystem, and somewhat better performance, too) of the JVM, for a language marginally more convenient than Java, and arguably less expressive than other JVM languages. The only thing I could think of is a smaller RAM footprint, if you care about that sort of thing. Whenever Go is compared to Java, the argu…

My day job involves working with Java and C++ on 10+ year old systems. All of my hobby or side projects are in Go these days with occasional diversions into haskell, ML or various Lisps. So I'll try to impart some understanding of why I would switch to Go from Java or C++. First lets get some things out of the way. Go is fast enough and getting faster very quickly and it definitely has a smaller memory footprint. So…

Just one point :

> C++ doesn't have this [Tools for writing IDEs quickly]

Well indeed it does, libclang does exactly that, and quite well. As a result, you have plugins for Vim, Sublime Text and others providing autocompletion and in editor compiltation and error reporting.

Post reply on HN