Live data from Hacker News

Why Tech Startups Should Look at Go

startupedmonton.tumblr.com

91–100 of 110 posts

Re: Why Tech Startups Should Look at Go

#91
post #48
post #19

Essentially all of the quoted usecases switched from a slow dynamically typed language to Go. Of course that's an improvement. But I still don't see why you would choose Go over Java (or Scala) for serious backend development. Java has more libraries, is faster, has generics (for the love of god), has better IDE support, and has a larger hiring pool. In summary, the ecosystem is more mature. Java's checked exceptions…

An experienced programmer friend of mine uses Go professionally. I was surprised to hear that he much prefers Java: he said that many concurrency libraries are available for Java and that Go's features are quite limited in comparison. He dislikes the fact that you have to break Go's poor type system to get many things (such as tests) to work. He has a pretty strong background in FP, so I think that perhaps Go's inter…

An explanation for downvotes would be appreciated... perhaps "poor type system" was too strong wording, and for that I apologize. But it was surprising to hear his opinion re: concurrency, as from what I understand that's one of the biggest features of Go.

Re: Why Tech Startups Should Look at Go

#92
post #19

Essentially all of the quoted usecases switched from a slow dynamically typed language to Go. Of course that's an improvement. But I still don't see why you would choose Go over Java (or Scala) for serious backend development. Java has more libraries, is faster, has generics (for the love of god), has better IDE support, and has a larger hiring pool. In summary, the ecosystem is more mature. Java's checked exceptions…

[deleted]

Re: Why Tech Startups Should Look at Go

#93
post #83

Earlier quoted context omitted.

I don't think you've ever calculated just how much that cost is. Lets say that you have a web service that is serving 30,000 requests per second, with a 1 Kb request size and a 4 Kb response size and you're setting up an elastic load-balancer setup that on average keeps 300 c3.xlarge instances open. Do the math and you'll find that the cost on AWS, considering the instances used and the bandwidth, is over $80,000 per…

30,000 requests per second is 2,592,000,000 per day... That's quite a lot. Obviously we're not talking page views (because that'd be crazy successful and well beyond 'startup' territory), so we're presumably in the domain of data logging, analytics, social networking etc. Sure, AWS might not be appropriate for those. But then, the level of traffic you're talking about represents maybe 0.1% of startups. People doing "…

You're right, we aren't talking about page views or CRUD, but it can happen in a B2B application.

I ended up working for a startup like that, so this was a real anecdotal example. Our stuff was built to run on the JVM and we managed to get away with a variable number of instances between 15 and 30 (at the time we used c1.medium, which are now deprecated) - AWS's ELB is great in such a scenario as it can be configured to bring up new instances in case of traffic spikes, or kill them in case they were unused. So for us, AWS was saving us money, however that's because we were very efficient.

My opinion is that if you're expecting your startup to grow soon (and I'm not talking about wishful thinking, but about requirements that have to happen for survival - i.e. you either get the desired contracts or you don't), then you have to prepare for it.

Re: Why Tech Startups Should Look at Go

#94

Earlier quoted context omitted.

> 1. Less verbose code Go is much more verbose than Scala or Clojure. Go is just a language, whereas the JVM is a platform with multiple languages. > 2. Platform Ind. + native binaries, no runtime dependency In my opinion Java has a greater degree of platform independence. Wherever it runs, things just work. On runtime dependency, you're wrong, as Golang does have a pretty heavy runtime dependency. It's true that it…

>Go is much more verbose than Scala or Clojure. Go is just a language, whereas the JVM is a platform with multiple languages. There is a trade-off being verbosity and maintainability, IMGO Go hits that. >In my opinion Java has a greater degree of platform independence. Wherever it runs, things just work. LOL. Said no person who has actually distributed a multiplatofrm Java application ever- I should know. Both Java a…

> There is a trade-off being verbosity and maintainability, IMGO Go hits that.

This is where we'll always disagree, because if you like Go, it's natural for you to come up with this argument, however the line you're drawing is completely arbitrary. I have yet to hear an argument about what makes Go strike a fine balance between verbosity and maintainability, when my feelings are the opposite - I find Go code to not be very maintainable in comparison with other static languages, because Go is not very statically type-safe.

> LOL. Said no person who has actually distributed a multiplatofrm Java application ever

Yet it happens all the time and a LOL is not an argument that disproves that. From my own experience, I have built stuff on top of Java / the JVM on OS X / Linux and deployed on Linux, Windows and OS X, without encountering any issues, ever, without worrying that Java's NIO will work or not, without worrying on whether the memory model will suddenly be different, without worrying on whether my app will leak on 32 bits platforms ;-)

Android is the only ugly duckling, but that's only because Android doesn't have a JVM on it. It still works out well though.

But if you have examples, I'd love to hear them out.

> The key word here was dependency, specifically, external dependency. If Go'd runtime ships with the binary its not really a external dependency is it.

Now that's an arbitrary distinction, isn't it? What stops one from bundling the VM in the same deployed binary? If you want this distinction, the only valid argument is one of size, but then again for the server-side (where most of the Go stuff is used) that's completely meaningless.

> Yes. It comes baked into the stdlib, its "http/pprof"

Are you seriously comparing something like YourKit's Profiler and Java's remote attach and debugging capabilities to http/pprof? IMHO, that's not a comparison you can make.

> Biggest plus ever, goes native simple tooling doesn't need an external life support system.

There are many issues wrong with this line of thinking - the simple tooling you're talking about doesn't do what I and many others want it to do. Also if you look throughout history, all the languages that came with batteries included have suffered once the people finally reached the conclusion that the included batteries have been shitty. Which is what happens when you don't let evolution pick a winner with the community acting as the fitness function. But we'll talk in about 5 years.

> You are wrong, all the the stuff you are are talking about is library based, Go has channels/select/go build into the language as primitives. I wasn't talking about bolt on libraries.

But that's the point mate, the JVM is capable enough to build anything you want on top of it as libraries, there's no point for something to be hard-coded in the language. Which is a good thing, because when speaking of concurrency and parallelism, there isn't a one size fits all.

For example, speaking of Go's channels - they are strictly about managing concurrency, they are not about parallelizing a workload and they do not work across address spaces / asynchronous boundaries. And if you think that Go's channels are the answer to everything, well, you would have been better off with Erlang, as there you might have had a valid argument.

> IMHO This is not the case, if you think it is, explain.

Can you take an arbitrary memory location and cast it to anything you want? Can you override how heap allocation happens? Can you allocate an array on the stack? Can you do RAII? Do you have the union type from C?

In practice you have no control on where Golang allocates stuff - the compiler decides that based on really simple rules for escape analysis and as a general rule of thumb AFAIK anything that is allocated with "new" goes on the heap. What you can do with Golang is to use the "unsafe" package. But that's not different than using Java's sun.misc.unsafe ;-)

