Live data from Hacker News

Go 1.3 beta 1 released

tip.golang.org

31–40 of 131 posts

Re: Go 1.3 beta 1 released

#32
post #6
post #3

generics please? contains no language changes

It took Java 5 versions over 8 years to get generics. It's not going to happen in a minor release.

Stop using Java and C++ for comparing generics in Go. There are lots of languages that had generics on day one.

Re: Go 1.3 beta 1 released

#33

I'm excited about sync.Pool: http://tip.golang.org/pkg/sync/#Pool There are a lot of cases where people write their own version of this (myself included, but also the connections in database/sql for example). It will be great to have an implementation in the standard library. This technique has been very, very useful in StatHat's production code as we have grown.

I'm looking forward to it too. I think it'll be a good way to have one-per-type free-lists inside my toy language implementation. At the moment, garbage is created like crazy in there for all the short-lived immutable values.

Re: Go 1.3 beta 1 released

#34
post #31

How are we on IDE's? Last time I tried go (over a year ago) I couldn't really find a nice IDE.

I use https://code.google.com/p/liteide/ on ubuntu and it works well for my needs (and it gets better with each version). It has all the basic features of an editor and the code completion is quite good in the last versions. It's very easy to use (no complicate setup needed) and I never felt the need to try GoSublime or other alternatives.

Re: Go 1.3 beta 1 released

#35
post #16

I'm not asking for generics, but I really want an equivalent to Python's set data type for strings and numbers at the leas built-in. I'm aware of golang set on GitHub and the gen project as well, but I'm shocked that Go doesn't have an equivalent to the set data type yet. I'm open to suggestions.

I tend to use map[string]interface{} when I need a set. It works okay.

struct{} is better because it doesn't do an allocating. See: https://github.com/fatih/set/blob/master/set_ts.go#L18

Re: Go 1.3 beta 1 released

#36
post #31

How are we on IDE's? Last time I tried go (over a year ago) I couldn't really find a nice IDE.

I haven't found one I like yet. However after a few years of hand holding by visual studio I'm less inclined to deal with one as they are complicated and require a lot more maintenance than a basic text editor. So vim it is for me and that's good enough as it highlights and indents well. The compiler takes so little time and the language is so normalised that I'm not sure there is a great advantage in an IDE either.

Re: Go 1.3 beta 1 released

#37
post #32
post #6

Earlier quoted context omitted.

It took Java 5 versions over 8 years to get generics. It's not going to happen in a minor release.

Stop using Java and C++ for comparing generics in Go. There are lots of languages that had generics on day one.

And all of them will stay in a niche because of their complexity (Scala, Haskell, D, ...).

Re: Go 1.3 beta 1 released

#38
post #17

Earlier quoted context omitted.

s := make(map[string]struct{}) s["foo"] = struct{}{} if _, ok := s["foo"]; ok { // exists } There are varying amounts of fluff you can put on top of this, but that's the basic approach. Wrap it up in a type with methods if you're using it a lot in a program. Perhaps you also want built-in union, intersection, difference, etc. I personally find I need a set with simple membership testing about 10x as often as I need m…

Yes, I was actually looking for the union intersection, etc. functionality. I use that extensively in the project I work on. And it's core enough that I want it in the language, not as a third-party add on because of the performance implications and because of things the language can enforce natively. The Python set data type really is great for a certain class of problems. In particular, graph analysis and traversal…

Lot's of libraries for this on Github; everone (myself included; plug: https://github.com/bulters/readyset) and his mother probably writes one at some point.

Re: Go 1.3 beta 1 released

#40
post #2

For those wondering, os/fsnotify was pushed back to 1.4

Do you know where their current implementation of this is? I want to mess around with it and dont care if i have to change code later.

You can find it here : code.google.com/p/go.exp/fsnotify
Post reply on HN