Go, also called golang, is an open source programming language initially developed at Google. It is a statically-typed language with syntax loosely derived from that of C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as ...

learn more… | top users | synonyms

56
votes
12answers
6k views

What are the chances of Google's Go becoming a mainstream language? [closed]

Who here is learning Go? Are other companies looking at using it? Is it likely to become widely used?
34
votes
4answers
5k views

How much is Google investing in the Go language?

I have read quite a bit about the Go language, and it seems promising. The last important bit of information I am missing before I decide on spending more effort on the language is: How much money/man ...
32
votes
1answer
7k views

How are Rust Traits different from Go Interfaces?

I am relatively familiar with Go, having written a number of small programs in it. Rust, of course, I am less familiar with but keeping an eye on. Having recently read ...
30
votes
8answers
4k views

When would you need “hundreds of thousands” of threads?

Erlang, Go, and Rust all claim in one way or another that they support concurrent programming with cheap "threads"/coroutines. The Go FAQ states: It is practical to create hundreds of thousands ...
29
votes
3answers
12k views

How fast can Go go?

Go is one of the few languages that are supposed to run 'close to the metal', i. e. it's compiled, statically typed and executes code natively, without a VM. This should give it a speed advantage over ...
28
votes
1answer
8k views

Are go-langs goroutine pools just green threads?

The commentator here offers the following criticism of green threads: I was initially sold on the N:M model as a means of having event driven programming without the callback hell. You can write ...
28
votes
3answers
23k views

Sets Data Structure in Golang

I really like google golang but could some one explain what the rationale is for the implementors having left out a basic data structure such as sets from the standard library?
22
votes
2answers
3k views

Why is there a “new” in Go?

I'm still puzzled as why we have new in Go. When you want to instantiate a struct, you do t := Thing{} and you can get a pointer to a new instance by doing t := &Thing{} But there's also ...
19
votes
1answer
1k views

Could Hindley-Milner inference work for the Go language?

I've read that Hindley-Milner does not work with type systems that have subclasses, and there are other type system features that also do not work well with it. Go currently has only very limited type ...
17
votes
3answers
1k views

Advantages of a left to right language syntax

I've been watching an interview with Herb Sutter on Channel9 and he mentioned at the end of the video that left to right language syntax would be on the top on his whishlist for a future C++ ...
15
votes
6answers
839 views

How to search for information related to Go programming language?

If there's something that would kill Go language, then it's name. I find it very hard to find anything in web related just by using "Go" in the query. The word is on of the most frequent in English. ...
15
votes
1answer
2k views

How does Go improve productivity with “implicit” interfaces, and how does that compare with C#'s notion of Extension Methods?

In the Go Language Tutorial, they explain how interfaces work: Go does not have classes. However, you can define methods on struct types. The method receiver appears in its own argument list ...
14
votes
1answer
4k views

Erlang and Go concurrent programming, objective differences between CSP and Actors?

I was looking into concurrent programming in Erlang and Go programming languages. As per my finding they are used Actor model and CSP respectively. But still I am confused with what are the objective ...
12
votes
2answers
3k views

When Rob Pike says “Go is about composition”, what exactly does he mean? [closed]

From Less is Exponentially More If C++ and Java are about type hierarchies and the taxonomy of types, Go is about composition.
11
votes
5answers
3k views

Benefits of classic OOP over Go-like language

I've been thinking a lot about language design and what elements would be necessary for an "ideal" programming language, and studying Google's Go has led me to question a lot of otherwise common ...
11
votes
1answer
5k views

Why did Golang discontinue the “netchan” package?

