Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Programming

Go Version 1 Released 186

New submitter smwny writes "Google's system programming language, Go, has just reached the 1.0 milestone. From the announcement: 'Go 1 is the first release of Go that is available in supported binary distributions. They are available for Linux, FreeBSD, Mac OS X and, we are thrilled to announce, Windows. ... Go 1 introduces changes to the language (such as new types for Unicode characters and errors) and the standard library (such as the new time package and renamings in the strconv package). Also, the package hierarchy has been rearranged to group related items together, such as moving the networking facilities, for instance the rpc package, into subdirectories of net. A complete list of changes is documented in the Go 1 release notes. That document is an essential reference for programmers migrating code from earlier versions of Go. ... A similar process of revision and stabilization has been applied to the App Engine libraries, providing a base for developers to build programs for App Engine that will run for years.'"
This discussion has been archived. No new comments can be posted.

Go Version 1 Released

Comments Filter:
  • by CondeZer0 ( 158969 ) on Wednesday March 28, 2012 @02:21PM (#39499649) Homepage

    The amazing thing is that even before the first stable release is out quite a few organizations are using Go in production to run real systems. Very impressive:

    http://go-lang.cat-v.org/organizations-using-go [cat-v.org]

    • by vAltyR ( 1783466 )
      Don't forget vitess [google.com], which is a Google project aimed at making MySQL databases scale better, and is used in YouTube. The Thanksgiving Google Doodle [golang.org] was also written in Go, and developed in 24 hours. Google does eat their own dogfood.
  • Added value of Go? (Score:5, Interesting)

    by billcarson ( 2438218 ) on Wednesday March 28, 2012 @02:25PM (#39499691)
    Can someone explain to me what Go's aim is, and why exactly it requires a new programming language? Is it meant a replacement for Java/C++/Python, or does it cater a new branch of programming?
    • by cgt ( 1976654 ) on Wednesday March 28, 2012 @02:32PM (#39499787)
      It is supposed to be a systems language like C, but better. It's sort of like Pythonic C (very expressive, but still C like).
      • by Urban Garlic ( 447282 ) on Wednesday March 28, 2012 @02:46PM (#39499981)

        Maybe I'm too old-school, but when I think "systems language", I think about something that would be good for embedded devices or kernel device drivers, stuff that's pretty close to the metal. I wouldn't use Go for that, garbage-collection and concurrency mean there's heap traffic and IPC signaling under the hood that I probably want to control.

        I agree with the "C but better" characterization, but the ways in which it's better disqualify it from being a good systems tool, I think.

        • by PCM2 ( 4486 ) on Wednesday March 28, 2012 @02:51PM (#39500027) Homepage

          Maybe I'm too old-school, but when I think "systems language", I think about something that would be good for embedded devices or kernel device drivers, stuff that's pretty close to the metal. I wouldn't use Go for that, garbage-collection and concurrency mean there's heap traffic and IPC signaling under the hood that I probably want to control.

          Java is used in a lot of embedded systems, and it has garbage collection and concurrency.

          Unlike Java, though, Go compiles to native binaries, rather than running on a VM (though maybe the real difference is debatable with modern JITs).

          • Embedded has become a rather broad space these days as the range of computing hardware that's built into other devices gets more powerful at the high end.

            Like the GP I think I'd usually prefer to think of a "systems language" as something that's suitable for kernel programming and for the low cost / simple CPU end of embedded work, where things can still be very highly resource constrained. But I can see why they're calling Go one, since I'd also expect a "systems language" to be suitable for writing OS ut

            • by PCM2 ( 4486 )

              Yeah, I think their definition of a "systems language" is broader than that. Maybe on Plan 9/Inferno, the predecessors of Go qualified as systems languages, because the OS provided a lot of the infrastructure for what they did. On other operating systems, the language itself has to provide that same infrastructure (e.g. garbage collection), so to call Go a strict systems language is a little specious.

        • by GWBasic ( 900357 )
          I get the impression that go is suited to high-performance network software where C would be too low-level. The memory isolation model minimizes the overhead of garbage collection, because it can be optimized to not "stop the world."
        • Re: (Score:3, Interesting)

          by Spykk ( 823586 )
          I tried grabbing go and compiled a hello world to compare it to C:

          [talisman@talisman-pc:~/tmp]$ uname -a
          Linux talisman-pc 3.2.13-1-ARCH #1 SMP PREEMPT Sat Mar 24 09:10:39 CET 2012 x86_64 AMD Athlon(tm) II X4 640 Processor AuthenticAMD GNU/Linux
          [talisman@talisman-pc:~/tmp]$ cat test.go
          package main

          import "fmt"

          func main() {
          fmt.Println("Hello, world")
          }
          [talisman@talisman-pc:~/tmp]$ time go build test.go

          real 0m2.215s
          user 0m2.547s
          sys 0m0.210s
          [talisman@talisman-pc:~/tmp]$ ls -lh te

        • by Greyfox ( 87712 )
          You can come up one level from that and still be doing systems programming types of stuff. I tend to think of things like process control (fork, exec, waitpid, etc,) and IPC (semaphores, pipes, shared memory, network sockets.) Stuff like writing shells and servers, that not everyone got into. The old IRC, FTP, telnet, DNS and mail servers I'd consider examples of system programming. Also your shell, and maybe the editor (Maybe vi, maybe not ed...) Some of that stuff can be done equally as well in Java, thou
      • by GreatBunzinni ( 642500 ) on Wednesday March 28, 2012 @06:08PM (#39502579)

        It is supposed to be a systems language like C, but better.

        IMHO, if it isn't standardized, opened up and backed up by an international standard then it will never be better than C. For all problems that may or may not affect C and for all problems involved in the development and update of a standard for each version of the C programming language, these multiple versions of the C programming language are effectively set in stone. This means that the language is future-proof, as multiple implementations may be developed and, by targetting the standard, they can interoperate without any major consequence.

        If Go isn't standardized and if Google intends to control the language then it would be a terrible decision to adopt Go instead of a time-tested, well established tool which is future-proof and resistent to bit-rot. We all have Oracle and Java [javaworld.com] as a good warning.

        • I have a generally better feeling about this project than I ever did about Java or C#. It seems like the prevailing sentiment is common sense. But mind you, maybe that is becuase I have not yet tried it. But I will fix that now.

          • OK, I checked out the merurial repo (good taste!), built it and ran hello.go. Just one thing: the syntax "go run hello.go" is stupid, it should be "go hello.go" and --options for anything else you want to do.

    • by Quirkz ( 1206400 )
      In addition, if I'm a hobbyist programmer who's gotten by on PHP and some JavaScript for web stuff over the last decade and a half, and I'm thinking about picking up something new, should I consider Go or stick with one of the older standards?
      • I spent a little time playing around with it a few months ago. It had its good points and bad points -- enough of the latter that I didn't pursue it any further.

        The syntax is obviously C-inspired, but with some changes, many of which seemed like experimentation -- doing something different just because it's different. Although I don't object to the philosophy, I'd like to see how those changes work out before investing a lot of time into them. In particular, the declaration syntax feels very strange to p

      • Re: (Score:3, Insightful)

        by Anonymous Coward

        I would stay away from Go and pick up Python. It has lots of good libraries and frameworks. Its used in some games and lots of open source projects as their scripting language. Python is a very expressive and general purpose language. It does not appear to be going away within the next decade and in fact I expect Python to become much more prevelent once PyPy becomes more robust. Added to all that, extending Python with commonly available libraries is not a difficult task and there are numerous approaches (

        • Yeah, I'm waiting for PyPy to be Python 3 compatible, then jumping head-first into it and not looking back.

          • by JanneM ( 7445 )

            We use Python quite a lot in my field of work (computational neuroscience). The main tool I sue right now is slowly, gingerly, gradually removing support for Python 2.4 over the nex year or so, and will require 2.5 or later from then on. Python 3 is not anywhere on the horizon and won't be for a long time.

            I don't expect to even take a serious look at Python 3 before the end of this decade.

      • Go isn't intended to replace web scripting languages. Dart is their language intended to replace JavaScript, and it's going to go exactly nowhere.

        I'd suggest Python to replace PHP, and jQuery to abstract away the bulk of the pain of multi-browser JavaScript.

        But it depends on if you're talking continuing to do web stuff, or if you want to do something else.

        • by Quirkz ( 1206400 )
          A little bit of both, probably. I'm definitely curious about at least trying some non-web stuff, in addition to likely continuing to do web-based work as well. My last project was a web-based game and I haven't quite figured out what the next project is going to be.

          Sounds like Python is appropriate for almost all situations, though, so maybe that's a good direction to pick.
          • Yeah, Python can definitely be used for non-web stuff. I just saw a video about a guy who used Python to interface with openCV (computer vision) to make a squirrel-shooting watergun. He used Python and openCV to take images from a webcam, and allow it to know the difference between squirrels and birds, and only shoot the squirrels away from the bird feeder. Pretty fun stuff.

    • by Raenex ( 947668 ) on Wednesday March 28, 2012 @03:39PM (#39500707)
      http://golang.org/doc/go_faq.html [golang.org]

      What is the purpose of the project?

      No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously. There are several trends:

      • Computers are enormously quicker but software development is not faster.
      • Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation.
      • There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.
      • Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.
      • The emergence of multicore computers has generated worry and confusion.

      We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation. Regarding the points above:

      • It is possible to compile a large Go program in a few seconds on a single computer.
      • Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.
      • Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.
      • Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.
      • By its design, Go proposes an approach for the construction of system software on multicore machines.
      • Re: (Score:2, Insightful)

        Go may be a fine language. I'm not sure, I've not really looked at, but it does have some neat things in it. However, that does dound a little fuddy to me.

        Computers are enormously quicker but software development is not faster.

        I program mostly in C++. In the last 10 years, even ignoring C++11, the C++ landscape has changed enormously, with compliant compilers and advanced libraries. C++ today is nothing like C++ in 2002 and even the same language has turned into a much more effective platform.

        There is a gro

        • by Raenex ( 947668 )

          In the last 10 years, even ignoring C++11, the C++ landscape has changed enormously, with compliant compilers and advanced libraries.

          It's still stuck with the crappy #include mechanism instead of proper modules, along with slow compile times, plus the many traps and pitfalls that come with the language. C++ as a language is fearsomely complex.

          programmable typesystems have become more mainstream

          Really? Do you have real-world examples to cite? I also don't think the backlash against static type systems has disappeared. It's a constant source of contention.

          Some popular languages don't generate garbage in the first place (and can automatically clean up any resources). It's obvious they're taking a dig at C++ there.

          RAII comes at a cost (the programmer has to carefully implement it) and places limits on the structure of your program (such as avoiding

  • Wake me when it has supports seemless integration into Python like Fortran and C (with ctypes) -- then I might consider it for coding CPU-intense stuff. It's supposed to be as fast as C with better syntax, isn't that the point?

  • but mandating their terrible indent style is not one of them.
    • by Cenuij ( 526885 ) on Wednesday March 28, 2012 @02:32PM (#39499793)
      The style, or your preference for a particular style, is not important in the least. What's important is the consistency. Really... *nobody* cares what style *you* prefer.
      • Really... *nobody* cares what style *you* prefer.

        The most important person who cares what style he prefers is him. Really, that's all that matters.

        It's a silly reason to drive people away from your language. I'm sure a smart preprocessor could deal with many indent styles just fine, but what's scary is when the language developers say, "here is how you will use our language." Because other people always find more clever things to do with flexible languages than the designers intended. That's just being

      • The style, or your preference for a particular style, is not important in the least. What's important is the consistency. Really... *nobody* cares what style *you* prefer.

        Go has "gofmt" which reformats code to a sensible standard and is also used by editors, so basically all code in Go is formatted consistently. There really isn't any discussion on formatting; everyone has taken the attitude of 'whatever gofmt does is fine, and that's the standard we'll use.'

    • by cgt ( 1976654 )
      I completely agree with this. I love Go! It is the most excited I have been about a programming language since Python, but the semi-colon issue is stupid. Why do automatic insertion of semi-colons if it causes problems? Why not just let developers insert the semi-colons themselves? Programmers have done so for decades so it probably won't kill them. Do it right or don't do it at all (automatic semi-colon insertion).
      • by HiThere ( 15173 )

        The semicolon issue probably isn't any more significant than Python's indentation based syntax. Both can work, and both require adjusting to. And both are a nuisance. I refused to use Python until they officially allowed tab based indentation (as long as you were consistent about it). I.e., as long as Python3000 was going to disallow tab based indentation, I wasn't willing to bother learning it. When they changed that, I found it something I could adapt to. I still find it annoying, but every language

    • IMHO the indent wars are best solved in the editors. For example, I've always preferred tabs because one tap of the tab key gets me to the start of the line. Holding down the spacebar is not ergonomic for me. I always overshoot or undershoot.

      I could fire another salvo in the tabs vs. spaces war, or I could have an editor that's smart enough to look at spaces at the beginning of the line and let me tab through them. Problem solved.

      I don't like Go's K and R indents either. This is only marginally more t

      • You know that Emacs has been able to let you use the tab key to insert the correct number of spaces for the current line for probably 30 years, right? I suspect that Vim can do it, too.
  • Do the developers of GO have beards [techcrunch.com]?

  • Just like google real estate will transform the industry (SQUIRREL!) and google's solar power efforts will transform the world (SQUIRREL!) and google's anonymous accounts that protect user privacy (SQUIRREL!).

    Sure, I'll invest my precious time in Go. You bet.

    • The amazing thing about corporations is that they are comprised of many individuals who can concentrate on many things at once without being distracted by what color squirrel is running past the office in some other lab.

  • Answer: It is the follow on to Limbo.

  • It lacks a lot of things that you would expect, like inheritance and operator overloading. To me this is a step too far, I mean its like going back to the 70s and using straight c almost.
  • I was SO hoping this would be another abandoned project

    The syntax just blows!

  • FTFA:

    You might have seen early Go talks in which Rob Pike jokes that the idea for Go arose while waiting for a large Google server to compile. That really was the motivation for Go: to build a language that worked well for building the large software that Google writes and runs.

    I looked at the Go pages for 15 minutes to try to figure out why this was commissioned as a project to begin with. Ultimately I ran into the above paragraph. Projects like this make me think that Google no longer has a clear idea

    • by Cenuij ( 526885 ) on Wednesday March 28, 2012 @03:16PM (#39500339)

      I don't think you fully grok what they have achieved. Google employs only a handful of people who work on Go, and probably not all them work full time on it (though maybe that's not true lately in the last release cycle).Let me give you a quote from an accomplished (hint, you use his code every day) C & C++ hacker on using Go:

      "In my experience Go is probably 5-10x faster than C or C++. I estimate that programs that take me half an hour to write in Go would take me about 2½ hours in C and 5 hours in C++."

      Then when you only have to wait about 10 seconds or so for the whole Go std library *and* all your own libs and binaries to build, you can see it's value over waiting for large C++ projects (of which Google has many) to build.

      • by jgrahn ( 181062 )

        I don't think you fully grok what they have achieved. Google employs only a handful of people who work on Go, and probably not all them work full time on it (though maybe that's not true lately in the last release cycle).Let me give you a quote from an accomplished (hint, you use his code every day) C & C++ hacker on using Go:

        "In my experience Go is probably 5-10x faster than C or C++. I estimate that programs that take me half an hour to write in Go would take me about 2½ hours in C and 5 hours in C++."

        Who's that? One of the Go designers, perhaps? He's doing something fundamentally wrong if it takes him more time to code in C++ than in C.

        Then when you only have to wait about 10 seconds or so for the whole Go std library *and* all your own libs and binaries to build, you can see it's value over waiting for large C++ projects (of which Google has many) to build.

        Long compile times is more of a build system problem than a compiler problem, IME. Of course, lots of people have broken build systems, and compile the same things over and over again ...

        • by hanwen ( 8589 ) on Wednesday March 28, 2012 @07:38PM (#39503525) Homepage Journal

          I write both Go and C++ at google. Sadly, Rob Pike's joke has a definite core of truth: writing C++ code at google is extremely time-consuming and difficult to get right because it has to be multi-threaded and asynchronous.


          Long compile times is more of a build system problem than a compiler problem, IME. Of course, lots of people have broken build systems, and compile the same things over and over again ...

          Well, our in-house developed build system is the best I've ever seen, and probably the best in the industry. Read more about it here [blogspot.com]. Even with all the niftyness of a thoroughly correct build system and a data-center sized ccache, it still sucks.

          Go is definitely awesome, and I recommend everyone to set aside the gripes with the syntax and learn it. I guarantee you that you'll be pleasantly surprised.

      • "In my experience Go is probably 5-10x faster than C or C++. I estimate that programs that take me half an hour to write in Go would take me about 2½ hours in C and 5 hours in C++."

        Extraordinary claims require extraordinary evidence. And the evidence that is out there states that the claim Go is 5-10x faster than C or C++ is bullshit. In fact, it's slower. [debian.org]

        Notice the benchmark where Go took 30x the time the C program did to finish the benchmark?

        • He is saying that Go is 5-10 times faster to compile than C++, not that the output binary runs faster.

        • by bbn ( 172659 )

          Notice the benchmark where Go took 30x the time the C program did to finish the benchmark?

          Apparently this is a case of the C program using a mature library to do the heavy lifting. The Go program uses a slower library. Neither the C program nor the Go program actually implement the algorithm so it is a poor test of the languages and compilers. Instead it is a test of the libraries.

          A practical program depends alot on libraries so I am not trying to talk down the significancy of a slow library. I am just pointing out that as a language and as a compiler the Go team is appears to be doing fairly we

  • by Dwedit ( 232252 ) on Wednesday March 28, 2012 @03:06PM (#39500223) Homepage

    How does this language compare with Mozilla's new programming language?

  • by inglorion_on_the_net ( 1965514 ) on Wednesday March 28, 2012 @03:13PM (#39500289) Homepage

    First time I looked at Go, my conclusion was "this language isn't ready". The next time I looked at Go, I concluded that it had essentially bled to death. But the release of version 1 changes things. I will take another look. I hope they've worked out enough of the details for me to be able to tell if this is a language I would love to work with or not.

    • The semicolon at the end of the line thing decided me that it was a toy language. That the meaning of the statement(s) change if the semicolon is on a new-line or on the same line.

      • by kikito ( 971480 )

        > That the meaning of the statement(s) change if the semicolon is on a new-line or on the same line.

        I don't know what you mean. In Go, semicolons are clearly stated *not* supposed to be used to end lines. There is no ambiguity there.

        • I can't remember the specifics now, but it was something to do with the meaning of the line changing if the semicolon was on the end of the line, or on the next line. The statement was one that needed a semicolon. So to me it showed a big inconsistency.

  • new Rune data type (Score:3, Insightful)

    by bames53 ( 300438 ) on Wednesday March 28, 2012 @05:00PM (#39501705)

    I see language designers are still making the mistake of trying to represent characters as fixed size entities. Go 1 adds a new data type 'rune' intended to represent a UTF-32 codepoint, which is fine as long as it's only used for code points, but then the example code they show is:

            delta := '' // delta has type rune.
            var DELTA rune
            DELTA = unicode.ToUpper(delta)

    When you design an API that accepts or returns individual characters (as opposed to code units or code points), do not use rune, char, wchar_t, char16_t, char32_t, int, or any other fixed length type to represent a character. Characters are fundamentally variable length.

    You should use a string data type because fixed size types can only represent a subset of characters. For example, a single UTF-32 code point cannot represent the Lithuanian characte LATIN SMALL LETTER A WITH OGONEK AND ACUTE. In Unicode this character can only be represented as a sequence of multiple code points (<U+0105> <U+0301> or <U+00E1> <U+0328> or <U+0061> <U+0328> <U+301>). So using strings works whereas using a fixed size type will inevitably fail.

    Using strings to represent a character has another advantage beyond the fact that it's the only way that works. It eliminates the client's need to convert between the string type and the type used to hold a code point. Clients can just directly use text in whatever the native encoding is.

    • Q: What is a string?
      A: A sequence of characters

      Q: Ok, what is a character?
      A: Well obviously, each character should be a string!

      QED

    • Re: (Score:3, Informative)

      by jrumney ( 197329 )
      A "character" data type has no meaning beyond representing codepoints. There are languages, such as Hindi (and other South Asian languages) and Arabic, where any attempt to output a single character at a time will result in an unreadable mess due to the fact that characters change their shape depending on what comes before or after. So a better rule is not to use strings to represent a character, but to always output whole strings, never individual characters.
  • by Pengo ( 28814 ) on Wednesday March 28, 2012 @05:33PM (#39502127) Journal

    Does anyone know if this is an R&D project that could be poking at the idea of a litigation free runtime for Android away from Dalvik?

    I'm curious to see how this language evolves and its internal adoption inside of google.

    Regardless of the language taking off or not, it's a great to see a new language enter the ecosystem, and no doubt we'll learn things from it that can be brought back into main-stream languages or interesting innovation that could open the doors for new (pray disruptive) development in new areas.

  • Skynet, is that you?

"Someone's been mean to you! Tell me who it is, so I can punch him tastefully." -- Ralph Bakshi's Mighty Mouse

Working...