Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Software Google Programming Technology

Go, Google's New Open Source Programming Language 831

Many readers are sending in the news about Go, the new programming language Google has released as open source under a BSD license. The official Go site characterizes the language as simple, fast, safe, concurrent, and fun. A video illustrates just how fast compilation is: the entire language, 120K lines, compiles in under 10 sec. on a laptop. Ars Technica's writeup lays the stress on how C-like Go is in its roots, though it has plenty of modern ideas mixed in: "For example, there is a shorthand syntax for variable assignment that supports simple type inference. It also has anonymous function syntax that lets you use real closures. There are some Python-like features too, including array slices and a map type with constructor syntax that looks like Python's dictionary concept. ... One of the distinguishing characteristics of Go is its unusual type system. It eschews some typical object-oriented programming concepts such as inheritance. You can define struct types and then create methods for operating on them. You can also define interfaces, much like you can in Java. In Go, however, you don't manually specify which interface a class implements. ... Parallelism is emphasized in Go's design. The language introduces the concept of 'goroutines' which are executed concurrently. ... The language provides a 'channel' mechanism that can be used to safely pass data in and out of goroutines."
This discussion has been archived. No new comments can be posted.

Go, Google's New Open Source Programming Language

Comments Filter:
  • by cptnapalm ( 120276 ) on Wednesday November 11, 2009 @01:29AM (#30056532)

    Not having much luck. It can't find /etc/passwd, /etc/group or /etc/hosts. All of which do exist. I'm inserting fmt.Fprintf statements to attempt to figure out why it is having problems.

    A novel idea: make people learn Go by requiring them to modify it in order to install it.

  • Re:Wonder? (Score:4, Informative)

    by michaelmuffin ( 1149499 ) on Wednesday November 11, 2009 @01:56AM (#30056744)

    Does Go have goto statement ?

    why wonder when you can look it up? http://golang.org/doc/go_spec.html [golang.org]

    tl;dr yes, it has goto

  • by Animats ( 122034 ) on Wednesday November 11, 2009 @02:08AM (#30056808) Homepage

    It's a small complaint, I'm sure.. but couldn't they have given it a name that you could, you know, Google?

    One could do worse. There was a language called "C+@" developed at Bell Labs. It's derived from C, with classes, dynamism, and safety, much like Java. It predates Java by a few years. Try to find it.

  • by sabernet ( 751826 ) on Wednesday November 11, 2009 @02:10AM (#30056816) Homepage
    It's got garbage collection and limits as to what you can do with pointers for starters.
  • by abdulla ( 523920 ) on Wednesday November 11, 2009 @02:13AM (#30056834)
    That's not true. You have a choice as to what OS you want to run on your desk, and what machine you want to run it on. Mac OS X, Linux and Windows are officially supported - I haven't seen anything else.
  • by cheesecake23 ( 1110663 ) on Wednesday November 11, 2009 @02:14AM (#30056838)
    It almost certainly will be frozen over, so weather won't be a problem. But with a population of 352 [wikipedia.org], I suppose lack of infrastructure could be a problem for having Winter Olympics in Hell.
  • by Temporal ( 96070 ) on Wednesday November 11, 2009 @02:29AM (#30056926) Journal

    Ken Thompson loves Unix

    Loves Unix? Ken Thompson [wikipedia.org] invented Unix. Along with Dennis Ritchie. In 1969.

    So yeah. It would be kind of silly if he created something Windows-only...

  • by Anonymous Coward on Wednesday November 11, 2009 @02:45AM (#30057012)

    C++ come on it didn't even have a string class. Thus pointer math hell.

    I'm not going to suggest you should use C++ but seriously, can you at least use real criticism? What is std::string [cplusplus.com] then?

    And no, "that was only added in 1995" doesn't count as a criticism since C++ was not defined as an ISO standard until 1998 and std::string has been there ever since.

  • by qw0ntum ( 831414 ) on Wednesday November 11, 2009 @02:49AM (#30057042) Journal
    This fellow has been working on his own programming language, also called "Go", for a decade. Even released a book about it. He filed an issue in the tracker for the Google language: http://code.google.com/p/go/issues/detail?id=9 [google.com]
  • by Toonol ( 1057698 ) on Wednesday November 11, 2009 @03:34AM (#30057256)
    why are we still defining code chunks via brackets instead of the indentation that's already there?

    Because enforcing strict rules about indenting and how it's interpreted is more oppressive and error-prone than using brackets? I agree with your FIRST paragraph...
  • by Anonymous Coward on Wednesday November 11, 2009 @04:07AM (#30057422)
    There's already a Go! programming language for that matter. You'd think Google would have Googled Go. http://portal.acm.org/citation.cfm?id=998367 [acm.org] http://www.lulu.com/content/paperback-book/lets-go/641689 [lulu.com]
  • by Imagix ( 695350 ) on Wednesday November 11, 2009 @04:58AM (#30057680)

    For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

    Are you insane? Have you ever written a parser? And being dependent on particular whitespace is really asking for trouble. Now, are those tabs or spaces? How many spaces? One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment).

  • by Tim C ( 15259 ) on Wednesday November 11, 2009 @06:02AM (#30057952)

    Actually JavaScript being called JavaScript was a hideous decision - even now I read comments from people who think it's something to do with Java.

  • by jonaskoelker ( 922170 ) <jonaskoelkerNO@SPAMyahoo.com> on Wednesday November 11, 2009 @06:22AM (#30058076)

    Are you insane? Have you ever written a parser?

    I've written my share. And I've read (and, I think, understood) how python does it.

    Really, it's not that bad. Simply look at each line and see if it's indented more than the previous; if so, add an OPEN_BRACE token; if less, a CLOSE_BRACE token (or call them OPEN/CLOSE, BEGIN/END, etc.). Then, once you've transformed the indentation structure into tokens, parse the rest.

    You can probably do it faster if you do it on the fly (i.e. at the same time as "parse the rest") rather than in two passes, but the idea is more easily comprehensible this way.

    Also, my practical experience with writing loads of python and more than my fair share of Makefiles suggests that it all Just Works (tm).

    At least as long as you don't mix tabs and spaces. It's quite easy to write a shell script which tests for this and warns you. Also, any decent editor with an embedded lisp dialect can be made to highlight tab/space mixes (or just run your shell script in the background).

    Why the big worry?

  • Er...? (Score:3, Informative)

    by Kupfernigk ( 1190345 ) on Wednesday November 11, 2009 @06:50AM (#30058224)
    Chrome is based on Webkit and optimised for Javascript, which is Google's delivery tool of choice. OOO was never going to be suitable for running as a cloud application. The Google OS seems to be tight integration of Linux and Chrome. Go seems to be basically the start of an improved version of C, rather than an improved version of C++.

    You seem to be complaining because Google is working on technologies which are not your technology of choice. But far from an NIH, they seem to be giving serious traction to existing technology which best suits their needs.

  • by Vintermann ( 400722 ) on Wednesday November 11, 2009 @07:02AM (#30058296) Homepage

    You can get pointer arithmetic in Ada, as long as you sign the proper disclaimer of warranty forms and send them to the DOD in triplicate.

    Seriously, you can get pretty much anything in Ada, it's just that you need to be very, very verbose about the things you really shouldn't be asking for.

  • by marco13185 ( 888912 ) on Wednesday November 11, 2009 @08:14AM (#30058658)

    C# is not a windows only language at all. Mono is a pretty complete implementation of the .NET Framework on Linux (with some good progress on OS X). A lot of really cool apps, such as Beagle, Banshee, F-Spot, Tomboy, and Gnome-Do, are written for Mono.

  • by tepples ( 727027 ) <tepples.gmail@com> on Wednesday November 11, 2009 @08:34AM (#30058782) Homepage Journal

    The STL (T stands for Template!) has nothing to do with the strings library.

    The C++ standard library consists of the C standard library, the iostream library, and the STL. In the STL, std::string is a specialization of the template class std::basic_string.

  • by Cthefuture ( 665326 ) on Wednesday November 11, 2009 @10:07AM (#30059534)

    Uh, so they don't have a dynamic linker yet. Consider this:

    $ cat hello.c
    #include

    int main(int argc, char* argv[])
    {
          printf("Hello, world!");

          return 0;
    }

    $ gcc -O2 -static hello.c

    a.out is 688272 bytes (x64_64 Linux)

    Until they have a dynamic linking system, who knows.

  • by Anonymous Coward on Wednesday November 11, 2009 @10:39AM (#30059994)

    wikipedia page != wiki

  • by augustw ( 785088 ) on Wednesday November 11, 2009 @10:40AM (#30060002)

    I think the niche it's aiming at is the, "Look! We made a programming language, too!" niche.

    Since one of the three designers of Go is Ken Thompson (designer of C), I would doubt that.

  • by Anonymous Coward on Wednesday November 11, 2009 @10:42AM (#30060024)

    That's strange. In the 5 years of Python coding I've never ever had problems with indentation.
    So I think it's just prejudice.

  • by Raffaello ( 230287 ) on Wednesday November 11, 2009 @10:59AM (#30060274)

    Actually, Snow Leopard is certified as well. You need to click on the link for the company, Apple, and it will show all their certified products. Here's the link [opengroup.org]

    Anyone still using 10.4 (i.e., Tiger) who wants certified Unix (for whatever reason) can upgrade to either of the two leopards. Tiger is two OS revs and 4 years old at this point. Having said this, Mac OS X has been Unix compatible from the very start, with a bsd subsystem available from the very first developer previews.

  • by Anonymous Coward on Wednesday November 11, 2009 @12:02PM (#30061148)

    Python has significant whitespace, I love it, the only problems I ever have with it are if I have a clause that is too long (and should really be made its own function) that I have to 'unindent' correctly, python recognizes the difference between 3 and 4 spaces as significant, so it can be annoying at times.

    Personally, I like that the language forces me (and others) to indent properly, I do just wish that the IDEs for it tended to allow for changes of indentation (our work standard is 3 spaces, the official python standard seems to be 4, it is a pain to switch manually, and I just haven't wanted to build a converter myself).

  • Re:Found it... (Score:4, Informative)

    by moosesocks ( 264553 ) on Wednesday November 11, 2009 @12:19PM (#30061388) Homepage

    So in other words, they left every single user of the language to do it, over and over again, because it seemed like a lot of work for the team to do well, once. Sorry, but that just doesn't cut it.

    Um. Did you read the text you just quoted? They didn't say anything of the sort!

    To paraphrse: Go is still a work in progress. It is our opinion that exceptions are computationally inefficient, and interfere with concurrent programming. If we implement something similar, we want to do it right the first time around. We are currently considering various methods of accomplishing this, as well as the impact of not implementing it at all.

    This, to me, sounds like an excellent way to design a programming language. Of course, there is going to be some backlash against any language that questions C's status as the "one true language," although most of the items in Go's feature list seem like they should have blindingly obvious in hindsight.

    Also, consider that C++ doesn't implement strings, and leaves the programmer to do it himself. STRINGS!

    (Go, by comparison acknowledges that a single, good string implementation will work for 99.99999% of programmers, while also doing nice things such as supporting UTF-8 out of the box)

  • by cowdung ( 702933 ) on Wednesday November 11, 2009 @01:01PM (#30062046)

    My biggest rant about most of these new languages: garbage collection is useless! I still have to write destructors that clean up all the pointers to an object, and all garbage collection does is force me to call the destructor as a function, rather than a more clear 'delete' statement. Worse, it takes away my most powerful speed optimization tool: careful memory layout for best cache hit rates. I can write simple graph traversal code that is 10X faster in carefully designed C/C++ than in any garbage collected language for large graphs.

    Wow! Your obsolete 80s mentality is mind-boggling.

    GC is awesome.. it increases application throughput inmensely.. and removes the need for destructors (in most cases).

    For most server based applications, GC increases the time you do actual work and reduces the amount of time doing book keeping.

    But don't listen to me.. ignorance is bliss. Have a happy life in C++. The rest of the world has mostly evolved beyond that.

  • Re:Not actually safe (Score:2, Informative)

    by home-electro.com ( 1284676 ) on Wednesday November 11, 2009 @01:19PM (#30062332)

    Checking for CARRY flag is one instruction. Not exactly a dramatic slowing.

  • by BitHive ( 578094 ) on Wednesday November 11, 2009 @02:39PM (#30063446) Homepage

    It's harder for people to show how smart they are by reflecting on things carefully and making posts that add to the discussion. Heck, they might even have to face the fact that they don't know enough to contribute anything meaningful. Shitposting is a good way to not face that reality, and go on about your smug day.

  • by SlashDotDotDot ( 1356809 ) on Wednesday November 11, 2009 @04:08PM (#30064908) Journal

    Go seems to suffer from the problem of not being done. Case in point: exceptions.

    The authors at least partly agree with you. They describe the absence of exceptions here [golang.org]. They consider it to be an open issue.

    On the other hand, they already provide an alternative to the "finally" block of an exception handler: the defer keyword [golang.org]. I like the looks of this, as it means you can handle all of your closing and locking kinds of issues in a direct pairing with the corresponding open or lock, regardless of whether the function terminates early due to error conditions.

  • by shutdown -p now ( 807394 ) on Wednesday November 11, 2009 @11:49PM (#30069172) Journal

    Easy, make it compile java bytecode and you probably have the biggest library around on the planet. Why a language nowadays should provide its own libraries is beyond me.

    Compiling for JVM has its disadvantages, as it's a rather limiting VM with very tight sandbox. You don't get tail calls, for example, which throws a huge chunk of FP techniques out of the window right away. Or, say, re-invocable continuations (call/cc) - you can do that, but you have to effectively roll out your own heap-based locals/arguments stack for that, which hits performance hard. Etc.

    CLR is much more powerful in that regard, because it has more features even inside the sandbox - tail calls, value types, stack-based typesafe varargs and byref argument passing - but also lets you ditch the sandbox entirely, and work with raw data and function pointers if need be. Its feature set is large enough to support a fully conformant ISO C++ implementation in it. But then, of course, you run into the problem with implementations - .NET is fast but non-portable, and Mono is portable but slow.

With your bare hands?!?

Working...