The Golang "netchan" package seems to have been discontinued. That makes me think that the concept of "networked channels" were not a good practice after all. (Why wouldn't them just "let it be" ...
9
votes
2answers
442 views

Why does Go have a special case for abs(0)

I was playing around with Go, and found this particular interesting code for the abs function in the math package: http://golang.org/src/pkg/math/abs.go 14 func abs(x float64) float64 { 15 ...
8
votes
4answers
4k views

GO instead of C/C++ with cgo [closed]

Is it possible to replace C and C++ with Go + cgo and interface frameworks such as Qt or DirectX with Go? Any potential pitfalls I should be aware of? UPDATE: I see that my question was not precise ...
8
votes
2answers
911 views

What is the name for the programming paradigm characterized by Go?

I'm intrigued by the way Go abandons class hierarchies and seems to completely abandon the notion of class in the typical object oriented sense. Also, I'm amazed at the way interfaces can be defined ...
8
votes
1answer
529 views

Math library methods in Google's Go Programming Language

I have been programming in google Golang and have been enjoying it due to its brevity but I find it surprising that almost all its Math standard library methods are for the floating point type. Is ...
7
votes
2answers
1k views

Type inference in Golang/Haskell

I've read that Go doesn't actually have true type inference in the sense that functional languages such as ML or Haskell have, but I haven't been able to find a simple to understand comparison of the ...
6
votes
3answers
3k views

Is Google's Go a type-safe language?

this page http://golang.org/doc/go_faq.html writes: although Go has static types the language attempts to make types feel lighter weight than in typical OO languages So my question is ...
6
votes
2answers
2k views

Is having source code for a Go project outside GOPATH a bad idea

I am working on a new project using Go, and we are all new to Go. We are following the standard go directory structure, and having all code under $GOPATH/src/github.com/companyname/projectname ...
6
votes
2answers
250 views

Language that can statically ensure a map's fields are present

If data is simple and objects are complex, I'm curious if there are any existing statically typed languages that would be able to augment(?) a map type into a type with guaranteed fields. I realize ...
6
votes
1answer
286 views

Optimizing hash lookup & memory performance in Go

As an exercise, I'm implementing HashLife in Go. In brief, HashLife works by memoizing nodes in a quadtree so that once a given node's value in the future has been calculated, it can just be looked ...
5
votes
2answers
2k views

Equivalent of Domain Driven Design for functional programming languages

I really love the idea of domain driven design, however, as I'm learning Go, I'm wondering if there's the equivalent of DDD that's aimed at an effectively more functional language?
5
votes
3answers
492 views

Performance considerations when using Go for my project

I'm looking at using Go (aka golang) for a project (a SQL database, but that mostly doesn't matter here) where performance is critical, but under low load the primary bottleneck will be I/O to disk. ...
4
votes
2answers
910 views

What are the prerequisites for learning Go

I am considering learning Go. As far as I know about it, it's a systems language geared toward parallel programming. (correct me if I'm wrong) Should I have a very good understanding of C in order ...
4
votes
2answers
1k views

What degree of low-level programming can be achieved with Languages like Go?

Go and D provide garbage collection, and yet they claim to be system programming languages. What degree of low-level programming can be achieved with languages having garbage collection? For ...
4
votes
2answers
95 views

Go - idioms/design for determining when an unknown number of goroutines are complete

I have a workflow wherein I walk recursively through a bunch of directories, then for each file perform some action. I'm using goroutines to walk each directory, and also to process each file. The ...
4
votes
2answers
267 views

Does a vm implemented in garbage collected language need a garbage collector?

This is more of a theoretical question. If jvm is implemented in go which itself is a garbage collected language, then does that jvm need a separate garbage collector to be implemented for its own ...
3
votes
3answers
3k views

What are the advantages of pass by value?

I always thought pass by value is a legacy from the early languages, because the designers had never seen anything else. But after seeing the brand new languages like Go adapting the same principle ...
3
votes
2answers
698 views

Why do concurrent languages tend to have more complicated syntax?

This is a question that's been on my mind for a while. Recently I've been checking out concurrent languages like Haskell or Go or Erlang. From my point of view, they have huge benefit in performance ...
3
votes
1answer
533 views

What do goroutines, Ruby Fibers, etc. look like to the OS/Kernel?

