13 ms·
Go 1.1 is released
- todd3834 13y ago"It is likely that your Go code will run noticeably faster when built with Go 1.1" I have been extremely impressed with Go's performance and now it is even faster! :-)
- atarighat 13y agoGo is awesome!
- xxchan 13y agoReally? I always found it somewhat lacking in this. It has the potential to be so so much faster. Glad to see they're finally working on it.
- burntsushi 13y agoIn terms of speed, Go 1.1 is nearly on par with Java. [1]* [1] - http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=java&data=u64q http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t... * - To the extent that you may find micro-benchmarks a useful measuring stick.
- igouy 13y ago*"Toy programs" as-in -- http://books.google.com/books?id=gQ-fSqbLfFoC&lpg=PP1&dq=Computer%20Architecture&pg=PA37#v=onepage&q=toy%20benchmark&f=false http://books.google.com/books?id=gQ-fSqbLfFoC&lpg=PP1...
- pjmlp 13y agoCongratulations to everyone involved for their work.
- shurcooL 13y agoAnd thank you so much! As of lately, Go is the leading source of my happiness in my dev life.
- minamea 13y agoAny plans to add templates/a form of generic programming? Does the community care about that? How have people been working around that? And congrats! EDIT: Yes I know what the faq says [1]. I was wondering if someone working on that can shed light on how the development of a satisfactory proposal has been going. Also, what's exactly wrong with template instantion like in C++ from the perspective of Go devs? [1] http://golang.org/doc/faq#generics http://golang.org/doc/faq#generics
- cjh_ 13y agohttp://golang.org/doc/faq#generics http://golang.org/doc/faq#generics
- voidlogic 13y ago>>Any plans to add templates/a form of generic programming? The Go team is open to generics as soon as there is a proposal they feel fits right without performance penalties. Read: http://golang.org/doc/faq#generics http://golang.org/doc/faq#generics >>Does the community care about that? Yes, but most people in the Go community are OK waiting for the "right" solution. >>How have people been working around that? Generics are nice and convenient, but you can write anything/everything without generics. Just look at everything written in C. And C doesn't have interfaces like Go.
- coldtea 13y ago>The Go team is open to generics as soon as there is a proposal they feel fits right without performance penalties. Because using interface{} for the same tasks fits so much better and has so much better performance right? Tons of languages have implemented Generics -- it's not rocket science since at least 2 decades. If the Go team is not interesting in working on the thing, then I doubt they would be really evaluating any "proposal".
- voidlogic 13y agoI think Generics are just low priority for the Go team. Maybe we will see them in Go 2.0 >>tons of languages have implemented Generics -- it's not rocket science since at least 2 decades. Sure, but that doesn't mean there are not concerns about the way it is often implemented: http://research.swtch.com/generic http://research.swtch.com/generic
- deleted 13y ago[deleted]
- jgrahamc 13y agoNo generics. Less speed than C. Lame.
- jgrahamc 13y agoSeriously, congratulations to the Go team. And for those who missed my attempt at humor: http://slashdot.org/story/01/10/23/1816257/apple-releases-ipod http://slashdot.org/story/01/10/23/1816257/apple-releases-ip...
- deleted 13y ago[deleted]
- fixxer 13y ago"Damn the torpedos and downvotes, I'm gonna make this joke work!" You, sir, are a risk taker. Kudos.
- voidlogic 13y agoYeah, who needs type and memory safety, a large standard library, OO via interfaces, structural typing, garbage collection, functions as first class citizens, closures, blisteringly fast build times or easy concurrency.....
- enneff 13y agoIt's a reference to CmdrTaco's impressively off-base assessment of the first iPod: http://slashdot.org/story/01/10/23/1816257/apple-releases-ipod http://slashdot.org/story/01/10/23/1816257/apple-releases-ip...
- voidlogic 13y agohaha, thanks :)
- icebraining 13y agoIt wasn't really off-base, it's just that his opinion doesn't correlate very well with the general public's. That said, it's fun to read the old thread. I like this comment from dbrutus: Do you want revolutionary? Ask yourself, what chip is this running? Ask yourself, what is the OS on this thing? This is v0.8 of Apple's PDA folks. They're just waiting for the hardware and the economy to get a little better.
- timothya 13y agoThis website now reflects it too: http://isgo1point1outyet.com/ http://isgo1point1outyet.com/ (For those that don't know, this website was created for a talk about Go given by Andrew Gerrand. Code: https://github.com/nf/go11 https://github.com/nf/go11 , slides: http://talks.godoc.org/github.com/nf/go11/talk.slide#17 http://talks.godoc.org/github.com/nf/go11/talk.slide#17)
- melling 13y agoOne of the features of Go is suppose to be compilation speed. Can anyone compare to C, for example, or discuss compilation speed in large projects (e.g. >100k loc)?
- enneff 13y agoThe Juju guys at Canonical said at GoSF that their >100k LoC project compiles in 6 seconds.
- azinman2 13y agoMuch better than SBT compiling my Scala project (20k? LoC) in 75 seconds (!) on my latest MBP. And that was not from scratch, but having changed about 10 lines of code.
- tptacek 13y agoThe Go compiler is so fast you can use it the way you would a scripting interpreter ("go run whatever.go"); it builds the whole standard library in seconds. Every program I've written in it (topping out at around 20kloc) compiles instantaneously --- I can't perceive the amount of time it takes to compile. C compilers are fast, but they aren't that fast. Go compiles so fast that it changes the way you write and organize code; you would never consider compilation overhead in any decision you made in a Go source tree, where you might do that in a C codebase. For instance, Go programmers routinely compile code, run it, and throw away the compiled binary! You wouldn't think it would be possible for compiler speed to be so much better than C that it would make a difference, but Go's compiler manages it.
- StavrosK 13y ago> Every program I've written in it (topping out at around 20kloc) compiles instantaneously --- I can't perceive the amount of time it takes to compile. Okay, Go is fast, but it's not that fast. My 1000 LoC program takes ~1 second to compile. While it's certainly fast enough for me, it's not imperceptible.
- ehmuidifici 13y agoCongratulations, keep up the good work!
- oakaz 13y agoWhat is the NPM equivalent in the Go world? I wanna give Go a start but can't see any community website that lists Go libraries like NPM. EDIT: I'm not asking for "npm install person/project", I'm asking for a community website and a file like package.json that records information about a project. As I observe, Go projects are really messy. I saw some code importing dependencies like "import github.com/foo/bar". I think Go should focus on declarative programming and its aesthetics culture.
- melvinmt 13y agogo get/install <package-url>? http://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies http://golang.org/cmd/go/#hdr-Download_and_install_packages_...
- oakaz 13y agoIt's the equivalent of npm install <package-url> command, not the NPM.
- mvzink 13y ago$ go get github.com/person/project It will even figure out dependencies by checking every import (and you can do 'import "github.com/person/project"' too), and builds the source by default. And yes, "go get" comes with the standard gotools.
- cobrabyte 13y agoFantastic! Thanks to the Golang team for getting this out the door! I'm surprised by the speed of the dev team. It seems that just a few days ago that we saw the latest RC and just a few days before then was the previous RC. Fast development!
- enneff 13y agoWe would have preferred to have hit RC a bit earlier and left more time between candidates, but we had such a lengthy beta period that we felt it was okay to crank out a few RCs to iron out the last issues and release. I hope the next release cycle will be shorter, and the candidates will come out earlier (and be a lot rougher).
- genwin 13y agoIn February I deployed a website written in Go. It's been running 24/7 since then, pulling from thousands of data sources every ten minutes, no problems, no memory leaks. The thing is so fast on my cheap server (4 ms turnaround) that the only thing I would've done differently is to use a cheaper server.
- sergiotapia 13y agoDoes Go have a defacto web framework?
- voidlogic 13y agoMany of the people in the Go community are anti-framework and pro-library. (inversion of control; a library is provided code called by your code, versus a Framework provided code that calls your code). That being said, right now the dominate Go web library is "net/http" from the Go standard library, supplemented by Gorilla (as needed): http://www.gorillatoolkit.org/ http://www.gorillatoolkit.org/ If what you are looking for is really a Go web framework however, there are a few in development including Revel: http://robfig.github.io/revel/ http://robfig.github.io/revel/
- lelandbatey 13y agoI would love to know about this as well. Basically a basic rundown of how Go works in relation to running various web facing stuff (a simple API for example).
- genwin 13y agoSee http://golang.org/doc/articles/wiki/ http://golang.org/doc/articles/wiki/ for a starting point.
- speg 13y agoI've seen Gorilla (http://www.gorillatoolkit.org/ http://www.gorillatoolkit.org/) used quite a bit. The standard library is also good enough for small and quick things.
- 13y ago
- orangethirty 13y agoI'm rewriting Nuuton with Go. Before, I was using a combination of Python (with Django), and Lisp (for the back end processing). After playing around with Go for a couple of hours, I decided to do a little test. Went ahead and wrote a simple API that mimicked how Nuuton worked. It turned out to be so simple and fun to build that I decided to trash all of the old code base and rewrite it in Go. The performance is great (it runs circles around the Python/Django code (expected)), but what I like is the syntax, and how easy it is to work with it. In my mind, its the right mix of C and Python. Its just an awesome language to work with.
- jervisfm 13y agoWhat is your Nuuton project about ?
- deleted 13y ago[deleted]
- orangethirty 13y agoA search engine. From what I know, its the only engine using Go (aside from Google.) Blekko uses Perl, DDG uses python (I think), Bing uses unicorn blood, and all the smallr ones use Jva and/or C++.
- omaranto 13y agoYou needn't have said "aside from Google": it seems that Google doesn't use Go for the search engine.
- orangethirty 13y agoThey do use it on some parts of the system. But its not a pure Go implementation like Nuuton. (:
- bradfitz 13y agoIt's mostly C++ for indexing and lookup, but "Search" is a big topic, and there are Go, Java, and Python parts in the many systems that make Google's web search work. Go is growing in popularity within Google.
- sergiotapia 13y agoProgrammer for 8 years, in a wide variaty of languages but never touched a language that had pointers. How much do I need to know about pointers to use and learn Go? Is Go garbage collected in the C#/Ruby sense? I recently switched from full ORM usage to hand tuned SQL queries and loved watching the speed of my application increase 10-fold. I'm having a bit of a speed high and Go seems like the perfect language for this. What book should I buy to learn Go from the ground up? Edit:This seems like the perfect place to start. http://www.golang-book.com/ http://www.golang-book.com/
- voidlogic 13y ago>>How much do I need to know about pointers to use and learn Go? Do you understand how they work in C? Maybe try reading a little about that. For Go, I'd recommend starting here: http://tour.golang.org/#1 http://tour.golang.org/#1 (Don't miss the next arrow in the lower right-) After running through that you should have an idea of what you don't know- which makes asking questions people can provide useful answers to much easier. :) >>Is Go garbage collected in the C#/Ruby sense? I'm not sure what your sense of C#/Ruby GC is, but I'd go with yes.
- city41 13y agoPointers are not difficult. Take what you know about references as a starting point and go from there. In many cases, references and pointers behave very similar. When you get into the more interesting things that are possible with pointers, just remember they are merely a value that holds a memory address. If you keep that in mind, the complexity is muted a lot. Just dig into Go and see what you find.
- genwin 13y agoI concur with this approach. My former languages do not have pointers either. It is refreshing to have them as an option, and they are not difficult to get used to.
- coldtea 13y ago>How much do I need to know about pointers to use and learn Go? Very little. Just what pass by value and pass by reference mean in the context of pointers. The very basic you need to know is: if a function argument is defined as (*foo), you are changing the item you pass to the function (like in Javascript or Java), whereas if it's defined as (foo), you're changing a copy of it and the original item remains unaffected. Go has pointers, but no pointer arithmetic (in the base language), and it also has GC, so most of the problems people have with pointers in C are not there.
- mamcx 13y agoThe ARM branch mean is possible to do iOS dev on it?
- elithrar 13y ago> The ARM branch mean is possible to do iOS dev on it? No. You can compile for ARM + a platform (i.e. Linux, BSD) if you want to run Go code on an ARM device. Think RaspberryPi or Beaglebone running an ARM port of Ubuntu/Arch. Writing Go code targeting iOS (or Android) is a whole 'nother ballgame.
- 4ad 13y agoAndroid is just Linux, Go works perfectly fine on it. Go issues syscalls directly and doesn't use libc for that (it uses glibc for name resolution, but with cgo disabled it doesn't do even that). Minux did an iOS port, it's not part of the official tree because an iOS port required a rooted device. Perhaps this might have changed as with two word funcs, the Go runtime doesn't do runtime code generation.
- yepguy 13y agoNo, the ARM architecture is only supported on Linux right now (although unofficially it's mostly working on some other platforms too). I remember reading that Go was ported to darwin/arm, but it can never be supported since there is no way to legally run their test suite for it.
- myko 13y agoiOS is too locked down to properly build Go code for. It's possible to write useful Go code on Android though, Brad Fitzpatrick posted about doing so recently: https://plus.google.com/115863474911002159675/posts/DWmyygSrvt7 https://plus.google.com/115863474911002159675/posts/DWmyygSr...
- 501 13y agoThis ticket might interest you: http://code.google.com/p/go/issues/detail?id=837 http://code.google.com/p/go/issues/detail?id=837 Maybe one day it'll come. If on that day iOS has gained a public XPC API I'll be quite the happy camper.
- klobucar 13y agoJust waiting on the PR to go through for Homebrew to pick-up go 1.1 :) https://github.com/mxcl/homebrew/pull/19782 https://github.com/mxcl/homebrew/pull/19782
- kibwen 13y agoDoes Go have a roadmap of development work for future releases? One thing that I've been very curious about is if the Go devs will be able to resist the tendency of every other language (save perhaps Lua) to linearly increase in complexity over time.
- enneff 13y agoWe are most certainly concerned with language complexity. We will only add features that mesh well with the Go we know and love, not just for the sake of utility (every feature is at least useful).
- kibwen 13y agoThat's good to hear, but it still raises the question of what you're spending your time on. :) I imagine that all the low-hanging GC-related fruit has been plucked for 1.1, so what are users clamoring for now? Without a maximalist attitude, do you foresee a point where the language is declared as "done" and all the full-time devs just pack up and move on?
- howeman 13y agoAt this point there are something like 600 open issues, so I think that will be a while.
- owyn 13y agoI asked this exact question once when bradfitz was giving a talk about Go at AirBnB. The answer was that the team is led by minimalists who are interested in keeping it lean and avoiding bloat and especially in avoiding it becoming C++. In fact, you can see his answer about Go 2.0 roadmap plans (where the answer is basically "too soon to think about that yet") followed by my question (at 54:50) of this talk: http://www.youtube.com/watch?feature=player_detailpage&v=GHaXN8G10fI#t=3208s http://www.youtube.com/watch?feature=player_detailpage&v... I guess the question then is "do you trust those guys?" So far the answer seems to be yes.
- mcot2 13y agoGo is awesome! The best feature of 1.1 is very large heaps on Linux x64. I was bumping into the limits before but the 1.1 rc has been rock solid so far.
- azinman2 13y agoAs a no-go programmer looking through the data race detector docs (http://golang.org/doc/articles/race_detector.html http://golang.org/doc/articles/race_detector.html), it to me shows snippets of a really ugly language with poor readability. Examples from Google's page: var service map[string]net.Addr When I read this it's easy to skip seeing string, aside from the fact that ] as a delimiter also looks like net.Addr was accidentally combined with the previous line. func ParallelWrite(data []byte) chan error { res := make(chan error, 2) f1, err := os.Create("file1") if err != nil { res <- err } else { Here we see no parenthesizes used in if statements, yet we retain {. In skimming it's easy to miss the if in the first place. Yet everywhere else they're happy to use parenthesizes. We also see that "make" is lowercase yet a method, but os.Create and ParallelWrite has caps for a method. There's also the fact that the array (I'm guessing) of bytes diverges from every other language to put them in front of the type which looks like crap. We see the same poor choices of delimiters as with map value types. Then there's this func main() { c := make(chan bool) m := make(map[string]string) go func() { m["1"] = "a" // First conflicting access. c <- true }() m["2"] = "b" // Second conflicting access. <-c for k, v := range m { fmt.Println(k, v) } } <-c looks like its just dangling, and if this is meant to say there's some kind of stream or assignment then does it just go to /dev/null? Yet "c <- true" is also correct? I'd argue for either void <- c, _ <- c, or c.read() if wanted to support something like that. It's also difficult to tell in the for loop if v is being assigned as "range m", or if "k, v" are a tuple resulting from "range m" It's too bad because the goals of the language are quite nice from a CS perspective.
- landr0id 13y ago`<-c` is the main routine waiting for the other goroutine to finish (`c <- true`). It's being blocked until there's something for it to receive. > It's also difficult to tell in the for loop if v is being assigned as "range m", or if "k, v" are a tuple resulting from "range m" The `range` clause returns two values: index, and value at that index. It's really pretty easy to read and get used to once you actually read some documents.
- elithrar 13y ago> Here we see no parenthesizes used in if statements, yet we retain {. In skimming it's easy to miss the if in the first place. Yet everywhere else they're happy to use parenthesizes. I feel that braces on blocks are more important to readability/clarity—because blocks should be identifiable—compared to parentheses for if statements. I don't think the if gets lost in there, but if you do then that's fine. > We also see that "make" is lowercase yet a method, but os.Create and ParallelWrite has caps for a method. That's because "make" is a built-in function for building slices and maps. Packages with exportable functions (i.e. os.Create, http.HandleFunc, etc, etc) use capitalisation to denote "public" functions[1]. Functions within the os or http packages (for example) that should not be used directly by someone using the library retain a lowerCase approach. This reduces the risk and confusion surrounding which functions you should be working with when using a library. > It's also difficult to tell in the for loop if v is being assigned as "range m", or if "k, v" are a tuple resulting from "range m" Each key:value pair in m (a map, or "dictionary") is being assigned—hence the :=, which declares & assigns k & v in one line—for the entire range ('length', really). Obviously you don't agree with some of the syntax in Go. That's fine. But some of your criticisms appear to stem from a misunderstanding or lack of knowledge about some language-agnostic concepts (channels, range, exportable functions) that I don't think Go obscures. [1]: http://golang.org/doc/effective_go.html#commentary http://golang.org/doc/effective_go.html#commentary
- rlf 13y agoSounds like Go is the new node.js.
- stcredzero 13y agoIt seems a shame that more hasn't been done with Go and games. The concurrency facilities seem particularly fantastic for this.
- enneff 13y agoA friend did a couple of of the Ludlum Dare comps in Go. Here's the most recent one: https://github.com/kurrik/ld26 https://github.com/kurrik/ld26
- iand 13y agoThere is quite a lot of gamedev activity in Go and quite a few bindings to GL, SDL and the like. I've written a (bad) game in it and am currently working on a better one. I know of at least one commercial game being written in it. There are lots of emulators written in go for some reason too. I'm finding the multiplayer aspects of my current game to be an excellent fit for Go, making good use of concurrency and networking.
- lclarkmichalek 13y agoI'm doing a little game in it at the moment. Had to write my own allegro bindings (https://github.com/bluepeppers/allegro https://github.com/bluepeppers/allegro), but it's fun enough. One thing I really enjoy is mixing event handling with the goroutines. For example, I wanted to start scrolling the map on the user's click, and then stop when they release the button. So on click, I fired up a goroutine just to watch for the button release and handle the scrolling. So much easier than having some variable somewhere called "isButtonXDown" and then checking it in the main loop. Of course, you have to be carefully with concurrency, but it's a lot of fun.
- rcoh 13y agoI'm especially excited about the race detector. It looks like a practical implementation of http://cseweb.ucsd.edu/~savage/papers/Sosp97.pdf http://cseweb.ucsd.edu/~savage/papers/Sosp97.pdf. Always exciting to see research coming up in practice!
- venuzr 13y agoWhat is the recommended way to go about debugging a Go program? Is there something better than GDB if I want to look at the call stack, have breakpoints, look at the state of variables etc. Using GDB seems akin to working with assembly
- jussij 13y agoThere're a few Go IDEs that integrate GDB into the IDE. http://geekmonkey.org/articles/20-comparison-of-ides-for-google-go http://geekmonkey.org/articles/20-comparison-of-ides-for-goo... I'm the author of one of them (Zeus) and while the results are not as slick as the Visual Studio debugger it's a better than straight out GDB.
- f2f 13y agothe %v and %T flags to the printing package. surprisingly powerful :)
- kamaal 13y agoGo doesn't have exception handling. How practical is it to use such a language for large code bases?
- Devilboy 13y agoIt has explicit error handling (via multiple return values) which the authors argue is superior (even if more verbose) because they know from experience that programmers tend to make mistakes forgetting to check for errors in their code. If the error code comes back as a return value the programmer has to consciously decide what to do with it immediately, leading to better code on average.
- osi 13y agoas long as you aren't calling what you consider to be a 'return void' function (like writing data to a socket). then it is easy to forget to check the return value.
- icebraining 13y agoPractical is subjective, but there are a lot of large, successful projects written in C, so it's definitively feasible.
- kamaal 13y agoOf course if you say 'you have to live with it' then you really have to 'live with it'. After some time, you no longer complain about it. But this is 2013, there are somethings that expected to come from a language default. Exceptions are one of them, few such things I can think of are things like regular expressions, closures etc.
- seabrookmx 13y agoExceptions are extremely controversial in programming language circles. They reduce encapsulation, and the try/catch syntax as seen in java encourages bad error handling. Any idiot can put their whole program in a giant try/catch block. It's really a hard design problem. I agree that some form of error handling should be a language default, but I'm not sure if "traditional" exceptions should be it. As a C++ dev who has worked on projects with and without exceptions, I can say there is pros and cons to both.
- bjacokes 13y agoOur web hosting service at Parse (launched last week) is built entirely in Go. It happens to live in a sweet spot for the language: we need to query Memcache and/or Mongo to figure out exactly how to route a request but don't want to block the thread, which is dead simple in Go. I've personally had a great time using the language, and I am hoping to write up a blog post on our experience within the next week.
- iLikeCookies 13y agoHey guys! I was inspired by all these rave responses. And decided to download and try. When I came to downloads page I saw only about 1000 downloads (uploaded 38 hours ago). And all my inspiration has disappeared. It would be interesting to compare number of downloads for Python/Ruby.