The only real difference with Golang is that you can have stack allocated structs, as otherwise Java also does escape analysis. But besides this coming to Java 9, the real kicker is that .NET/C# has had stack allocated values since inception, in addition to much more potent "unsafe" constructs - in C# you can even do pointers and pointer arithmetic and the runtime will pin those memory addresses during execution for avoiding GC interference.

Re: Why Tech Startups Should Look at Go

#95
post #25

Earlier quoted context omitted.

> Even if Go is the best technical option, it may not be the best business decision Why might Go not be the best business option? I see technical case for or against Go as very much religious and shaped by personal preference. But what could be a business reason not to use Go for a new startup that is independent of the technical side?

I thought I hinted that it was more a matter of available resources. The Go community is growing but if you're a lean startup looking for developers to get moving quickly, the pool for Python, PHP, Node & Ruby/Rails dwarfs that of Golang. And to the other comment, yes, it's easy (and generally surprisingly pleasant) for experienced developers to pick up, but that's an investment.

At Canonical, 2/3 of our developers on Juju hadn't written Go code before joining the team. They get up to speed in the first week, or often, even before their first day through their own efforts. The language is incredibly easy to pick up. It's basically zero cost if you have at least a few devs with Go experience to answer the occasional question.

Re: Why Tech Startups Should Look at Go

#96

Earlier quoted context omitted.

>Go is much more verbose than Scala or Clojure. Go is just a language, whereas the JVM is a platform with multiple languages. There is a trade-off being verbosity and maintainability, IMGO Go hits that. >In my opinion Java has a greater degree of platform independence. Wherever it runs, things just work. LOL. Said no person who has actually distributed a multiplatofrm Java application ever- I should know. Both Java a…

> There is a trade-off being verbosity and maintainability, IMGO Go hits that. This is where we'll always disagree, because if you like Go, it's natural for you to come up with this argument, however the line you're drawing is completely arbitrary. I have yet to hear an argument about what makes Go strike a fine balance between verbosity and maintainability, when my feelings are the opposite - I find Go code to not b…

I could respond point by point and keep this going, but don't think we are going to change each-other's mind or add constructively to this conversation.

I think we would both like to think we are both right on technical grounds, but I think we would be deceiving ourselves as a great proportion of this is personal taste, ideological, and we are both heavily invested in our respective platform of choice.

Best of luck & code on.

Re: Why Tech Startups Should Look at Go

#97

