Become a fan of Slashdot on Facebook

 



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 sopssa ( 1498795 ) * <sopssa@email.com> on Wednesday November 11, 2009 @01:21AM (#30056494) Journal

    One of the things I immediatly noticed is the lack of build-in libraries. The reason I've always preferred Delphi and C# over C/C++ and PHP over Perl is that they all come with a comprehensive build-in function library for wide area of things.

    Programming now a days tend to be mostly high-level, so you would expect that new languages would provide that. I personally hate to find tons of different libraries for C++ projects just to do a basic thing. And lets be honest, theres no sense of everyone of us to code the basic functions again (and probably in worse code than the regularly checked build-in functions)

    That is why I love PHP, and because it provides a great manual on its functions. That is also why I love Delphi and why I started using it as 10 year old, without internet too - the reference guide that came with it was comprehensive and the build-in libraries and components for different things allowed me to rapidly try out to code apps and games. Only time I needed to find some libraries/components was when I was looking for a more rapid and better graphics library to do the drawing in my games.

    That is what would be "fun" in a programming language. It comes a lot before "fast builds, clean syntax, garbage collection, methods for any type, and run-time reflection."

  • fmt (Score:5, Insightful)

    by Duradin ( 1261418 ) on Wednesday November 11, 2009 @01:32AM (#30056554)

    Vowels aren't nearly as expensive as they used to be back in the day.

    It'd be a nice touch if they'd add vowel support in package names.

  • by Blakey Rat ( 99501 ) on Wednesday November 11, 2009 @01:34AM (#30056570)

    Perhaps it's designed to be embedded, like LUA or Javascript? In that case, comprehensive libraries aren't necessary or even desirable.

    Or, more likely, they just did the fun part of designing the language, and are leaving the hard part of creating libraries to somebody else.

  • by Al Dimond ( 792444 ) on Wednesday November 11, 2009 @01:42AM (#30056630) Journal

    PHP? Where they dump all their million built-in functions into one namespace? Lame. In Perl you have a lot more control over what libraries you pull in and how you use them -- you have to search CPAN for packages sometimes, but then you have a choice on what packages to use. And every Perl module I've pulled from CPAN has been well documented.

    I can see wanting lots of libraries around in a default install back before the Internet was big. These days that stuff should be separate and the language's core should be its core.

  • by TejWC ( 758299 ) on Wednesday November 11, 2009 @01:51AM (#30056702)

    I think it supports Linux and MacOS X only because the three main developers (Ken Thompson, Rob Pike, Robert Griesemer) seem to only have those two OSs between the three of them. I know Rob Pike is a Mac user and Ken Thompson loves Unix; I am guessing Robert Griesemer likes Unix as well.
    Its hard to support an OS when its not your primary computing platform.

  • Perl developers know about this thing called CPAN [cpan.org]. PHP doesn't even come close in this regard, and you really can't get a better language reference than perldoc [perl.org]. Honestly, if you can't write an app using Perl's built-in functions and the thousands of modules from CPAN, you probably shouldn't be programming. While choice in languages can vary widely according to the individual coder's personal preferences and particular suitability for a given task, the weakness you've cited is imaginary.
  • by cheesecake23 ( 1110663 ) on Wednesday November 11, 2009 @01:59AM (#30056762)
    The game may well be the most difficult to master of all games in history, but it is simultaneously one of the easiest to learn and to enjoy. Which actually does bode well for the language. If Go (language) is to C as Go (game) is to chess, then they nailed it.

    But, as I just posted in another thread here [slashdot.org], there are other problems with the naming.
  • by upuv ( 1201447 ) on Wednesday November 11, 2009 @02:05AM (#30056796) Journal

    I've been around for a long time.

    C great language did exactly what it was designed to do. But carries a lot of burden.
    C++ come on it didn't even have a string class. Thus pointer math hell.
    C#, Ok it learned a lesson and found the joy of a string class. But really it's a windows only lang.
    Java. Excuse me web apps that take 8Gig of ram spread across a farm of servers. This slow elephant remade the hardware business.

    All of the above never really understood concurrent / multithread / parallel. ( Sorry Java devs still have issues with the concept. GC & log4j come to mind as things that forgot they were in a threaded env. )

    So the "Go" lang it just might deserve a look. Clearly web centric. Clearly built for tons of concurrent comms. Recompiles in a blip thus useful for real time compiling alla jsp. I'm very performance centric. If I can replace my J2EE bloat ware with a trunk full of tiny Go apps I will.

    I'm definitely watching this space for developments.

  • by pslam ( 97660 ) on Wednesday November 11, 2009 @02:15AM (#30056846) Homepage Journal

    Go has garbage collection and lacks pointer arithmetic. So... it won't replace C++, then?

    Why was that so easy and quick to say? I really don't understand the repeated banging-head-against-wall that language inventors are doing. There's a good reason why C++ is still in wide and very popular use: precisely because it does have explicit memory management and pointer arithmetic. C++ is a static, explicit language. Go is not. It will not replace C++, and no language will until that is understood.

    The problems C++ need fixing are elsewhere. The syntax needs cleaning up. The ABI needs rationalizing between architectures. Multiple inheritance needs some taming (ditch 'virtual' multiple inheritance - it's insane), but not removing. Interface-only classes need promoting to a full type rather than inferred from being 100% pure virtual (and even then there's usually a non-pure-virtual destructor for stupid foot-bullet-avoiding reasons). There needs to be saner syntactic sugar for repeated operations (like python's 'with' keyword). Templates syntax needs to be less verbose and more automatic (already being worked on for C++0x but at this rate will be C++1x, keyword 'auto').

    Stop trying to replace C++ with a language that does not fulfill every aspect C++ covers. If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

  • by michaelmuffin ( 1149499 ) on Wednesday November 11, 2009 @02:26AM (#30056910)
    the go authors have a decades-old practice of deliberately choosing annoying names "in the Bell Labs tradition of selecting names that make marketeers wince."

    http://plan9.bell-labs.com/wiki/plan9/FAQ/index.html [bell-labs.com]
  • by Animats ( 122034 ) on Wednesday November 11, 2009 @02:41AM (#30056990) Homepage

    Actually, you don't need pointer arithmetic for a "systems language". Neither Ada nor the Modula family had it, and those languages have been run on bare machines with no other OS underneath. You need the ability to explicitly place arrays in memory as a form of privileged hardware access, but it's not something that's used in most code.

    Garbage collection, though, implies there's a layer of software underneath your code. Garbage collectors either freeze the whole program, or need some help from the MMU to track pages altered while the collector is running. Hard real time and reference counts do not play well together. Reference counted systems don't inherently have that problem, and if the compiler optimizes out reference count updates they can be efficient. But most reference counted systems are slow and dumb.

    It's sad to see yet another C++ alternative that can't actually replace C++. We need a C++ replacement. C++ has stagnated. C++ is the only major language to have hiding ("abstraction") without memory safety, a bad combination never tried again. Strostrup is in denial about this being a problem, and the C++ standards committee is of in template la-la land, fussing over features few care about and fewer will use correctly.

    The previous poster is right, though. This is a language for writing applications to run on servers. Google needs something less painful than C++ and faster than Python. (Python is a reasonably good language held back by an archaic naive-interpreter implementation. Making Python fast is hard, though, because the compiler has to do type inference to figure out the variable type information the user isn't asked to provide. ShedSkin shows that can work, but that project only has one person on it.)

  • by Anonymous Coward on Wednesday November 11, 2009 @02:46AM (#30057024)
    I think the niche it's aiming at is the, "Look! We made a programming language, too!" niche.
  • by OrangeTide ( 124937 ) on Wednesday November 11, 2009 @02:48AM (#30057032) Homepage Journal

    It's simple. It's a lot of fun to design and even implement your own programming language. It is not too hard, depending on how big of a problem you choose to bite off with your language. And then there are the oohs and ahhs you get from other developers when you have implemented a language, especially if it compiles to some real or virtual architecture.

    Too bad learning to use a programming language effectively is a lot of work, and is usually pretty frustrating. It has been easy for me to find the time and energy to implement my compiler. But I totally don't have the time to learn C++, Haskell, Python, OCaml, Ruby, PHP, Perl, et cetera.

    As a developer, and I realize this is a very silly and irrational, I tend to avoid using programs written in languages I don't understand. True, I almost never look at the source for the program. But take Gentoo emerge for example. The fact that it is written in Python instead of C, awk, shell script, Tcl, Lua, or Java is mainly why I don't run Gentoo.

  • by reporter ( 666905 ) on Wednesday November 11, 2009 @02:50AM (#30057048) Homepage
    Ars Technica writes, "A video illustrates just how fast compilation is: the entire language, 120K lines, compiles in under 10 sec. on a laptop."

    If this language becomes as popular as Perl, then 120,000 lines will soon become 1,200,000 lines. That is exactly what happened to the Perl interpreter and compiler.

    Also, just like Java, the new Go language (due to the immense respect for Google's scientific prowess) will likely receive accolades: "it is the best, final language that we will ever need". The same was said for Java. It was sold as the ultimate final language built on 50 years of accumulated knowledge of language design and computer architecture. Upon the introduction of Java, company after company blindly adopted it.

    Was Java the final language satisfying humankind's computing needs? No. Was adopting it worth the cost? Maybe.

    Now, we have Go. Is it a massive improvement over C and Java, thus justifying spending milions of dollars to train programmers? Only the future will tell.

  • by DerekLyons ( 302214 ) <fairwater@gmaLISPil.com minus language> on Wednesday November 11, 2009 @02:57AM (#30057082) Homepage

    Or, more likely, they just did the fun part of designing the language, and are leaving the hard part of creating libraries to somebody else.

    They pretty much explicitly state that in TFA - the 'simple' and 'fun' stuff is done, now it's up to the [currently theoretical] community to dig in and do the hard stuff.
     
    Of course, being Google branded and Open Source (two of the top 'auto orgasm' buttons among a huge swath of geeks) there will be, at least in the beginning, a fairly large community. I'll be very surprised if there isn't a Wiki by morning, and I'll be there's half a dozen or more Waves about it by now.

  • No Exceptions?! (Score:3, Insightful)

    by CarpetShark ( 865376 ) on Wednesday November 11, 2009 @02:58AM (#30057088)

    tl;dr yes, it has goto

    But apparently not exceptions? It sounded good in theory. Lack of assertions was going to bug me. Lack of exceptions and try...finally blocks is most likely a deal-breaker. I'll read the thing in detail at some stage and see if they provide a decent alternative though.

  • Found it... (Score:3, Insightful)

    by CarpetShark ( 865376 ) on Wednesday November 11, 2009 @03:06AM (#30057126)

    Found confirmation of this in Go's "Language Design FAQ":

    Why does Go not have exceptions?

    Exceptions are a similar story. A number of designs for exceptions have been proposed but each adds significant complexity to the language and run-time. By their very nature, exceptions span functions and perhaps even goroutines; they have wide-ranging implications. There is also concern about the effect they would have on the libraries. They are, by definition, exceptional yet experience with other languages that support them show they have profound effect on library and interface specification. It would be nice to find a design that allows them to be truly exceptional without encouraging common errors to turn into special control flow that requires every programmer to compensate.

    Like generics, exceptions remain an open issue.

    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.

    As for exceptions increasing control flow compensation... Java had this right; if a function's interface specifies what it throws, then you by definition save yourself a lot of control flow headaches, as you know exactly what calling a function can result in.

  • by MemoryDragon ( 544441 ) on Wednesday November 11, 2009 @03:09AM (#30057142)

    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. That is so 90s...

  • Re:fmt (Score:3, Insightful)

    by rrohbeck ( 944847 ) on Wednesday November 11, 2009 @03:16AM (#30057168)

    I definitely prefer programming languages with concise syntax and function names. We don't need another Java.
    Maybe someone can write a preprocessor for the folks that want to bang out source by the megabyte.

  • Re:Wonder? (Score:2, Insightful)

    by Anonymous Coward on Wednesday November 11, 2009 @03:17AM (#30057174)

    It doesn't have comefrom though.

    We'll have to wait for Google to independently rediscover [wikipedia.org] it.

  • by Toonol ( 1057698 ) on Wednesday November 11, 2009 @03:20AM (#30057190)
    "Open Source" for the geeks, "Google Branded" for the techies, and "Apple" for the wanna bees?
  • by Anonymous Coward on Wednesday November 11, 2009 @03:28AM (#30057230)

    I've noticed a lot lately, especially here on Slashdot, that the most vocal opposition to degrees, education, certifications etc. come from people (not you in this case but it's relevant to this thread) who do not have this type of formal education in the first place.

    I wonder if this says more about the US (since Slashdot is US centric) education system, the people being educated or the people not being educated. No offense, but if you've never met a competent CS graduate, you're either working in some very strange bottom-of-the-barrel outfits or with some very strange people. The CS graduates I've worked with have universally been careful, methodical and not dickish in the slightest.

    Just about the only downside I've noticed is with fresh graduates who can be a little naive about business practices and real-world scenarios but they catch up far quicker than the "loner geek rebel" types whose best code at best qualify as clever but unstable and unscaleable hacks.

    I'm sensing a bit of projection from the uneducated crowd, tbh.

  • Re:fmt (Score:5, Insightful)

    by Jonboy X ( 319895 ) <jonathan.oexnerNO@SPAMalum.wpi.edu> on Wednesday November 11, 2009 @03:38AM (#30057282) Journal

    People will read a piece of code more times than they will write it, so it makes sense to optimize for readability. Besides, I end up autocompleting most type/method names in the IDE anyway.

  • by heson ( 915298 ) on Wednesday November 11, 2009 @03:40AM (#30057294) Journal
    Finally, a C++ user giving clues for a better C++, instead of the usual ones from non users.
  • by malakai ( 136531 ) on Wednesday November 11, 2009 @03:42AM (#30057302) Journal

    No, his is simply "Go!" with an exclamation. See: http://portal.acm.org/citation.cfm?id=998367 [acm.org]

    Google is screwed, they'll need to change their name for this language or buy this guy off. If they ignore this guy they'll look like a bully.

    It's amazing no one at Google did a search go "Go Programming Language"

  • Skeptical thoughts (Score:3, Insightful)

    by jma05 ( 897351 ) on Wednesday November 11, 2009 @03:44AM (#30057308)

    I watched the presentation. It was about time for Google to join the programming language space, but I was not impressed as much as I had been with other Google projects.

    Go is fast: Sure. But compared to what? C and C++? They were never known to be fast compiling languages. Go is still a very simple language. So compilation speed is not impressive, relevant or novel *yet*. I recall from my Pascal (Delphi) days of how blazingly fast the compilations were when the language did not have a pre-processor or generics and had a more strict type system. Once Go gets generics and exceptions, we can see how well it compares to similar modern languages.

    Go is safe: I somehow kept seeing OCaml in a C style syntax in all this despite Go not being functional (perhaps I am just sleepy :-) ). Better type system, garbage collection, optional typing, higher data types. Imperative Ocaml also only takes a minor performance hit compared to C despite providing a much safer language.

    Concurrency: This could be something. The languages with built in support for this are somewhat obscure ATM (Erlang). Hopefully, Go will be more palatable to the mainstream.

    Programming languages are finally more than grammars and compilers. Many excellent languages never make it to limelight. C and C++ continue to be first choice for system software despite the existence of several excellent "language" alternatives. Google brand may help Go with an early boost, but it will be the tools, libraries and the community that will have to deliver it; or we will just have another Java FXScript story in front of us.

  • FYI: Array slices (Score:4, Insightful)

    by UnderCoverPenguin ( 1001627 ) on Wednesday November 11, 2009 @03:45AM (#30057310)

    Array slices and mapping types have been around for decades. Not even Perl was the first to provide tham, et alone Python.

  • by jrumney ( 197329 ) on Wednesday November 11, 2009 @03:47AM (#30057318)
    It's hard because in most cases you want strings to be efficient in terms of both memory and performance, so it is best if they are fixed size - easiest if they are immutable. So you have a separate class (StringBuilder in C#, StringBuffer in C++) which is a mutable string with all the inefficiencies of having to reallocate its storage as the string grows, and an efficient conversion into an immutable String object for when you've finished building it and want it to be efficient in terms of storage size and operations carried out on it.
  • by dbcad7 ( 771464 ) on Wednesday November 11, 2009 @04:07AM (#30057430)
    Permissions problem maybe ?
  • by Anonymous Coward on Wednesday November 11, 2009 @04:18AM (#30057472)

    >>There's a good reason why C++ is still in wide and very popular use: precisely because it does have explicit memory management and pointer arithmetic.
    bzztt WRONG!!! C++ is in popular use despite having explicit memory management and pointer arithmetic. Unless you're talking about people who write operating systems and device drivers. Which is not insignificant...but hardly a majority of the software developed today.

    I don't get the hate about garbage collection. How much time do you spend writing and maintaining constructors, copy constructors, assignment operators, destructors, etc? God forbid if you want to make them exception safe. All that just goes away with garbage collection. Sure, if you're writing Doom 8 you probably need to squeeze every cycle out of your PC...but if you're writing e.g. desktop productivity software, does it really matter that you spend 3% of your application time in the GC? Oh the horrors!!(but we shipped 5 months earlier because we didn't have to deal with bullshit memory errors)

    The first problem C++ needs fixing is the insane preprocessor copy/paste mechanism for header files. That alone would probably make every c++ dev 2x more productive, given that their build process would stop being an O(N^2) operation. I mean, when there are books(Large Scale C++ Software Design) and design patterns(PIMPL) about how to physically structure your code to make it compile faster, you know you're in trouble.

  • by TheTurtlesMoves ( 1442727 ) on Wednesday November 11, 2009 @04:38AM (#30057574)

    If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

    Because if you can't do that then you can't do anything right?

    Heres a novel idea. Use a language as a tool, and use the right tool for the job. If you are writing an OS perhaps you need *explicit* access to pointers, or if you are doing something with MMU you would need a asm{} section (thats not C++ either). But when i want to write a application server then that requirement is lame and garbage collection and better memory models frees the developer and compiler (escape analysis etc) to do a lot more of the relevant work.

    We are not all writing an OS, so why the hell do we all need to be using a language that can write an OS? Just like all welders are not all welding Aluminum so they don't all need fancy TiG welders (just like we don't always need to use car analogies).

  • by Anonymous Coward on Wednesday November 11, 2009 @04:59AM (#30057686)

    if I accidentally type "plaeyrArray" instead of "playerArray," the whole world is clearly on fire and everyone is going to die.

    I know what you're saying, but I think the answer is broadly that you might have meant plaeyrArray. Every so often xkcd nails one, and there's one that says "You'll never find a programming language that frees you from the burden of clarifying your ideas." It's because computers will do anything that you ask them to that you have to be so specific. And I'm sure you know that, but it's worth pointing out. Language designed to be easy, like VB, end up being almost unusable for certain tasks because their treatment of basic stuff creates lots of little edge cases. Is this a zero or a null? I don't know...what does the language think it should be in this context?

    PHP is pretty tolerant of little faults, but it's also a huge mess. I haven't used it a whole lot and just recently found out my program's been logging warnings like crazy because I didn't initialize a variable, but PHP only warns you over this. Not the end of the world, but I find it annoying. It's more important for a language to be consistent, I think...when you try to make it "intuitive" you end up with a subjectivity problem. Everyone has a different mind and they all want you to read them. Then the next guy (probably me) says "why in the hell would it work like THAT?". But consistency can be quantified.

    Why can't compilers be more intelligent about the types of errors they encounter in routine usage? For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

    I'm not being facetious when I suggest that you immediately play around with Python. It's not just the whitespace thing, but it happens to be indicative of why Python's such a joy. You're already delimiting spaces with an LF character, so aren't you just repeating yourself with a semi-colon? Of course you are. Taking it further: in Python you can still put two lines of code in one line of text, just like any other language, and you can also break one line onto two. But it's treated as the exception (which it is), rather than the rule, and for things not already enclosed in parentheses, you break them onto two lines by (wait for it...) escaping the LF! I dunno, there's something about that that just makes me smile. Python is full of neat little things like that.

    Not to mention an extensive standard library with the documentation baked in, built-in debugging and profiling tools, and an interactive prompt for testing out one-liners and reading the docs. It doesn't seem like it at first but you end up missing the prompt dearly when you code in other languages.

    Obviously language syntax isn't, or shouldn't be, a dealbreaker, and Python already gets too much press for being a language where whitespace matters when that's not a big deal, so please don't misunderstand my reason for bringing it up. I just find that it's representative of the whole picture: Python makes things simple that should be simple, but not by being inconsistent.

  • by shaitand ( 626655 ) on Wednesday November 11, 2009 @04:59AM (#30057690) Journal

    Well yes but not really. They built this for themselves and released it because they don't care. Google develops a lot of in-house server based internet stuff and they spend a lot of time waiting on compiles.

  • People will read a piece of code more times than they will write it, so it makes sense to optimize for readability.

    If you can make the code 1% more readable (pick your measure) at the cost of making it take twice as long to write, is that worth it?

    If you can make the code 1% less readable and simultaneously make it twice as fast to write, is that worth it?

    Also, it's a particular name we're talking about. Is python unreadable because it says "len" instead of "length"? Is it bad to say "IndexError" instead of "ArrayIndexOutOfBoundsException"? Is it bad to say "" instead of "System.out."?

    Of all things, I think names (with vs. without vowels) have the smallest impact on readability. Descriptive names are important, but I think it's much more important to be able to write code that has an easily comprehensible structure.

  • by shaitand ( 626655 ) on Wednesday November 11, 2009 @05:30AM (#30057824) Journal

    Not if you already know QWERTY... or use computers you don't own on a regular basis.

  • by shaitand ( 626655 ) on Wednesday November 11, 2009 @05:33AM (#30057830) Journal

    "is mainly why I don't run Gentoo"

    Fascinating. Personally I don't run Gentoo because compiling the entire system takes more extra time than the added performance saves me over the life of the install.

  • Oh, I see. (Score:3, Insightful)

    by jotaeleemeese ( 303437 ) on Wednesday November 11, 2009 @05:51AM (#30057894) Homepage Journal

    So the guys at Google, could not be bothered to, er, google for "go language" or "go programming language" out of politeness, so the other guy has to suck it up for being just him, a one man band.

    What a wonderful concept of decency and fairness.

  • by miro f ( 944325 ) on Wednesday November 11, 2009 @06:21AM (#30058064)

    Integer operations such as additions are incredibly quick, however you're going to be slowing your code down dramatically if you check for integer overflows with every single integer operation (unless you implement the check in hardware)

  • by master_p ( 608214 ) on Wednesday November 11, 2009 @06:29AM (#30058120)

    Templates is one of C++'s advantage over any other language (except D that implements them). Without templates, type safe containers and reusable algorithms cannot be implemented. For example, in Go, a List class would have to use void* types, throwing type safety out of the window.

    The syntax is also not that good. That the type goes after the variable name, the missing parentheses in 'if' and 'for' statements are syntactic changes that offer no better readability over C.

    Finally, the built-in channel mechanism is something that can be done in C++ in less than 100 lines of code.

  • by bbn ( 172659 ) <baldur.norddahl@gmail.com> on Wednesday November 11, 2009 @06:42AM (#30058186)

    If you ARE a language inventor and reading my comment, answer this: can you write a cache/MMU interface or an interrupt handler in your language? If the answer is no, go back to the drawing board.

    So there is zero assembler code in the Linux kernel because C can do it all? Not so.

    You do not need explicit memory management or pointer arithmetic to do these things. To write a device driver you might need the ability to access memory directly, but that could easily be done by mapping the memory region to an array.

    There are incremental garbage collectors that guarantee real time performance.

    It would probably be a huge benefit if the OS was written in a better language than C. One that takes a whole host of bugs out of the equation by not allowing manual memory management and pointer arithmetic.

  • by arethuza ( 737069 ) on Wednesday November 11, 2009 @06:48AM (#30058218)
    Just like any other software project - not just open-source ones. Commercial software vendors end-of-life products all the time. At least with an open-source project you still have access to the source.
  • by rusty ( 3244 ) on Wednesday November 11, 2009 @06:50AM (#30058228)

    > Stop trying to replace C++ with a language that does not fulfill every aspect C++ covers.

    Err, no (how did this get +5?) C++'s entire problem stems from the attempt to Be All Things. A far better approach is to design something that does one part of things well, and interoperates with C like everything else so you can glue stuff together.

    They've subtracted, not added. This is the Right Thing to have done.

    Rusty.

  • by WaywardGeek ( 1480513 ) on Wednesday November 11, 2009 @06:57AM (#30058274) Journal

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

    Agreed. I don't see a case where Go would be useful to me, given the Java, C++, Python, Perl, PHP, and C that I currently use.

    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.

  • by ardor ( 673957 ) on Wednesday November 11, 2009 @07:10AM (#30058324)

    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.

    Um, no. The whole point of a GC is that you don't have to explicitely deallocate something. RAII is a problems with GCs, but you didn't mention that. As for the cache hit thing, it sounds quite suspicious to me, more details please. Also, to get that last bit of performance, you have to go low-level, that is true. Note however that explicit memory management is unnecessary in 90% of a typical application's code.

    Now, since the ownership problem is passed over to the GC, things become possible that were previously hard to do. Try real closures for instance: C++0x is struggling with this, since they may extend the lifespan of a variable, which is bad if said variable was lying on the stack. Such problems simply go away with a GC. Note that C++0x rvalue references are in fact a solution to a problem caused by the explicit memory management in C++.

    There is a reason many people want an opt-in GC in C++0x..

  • by daid303 ( 843777 ) on Wednesday November 11, 2009 @07:16AM (#30058348)

    ../test.cpp: In destructor ‘std::pair::~pair()’: /usr/include/c++/4.3/bits/stl_pair.h:73: instantiated from ‘void __gnu_cxx::new_allocator::destroy(_Tp*) [with _Tp = std::pair]’ /usr/include/c++/4.3/bits/stl_tree.h:390: instantiated from ‘void std::_Rb_tree::_M_destroy_node(std::_Rb_tree_node*) [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_tree.h:943: instantiated from ‘void std::_Rb_tree::_M_erase(std::_Rb_tree_node*) [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_tree.h:585: instantiated from ‘std::_Rb_tree::~_Rb_tree() [with _Key = int, _Val = std::pair, _KeyOfValue = std::_Select1st >, _Compare = std::less, _Alloc = std::allocator >]’ /usr/include/c++/4.3/bits/stl_map.h:92: instantiated from here ../test.cpp:11: error: ‘testObj::~testObj()’ is private /usr/include/c++/4.3/bits/stl_pair.h:73: error: within this context /usr/include/c++/4.3/ext/new_allocator.h: In member function ‘void __gnu_cxx::new_allocator::destroy(_Tp*) [with _Tp = std::pair]’: /usr/include/c++/4.3/ext/new_allocator.h:118: note: synthesized method ‘std::pair::~pair()’ first required here

    Because templates are wonderful!

  • by wdef ( 1050680 ) on Wednesday November 11, 2009 @07:28AM (#30058410)
    Do we *really* need more languages? At university I learned Fortran, Pascal, Assembly, all of which stood me in good stead for later learning and have never really gone away. I had just got competence with Perl when I worked out that the many young developers use nothing but Python for things that I would use Perl for. I enjoy Perl. But if I want to go deeper into programming in certain areas, I will have to learn Python. I know Python has certain advantages and is probably easier to read but Perl is enormously powerful and fun. I taught myself C by doing various hobby projects sporadically over a year or two. You can see the bottom (or the end of the tunnel) with C since it's a simple language with few features but is difficult to use properly. Gradually you get more craft. Tried starting C++. What a mess. It's no wonder a guy I work with, one of the best C programmers in his field in the world, absolutely *hates* C++, as does Linus Torvalds. I mean, did they really make this mess on purpose? Apparently so. Learning a programming language properly is a real commitment. Some are easier than others. The case for this damn Google language needs to be pretty darn convincing before I'm going to even look sideways at it. Mere buzz words and fashion is not enough anymore. It just takes too long to take on YAS (Yet Another Syntax).
  • by grumbel ( 592662 ) <grumbel+slashdot@gmail.com> on Wednesday November 11, 2009 @07:53AM (#30058552) Homepage

    Kind of. The problem however is that nobody else has written a low level system language in a long while and all the low level languages out there kind of suck when it comes to concurrency programming and network stuff. So Go is really doing something that no other language out there is doing and it seems to be doing what it does quite well.

  • by Viol8 ( 599362 ) on Wednesday November 11, 2009 @08:13AM (#30058654) Homepage

    Some of us prefer brevity and we don't or can't all use IDEs. If something like strcmp is too difficult for you to understand perhaps you should stick to VB.

  • Re:Found it... (Score:3, Insightful)

    by azgard ( 461476 ) on Wednesday November 11, 2009 @08:24AM (#30058730)

    Actually, it would be much better if they add signals (like those in Common Lisp) instead of exceptions, as they are more general concept. But I can understand it's hard to see from Java land.

  • by rfreedman ( 987798 ) on Wednesday November 11, 2009 @08:42AM (#30058846) Homepage

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

    Like in Python?

    The reason that I still like my curly-braces is that I don't want the meaning of my code to change just because somebody (me?) changed the whitespace.

  • by flithm ( 756019 ) on Wednesday November 11, 2009 @08:48AM (#30058884) Homepage

    C++'s templates offer a lot more than just generics (which is what you're talking about when you say "type safe containers and reusable algorithms"), however Go does, in fact, provide for this with its "interfaces." The Go interface affords for both data abstraction (akin to C++'s inheritance hierarchy), and generic programming. Go provides an "Any" container, which "may be used to implement generic programming similar to templates in C++ [golang.org]".

    It's worth noting though that this is a dynamically bound language feature, which means it is checked and enforced at runtime rather than compile time -- both a positive and a negative depending on how you look at it. It provides for some more interesting programs to be written that do fun things at runtime, but on the down side it means you lose a lot of the compile time type-checking that C++ provides and can save a lot of debugging time later on. It also means that you can't do any template metaprogramming with Go -- again which can be viewed as a positive or a negative.

    I also challenge you to come up with a solution that equates to Go's built in Channel's in less than 100 lines of C++. What you're actually saying is you "can implement Go's Goroutine's AND Channels in less than 100 lines of code in portable, cross platform, C++". But, let's give you the benefit of the doubt and say that you've already go some mechanism for emulating a Goroutine (which by the way allows one to "mutiplex independently executing functions onto a set of threads"). I think _just_ the thread safe code that would implement all the necessary locks and barriers for a _single_ platform would probably be more than 100 lines, and would not be portable (ie, it would be pthreads, or win32 specific).

    I am open to being wrong about that, but I really do believe that you haven't spent much time investigating Go, and are therefore spreading FUD. For example your assertion that "in Go, a List class would have to use void* types, throwing type safety out of the window" is just plain wrong.

    I should also point out that I am in no way a Google Go fanboy. I see it as a pseudo-interesting low-ish level language that I haven't quite been able to envision the proper use for yet. I don't really buy Google's claim that it's a system level language (I can't see myself wanting to write an OS or device driver in it). To me it seems more like a great way to rapidly build efficient client / server type applications.

  • by iris-n ( 1276146 ) on Wednesday November 11, 2009 @09:37AM (#30059242)

    No, no, you're getting it wrong. Ken discovered UNIX. It was there since the begining of the universe.

  • by AReilly ( 9339 ) on Wednesday November 11, 2009 @09:51AM (#30059344)

    What on earth do you need multiple inheritance, virtual functions and templates for if you're writing a memory management system or interrupt handler?

    The problem with C++ is that it keeps C++ programmers from moving on to more productive languages with more support for real abstractions, by having them believe that they should use it to write the tiny amount of code that would be better written in C.

    Get over it: you've got a perfectly useful set of interrupt handlers and memory management in your favourite OS and runtime. Write the useful code in something that will *leverage* that, rather than re-inventing it over and over again.

  • by jchandra ( 15040 ) on Wednesday November 11, 2009 @12:04PM (#30061192) Homepage

    Ken Thompson, who invented Unix, creates an experimental new language with Rob Pike et. al. and Slashdotters try to overdo each other in pissing all over it.

    Nice.

    Tell you what kids, try learning something for a change. And show some respect.

  • by Al Dimond ( 792444 ) on Wednesday November 11, 2009 @12:26PM (#30061490) Journal

    Have you heard of TeX, the document formatting system? When you print onto 8.5x11 paper it leaves enormous margins by default. Do you know why? Because it's easier to read blocks of single-spaced text at around 60 characters per line than it is to read longer lines. The same applies to code.

    Meanwhile the culture around many languages encourages programmers never to split lines. At a former workplace where we used VB, one of my co-workers worked with the IDE maximized across two screens! I always kept my lines at least under 100 characters, but when people checked in code near stuff I'd written they sometimes would go through and join my lines together.

    At the same time, some of those really long lines are function calls where you don't always need to see all the arguments. Folding editors can collapse those into one line if you write them on multiple lines; it would be cool if there were anti-folding editors that could automatically break up long lines. It's similar for long formulas.

  • by DerekLyons ( 302214 ) <fairwater@gmaLISPil.com minus language> on Wednesday November 11, 2009 @01:42PM (#30062604) Homepage

    Just because it was invented by somebody (or somebodies) who once invented something great a long time ago in a land far away doesn't meant that it automatically the most coolest, correctest thing ever. The once greats do fade, or get bats in the belfry, etc... etc...

An authority is a person who can tell you more about something than you really care to know.

Working...