In process concurrency and thread concurrency it's quite obvious how the kernel sees these as they map directly to real things that the kernel manages. When it comes to Golang goroutines and Ruby ...
3
votes
2answers
2k views

clojure/erlang/go for high volume server

I have a project that will need to handle 1000s of requests a second with a decent amount of processing for each. For the most part, the processing will be done on a list of items, basically ...
3
votes
1answer
3k views

Container types in Golang

For a non-OOP language like google Go, is it idiomatic to go about implementing new container types using datatypes like arrays or lists so as to implement convenient functionality like contains ...
2
votes
4answers
1k views

Could Go work with other user interfaces than Web?

Go seems to be made for doing server side stuff for the web. What could I do if my boss suddenly dictated that he wants a Windows GUI for a Go application?
2
votes
3answers
111 views

Flow control in Go without a for loop

I've been set a challenge that I'm trying to get my head around, but am struggling with the best (or 'correct') way to implement it. The challenge is to create a simple console app written in Go that ...
2
votes
2answers
273 views

Restful User/Password Authentication

I'm currently designing a REST-API with the following properties: Backend for a single page application (Later Apps) Integrated user database for each instance HTTPS/TLS only Authentication with ...
2
votes
1answer
154 views

What was the reason behind using quotes in Go's import statements?

The usage of quotes in Go's import statement strikes me as unnecessary. Typical Go import statements look like: import "foo/bar" import other_name "foo/bar" import ( "foo/bar" x "foo/baz/bar" ...
2
votes
1answer
551 views

How should I handle database failures in a web application? [duplicate]

I'm developing a simple RESTful API using Go's Goji framework (although this question is language-agnostic), in which parameters from the URL are queried against a PostgreSQL database. Here's how it ...
2
votes
1answer
56 views

TDD Duplicate Testing on Related Classes

In following the principle of testing only the exported functions on a package (using Go - or for others languages, the public functions on a class), I'm running into a scenario where related packages ...
2
votes
1answer
150 views

Checking for nil in Go [closed]

In Go, is it idiomatic to check for nil and return an error if a parameter is nil? Should pointer method receivers ever include nil checks? I've seen a lot of code in other languages where people ...
2
votes
2answers
586 views

How would I allow a PHP front end to communicate with a back end written in Go (or any other combination of languages)?

I like PHP. It's not overly complex to achieve what you want, you can write straight up HTML inside it, and I suppose I'm just used to it. I also like Go, having just discovered it while looking for ...
2
votes
1answer
53 views

I have an unordered list of rectangles and their neighbors on four sides with no origin. How can I efficiently convert this into a grid?

I am writing a GtkGrid-like container for my GUI library for Go, and I'm trying to write the actual layout part of the code. Basically, I have an unordered list of controls. Each control is a ...
1
vote
3answers
448 views

What can Go chan do that a list cannot?

I want to know in which situation Go chan makes code much simpler than using list or queue or array that is usually available in all languages. As it was stated by Rob Pike in one of his speeches ...
1
vote
3answers
231 views

Are project naming conventions more important than language naming conventions? [closed]

I'm working on a project with a senior developer and he doesn't really abide by the naming conventions of the language that we're using. The project is in Go and he uses underscores for everything. ...
1
vote
1answer
154 views

Does Go implicitly discourage getters and setters and encourage direct member access?

As the title says, is accessing public struct fields more idiomatic in Go than getters and setters? Wouldn't that lead to violation of data encapsulation, also public fields in other OO languages like ...
1
vote
1answer
93 views

What is the difference between embedding and composing?

What is the difference between go's type embedding and object composition? My understanding is that type embedding is object composition except the methods of the embedded type are automatically ...
1
vote
1answer
90 views

In Go, why isn't append() implemented as a method, but as a function?

In Python, lists offer an append() method which can be called using standard Python method syntax; for example: >>> my_list = [] >>> my_list.append('a', 'b', 'c') >>> ...