Earlier quoted context omitted.

> There is a trade-off being verbosity and maintainability, IMGO Go hits that. This is where we'll always disagree, because if you like Go, it's natural for you to come up with this argument, however the line you're drawing is completely arbitrary. I have yet to hear an argument about what makes Go strike a fine balance between verbosity and maintainability, when my feelings are the opposite - I find Go code to not b…

I could respond point by point and keep this going, but don't think we are going to change each-other's mind or add constructively to this conversation. I think we would both like to think we are both right on technical grounds, but I think we would be deceiving ourselves as a great proportion of this is personal taste, ideological, and we are both heavily invested in our respective platform of choice. Best of luck &…

Well yeah, but arguing programming languages is what we do - it's like talking about sports for us, isn't it? :-)

You're right of course.

Re: Why Tech Startups Should Look at Go

#98
post #89

Earlier quoted context omitted.

To be fair, if you're modifying the heap from a goroutine, you're "doing it wrong". Go provides channels, which work quite well at reducing the need to mutate the global state. I use such a pattern quite frequently (the http.Server), and have never had a problem with heap corruption due to a handler goroutine panicing.

That's true. To that extent C, C++, Java work took. The Threads + thread safe queues is a common paradigm I've used. The problem comes with using other libraries, sharing code with others in a large code base. But errors and concurrency bugs still happen. But just like type systems, they are there not just to make code faster but add some guaranteed safety. The guaranteed is important. In case of concurrency, errors…

There is a cost, though. Low enough to bear in most cases, but transferring more state through IPC, the overhead of starting new processes, context switching between processes, duplication of in-memory structures; these can add up to make an equivalent Erlang program much more heavyweight on a system than a Go program using many goroutines.

Right tool for the job, yadda yadda. :)

Re: Why Tech Startups Should Look at Go

#99
post #19

Essentially all of the quoted usecases switched from a slow dynamically typed language to Go. Of course that's an improvement. But I still don't see why you would choose Go over Java (or Scala) for serious backend development. Java has more libraries, is faster, has generics (for the love of god), has better IDE support, and has a larger hiring pool. In summary, the ecosystem is more mature. Java's checked exceptions…

I find java's ecosystem to be it's biggest drawback. Yes, there are libraries and frameworks available for everything. The drawback is that every simple task, from building to testing to servers is wrapped in so many useless layers of indirection and configuration I just want to tear my eyes out. If you could throw out all the nonsense that has infected java and just build simple things from scratch on the jvm that w…

In the rust example error handling is enforced via the type system whereas with Go it depends on your (and others) discipline.

Re: Why Tech Startups Should Look at Go

#100
post #89

Earlier quoted context omitted.

That's true. To that extent C, C++, Java work took. The Threads + thread safe queues is a common paradigm I've used. The problem comes with using other libraries, sharing code with others in a large code base. But errors and concurrency bugs still happen. But just like type systems, they are there not just to make code faster but add some guaranteed safety. The guaranteed is important. In case of concurrency, errors…

There is a cost, though. Low enough to bear in most cases, but transferring more state through IPC, the overhead of starting new processes, context switching between processes, duplication of in-memory structures; these can add up to make an equivalent Erlang program much more heavyweight on a system than a Go program using many goroutines. Right tool for the job, yadda yadda. :)

Erlang processes are nothing at all like Unix processes. They are much, much smaller memory-wise as well as in terms of spawning/killing speed as they do not rely on system calls but rather the Erlang VM (which is highly tuned for these purposes).

Yes, there is a small overhead incurred when copying data between processes because the VM is truly copying the data[1], but the benefit gained is that you get per-process heap isolation (references can't cross process heap boundaries). This is important because in languages like Java or Go, one misbehaving bit of code that is causing a lot of GC to happen can "stop-the-world", and make your entire system pause (and it does happen[2]). This is not acceptable when writing soft real-time code, like say an auction system.

I'm not sure why you think an Erlang program is more heavyweight than Go. Is it due to Go programs being compiled to binary? Erlang can do that as well,[3] although it's not often done as Erlang requires a runtime, and it's often simpler to use a separate runtime. But you should know that Go also requires its own runtime to run Go programs[4], it's just that it is statically linked into your compiled code (which is what makes the resulting binaries so huge). But Erlang could do the same thing, it's just not really an industry practice.

[1]: http://jlouisramblings.blogspot.dk/2013/10/embrace-copying.h...

[2]: https://groups.google.com/d/topic/golang-nuts/S9goEGuoMRM/di...

[3]: http://erlang.org/doc/man/compile.html

[4]: http://golang.org/doc/faq#Why_is_my_trivial_program_such_a_l...

Post reply on HN