7 ms·
Go 1.3 beta 1 released
- ancarda 12y agoFor those wondering, os/fsnotify was pushed back to 1.4
- whyrusleeping 12y agoDo 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.
- landr0id 12y agoCheck this out (make sure you read the README) https://github.com/howeyc/fsnotify https://github.com/howeyc/fsnotify
- _Soulou 12y agoYou can find it here : code.google.com/p/go.exp/fsnotify
- nathany 12y agoThe code is identical on GitHub and Google Code right now. The difference is that we may make breaking changes under go.exp while leaving the howeyc/fsnotify API as is. We're still figuring out what os/fsnotify will look like.
- landr0id 12y agoThat's unfortunate. I looked around this post details why it was pushed: https://groups.google.com/forum/#!msg/golang-dev/bShm2sqbrTY/IR8eI20Su8EJ https://groups.google.com/forum/#!msg/golang-dev/bShm2sqbrTY...
- nathany 12y agoYah, we didn't want to rush it and end up stuck with a subpar package in the standard library. If you are at GopherCon, I'll be giving a lightning talk on Saturday 11:40am on things I've learned by contributing to fsnotify and other open source projects. Happy to chat more about fsnotify afterwards.
- obilgic 12y agogenerics please? contains no language changes
- tptacek 12y agoMy guess is you'll probably know a year in advance if that's actually going to happen.
- rockybox 12y agoIt took Java 5 versions over 8 years to get generics. It's not going to happen in a minor release.
- pjmlp 12y agoStop using Java and C++ for comparing generics in Go. There are lots of languages that had generics on day one.
- mseepgood 12y agoAnd all of them will stay in a niche because of their complexity (Scala, Haskell, D, ...).
- frou_dh 12y agoWhat's the casual definition of complexity? Stuff in here I don't like? Honestly, in the medal positions for sloppily expressed programming sentiments, complex/simple occupy the bronze/silver positions just behind the ultimate... "elegant".
- sigzero 12y ago> all of them will stay in a niche < C# has had generics since 2.0, so ALL is a bad choice of words there.
- pjmlp 12y agoActually C# already had generics even before the 1.0 .NET release, but they weren't considered stable enough for a 1.0 release and priority was given to other parts of the .NET. One of many posts about generics history in .NET: http://blogs.msdn.com/b/dsyme/archive/2011/03/15/net-c-generics-history-some-photos-from-feb-1999.aspx http://blogs.msdn.com/b/dsyme/archive/2011/03/15/net-c-gener...
- pdq 12y agoHere's the Go 1.3 Release Notes: http://tip.golang.org/doc/go1.3 http://tip.golang.org/doc/go1.3
- patrickxb 12y agoI'm excited about sync.Pool: http://tip.golang.org/pkg/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.
- mediocregopher 12y agoReading the documentation, it seems that sync.Pool will automatically shrink the pool size when it's not being used? If so, unless in the future it provides some way to specify a cleanup function for those values, using it for connections and the like would result in hanging connections (I think, not 100% sure).
- kisielk 12y agoIt only removes values that have been put back in to the pool. The assumption is that anything you've put back in to the pool has already been cleaned up to a state where it's ready to be used again when it's taken out.
- Someone 12y agoThat's exactly the complaint. You don't use a connection pool to get rid of allocs and frees, but to get rid of lengthy calls that initialise the connection. Because of that, you don't want to close your connection before returning it to the pool. So, the pool will have to close those connections whenever it disposes of an object in the pool. I don't know enough go to interpret what 'might be deallocated' means in this part of http://tip.golang.org/pkg/sync/#Pool http://tip.golang.org/pkg/sync/#Pool: "Any item stored in the Pool may be removed automatically at any time without notification. If the Pool holds the only reference when this happens, the item might be deallocated." Is there some interface{} similar to C++ destructors, or is that a reference to the fact that the garbage collector need not deallocate unreachable objects?
- unoti 12y agoThe support for Native Client sounds interesting, but the distinction that it's not portable native client makes me wonder what you might use this for. What would one use the native client support for? Could I use it to allow developers to make plugins for a product in Go and C++ in a secure way, instead of using say Lua?
- deleted 12y ago[deleted]
- krasin 12y agohttp://play.golang.org http://play.golang.org runs user programs inside Native Client. See more on the blog post: http://blog.golang.org/playground http://blog.golang.org/playground
- rouille 12y agoOn a related note, do you know if anyone is using Go with Lua plugins (or any other plugin system for that matter) in production. If so, does it work well?
- Matrixik 12y agoHeka? https://github.com/mozilla-services/heka https://github.com/mozilla-services/heka http://hekad.readthedocs.org/en/latest/sandbox/index.html#sandbox http://hekad.readthedocs.org/en/latest/sandbox/index.html#sa...
- jshen 12y agoRandom question, why would someone use gccgo over the standard go compiler?
- whyrusleeping 12y agowith gccgo you get to take advantage of a lot of gcc's optimizations (-O3) and it can generate faster code because of it.
- 4ad 12y agoThere is extremely little code in the world that is faster with gccgo. Yes, gccgo can do better with floating point, but the lack of escape analysis slows it down tremendously in every real world situation out there. http://dave.cheney.net/2013/11/19/benchmarking-go-1-2rc5-vs-gccgo http://dave.cheney.net/2013/11/19/benchmarking-go-1-2rc5-vs-...
- supersillyus 12y agoThere is a GSOC to add escape analysis (https://www.google-melange.com/gsoc/project/details/google/gsoc2014/coko156/5733935958982656 https://www.google-melange.com/gsoc/project/details/google/g...). It'll be interesting to see how that affects things.
- whyrusleeping 12y agoWow. I guess the last time i look at the differences was around 1.1 Thanks for the correction
- cespare 12y agoOne reason is that gccgo supports many architectures that gc does not (SPARC, MIPS, PowerPC, Alpha). It also was the only way to get Go on Solaris until the more recent port of gc to that platform. gccgo is also supposed to produce better code for certain computationally heavy workloads.
- 4ad 12y ago
- binarycrusader 12y agoI'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.
- xal 12y agoI tend to use map[string]interface{} when I need a set. It works okay.
- cespare 12y agos := 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 more advanced set operations, so from my perspective it's fine to leave those to third-party libraries.
- binarycrusader 12y agoYes, 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.
- politician 12y agoI'm very happy about the improvements to net/http.
- pkulak 12y agoLooks like they fixed the connection leak and you can now set real timeouts? Maybe I can finally stop using this hack: https://github.com/pkulak/simpletransport https://github.com/pkulak/simpletransport It sure would be nice to reuse connections without memory blowing up!
- dkural 12y agoHow does performance compare to C++ for this release?
- vanderZwan 12y agoI haven't seen a direct comparison yet, but here's a bunch of benchmarks Rob Pike did comparing Go releases to Go releases: https://groups.google.com/forum/#!topic/golang-dev/2YRmu_AWz68 https://groups.google.com/forum/#!topic/golang-dev/2YRmu_AWz... If you have one version where you have a good grasp of how it compares to C++, that should provide an answer, right?
- dkural 12y agothank you!
- higherpurpose 12y agoIf Go is coming to Native Client, then perhaps it will come to Android, too?
- ithkuil 12y agoNative client support for ARM is not yet there.
- 4ad 12y agoAn ARM target has been exiting for years, it works just fine on Android. Unfortunately (?) this doesn't allow creating GUI apps or using the Android APIs. Camlistore[1] is written in Go and uses a Go backend on Android, it just has a Java shim for the GUI. [1] https://camlistore.org/ https://camlistore.org/
- evidencepi 12y ago"but that the next GCC release, 4.10, will likely have the Go 1.4 version of gccgo." LOL
- neals 12y agoHow are we on IDE's? Last time I tried go (over a year ago) I couldn't really find a nice IDE.
- leaveyou 12y agoI use https://code.google.com/p/liteide/ 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.
- jksmith 12y ago+1 Gets the job done.
- bananas 12y agoI 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.
- _ak 12y agoMost people I know use vim or SublimeText to write their Go code. I personally prefer vim, and use the vim support delivered with Go plus gocode for code completion, that's really all I need for development. Unlike with Java, I never felt the need for an IDE with Go.
- kellros 12y agoIntellij IDEA with http://go-ide.com/ http://go-ide.com/ works for me. Some useful features: 1. Quickly run/restart your application 2. Run specific unit test (all in package, all in file or specific one) 3. Parameter and func signatures are more detailed via CTRL+P (parameter info) than what you would get with GoSublime and GoCode. There's only one thing so far I found a bit quirky: Say you got a function with the signature func() (err error) and pass it as a parameter to another function that has the signature func F(f func() error), it will complain that the signatures don't match, but it will still compile.
- marcosvm 12y agoIt's cool to get those news a couple of days before Gophercon. I'd guess I'm listening to some announcements there.
- thescrewdriver 12y agoI really wish they'd add string interpolation to Go. After being able to use s"My name is $name and surname is $surname" in Scala and "My name is #{name} and surname is #{surname}" in Ruby I find working with printf a giant step backwards.
- DrJokepu 12y agoI wish they didn't! Magic features like this belong to magic languages like Ruby. Go is not meant to be a magic language.
- thescrewdriver 12y agoGo is designed to be a very practical and productive language. It's not quite clear how you're defining "magic" ... String interpolation is both practical and useful.
- DrJokepu 12y agoString interpolation is magic because it's not entirely obvious when it happens, what scope rules are followed, if there are any side effects, if the original string is overwritten or whether a new instance is created, what happens when they are used within bodies of loops, what happens when they are used within closures etc., it just works. Sure these can be specified explicitly but they aren't obvious. It's the kind of feature that is useful when you write an application but not that useful when you're trying to debug it.
- thescrewdriver 12y ago> It's the kind of feature that is useful when you write an application but not that useful when you're trying to debug it. It's largely used in log messages and the like where it's used for debugging issues after the fact. I've yet to encounter a case where anyone was ever confused by the behaviour.
- 12y ago
- giovannibajo1 12y agoCross compilation of programs using cgo? I thought that was landing in 1.3 as well
- 4ad 12y agoIt works fine, provided you have a gcc cross-toolchain.