Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Google Programming Software

Google Releases Version 1.5 of Its Go Programming Language, Finally Ditches C 221

An anonymous reader writes: Google has launched the sixth notable stable release of its Go programming language Go 1.5. VB reports: "This is not a major release, as denoted by the version number and the fact that the only language change is the lifting of a restriction in the map literal syntax to make them more consistent with slice literals. That said, Go 1.5 does include a significant rewrite: The compiler tool chain has been translated from C to Go. This means "the last vestiges of C code" have been finally removed from the Go code base. As for actual changes in Go 1.5, you'll want to read the full release notes. Highlights include improvements to garbage collection, the developer tools, the standard library, and new ports."
This discussion has been archived. No new comments can be posted.

Google Releases Version 1.5 of Its Go Programming Language, Finally Ditches C

Comments Filter:
  • by Anonymous Coward on Thursday August 20, 2015 @12:36AM (#50351813)

    The article completely omits any mention of women using the Go language. How many women are enrolled in Go classes across the US? Are there scholarships available yet so our daughters can do a doctoral thesis on Go? Google's misogyny is really shining through this time, it's pretty obvious they expect all women to become hairdressers and waitresses.

    • Re: (Score:2, Insightful)

      by Anonymous Coward

      I wish you could be modded higher than +5. I see you posted as AC, because having this tied to your name would be tied to a twitter in 2018 and cost you your job in 2021, and that part makes me sad, but... such a good comment.

      Posting as AC for similar reasons.

  • Oh no.... (Score:5, Insightful)

    by Anonymous Coward on Thursday August 20, 2015 @12:36AM (#50351815)

    Google is ditching C! Oh my ... Wait.. what... you mean, "ditching C in their Go language platform". Uh... well.. duh, who actually would think they'd use C in their own new shiny language toolchain, that's like anti-advterisement.

    Oversensational header, disappointing....

    • Re:Oh no.... (Score:5, Interesting)

      by Z00L00K ( 682162 ) on Thursday August 20, 2015 @12:50AM (#50351853) Homepage Journal

      I agree that it's more like a balloon popping news than revolutionary news. And in any case - there's still C and assembly somewhere.

      When I look at the code examples my opinion is that it reminds me of a mix of C/C++ and Pascal. Not necessarily bad, just an observation.

      What I think lacks when it comes to the Go compiler are the number of platforms supported, some are missing, like ARM and MIPS. Hopefully that will come as well.

      How about translation tools - something that can convert Java to Go?

    • Re: (Score:2, Informative)

      by Anonymous Coward

      Yes, the headline is a bit oddly phrased.

      Getting to the self-hosting [wikipedia.org] stage is a major milestone in any programming language.
      Before that it is just a novelty or support language.

      "With version 1.5, the Go toolchain is now self-hosting!" would have been a more descriptive and less flamebaity headline.

    • by tepples ( 727027 )

      Uh... well.. duh, who actually would think they'd use C in their own new shiny language toolchain

      The reference implementation of Python, a different language that's been around as long as Linux, is still written in C. So go figure.

  • Finally! (Score:5, Interesting)

    by thegarbz ( 1787294 ) on Thursday August 20, 2015 @02:18AM (#50351997)

    It's about time. Wait ... is it? What was so bad about C? Was there an active campaign to eliminate it? Were they behind on some schedule or hanging out against the wider desire to ditch C?

    Why are we finally ditching something that worked?

    • Re:Finally! (Score:5, Interesting)

      by complete loony ( 663508 ) <Jeremy@Lakeman.gmail@com> on Thursday August 20, 2015 @03:00AM (#50352077)

      Builds in Go 1.5 will be slower by a factor of about two. The automatic translation of the compiler and linker from C to Go resulted in unidiomatic Go code that performs poorly compared to well-written Go. Analysis tools and refactoring helped to improve the code, but much remains to be done. Further profiling and optimization will continue in Go 1.6 and future releases. For more details, see these slides and associated video.

      And replacing it with something slower.

      • by Megane ( 129182 )

        Builds in Go 1.5 will be slower by a factor of about two.

        Go! Back! (I should go check TDWTF forums to find some threads about this.)

      • And replacing it with something slower.

        Any plausible improvement for C would require memory management and extra run-time checking.
        Maybe a different hardware model tuned to multithreading would get a faster language.

    • Re:Finally! (Score:5, Interesting)

      by Anonymous Coward on Thursday August 20, 2015 @03:03AM (#50352093)

      They removed C code from the runtime so they had one language to reason about in the garbage collector. It makes updating the pointers on the stack easier among other things: Go 1.5 includes a new moving mostly concurrent garbage collection that wouldn't have been practical with random runtime c code on the call stack. It also makes it easier to contribute to the project (less languages involved), and removed the need for maintaining their modified C compiler that worked with their ABI and stack management.

      So no, none of the reasons they removed C were because C is bad (Though they would also claim it has its issues). It mainly was problematic to have a second and non memory safe language involved in the runtime. The reasons for removing it from the compiler are less clear cut, but some of the same reasons apply.

    • Re: (Score:2, Interesting)

      by Tough Love ( 215404 )

      Compared to C++, C is a clumsy anachronism. Speaking as a C expert and someone who still writes a lot of it. C is bad news for maintainability and abstraction. Those who insist on denying that end up with sprawling haphazard embarrassments like GTK and Enlightenment.

      In any case, the limitations of C are not the issue. The issue is, if a systems language is inappropriate for implementing a compiler for itself, then does it deserve to be taken seriously? It is a matter of proving the worth, power and efficien

      • Re: (Score:3, Interesting)

        Comment removed based on user account deletion
        • Name 5 complexities which are needless.
        • by Greyfox ( 87712 )
          A lot of those complexities are there to enforce type safety. So I can, for example, use boost's type-safe signal/slot library and catch a lot of errors at compile time that would have resulted in run-time exceptions in other languages. Having had to maintain several java programs that used reflection (Apparently because the designer had read about it in his "Java for Dummies" book and thought it was cool,) I have to say I appreciate catching errors at compile time. Or in unit testing.

          C++ in the early day

      • Re: (Score:2, Informative)

        by AmiMoJo ( 196126 )

        Compiling itself is a major milestone for many languages. C itself passed that point fairly early on, going from being written in BCPL to pure C, at which point a lot of other code started being translated too. It's a good demonstration of the language, as much as anything.

        As for C vs. C++, I think you have it backwards. C is an excellent system programming language and nothing else has managed to supersede it. All major operating systems are written in C, including Linux, the BSD/MacOS kernel and the Windo

        • Re:Finally! (Score:5, Insightful)

          by serviscope_minor ( 664417 ) on Thursday August 20, 2015 @08:37AM (#50353033) Journal

          All major operating systems are written in C, including Linux, the BSD/MacOS kernel and the Windows kernel.

          And the common thing about those is all of them are OLD. Sure there are new parts, but they were all started a very, very long time ago when C did have major advantages over C++ (no standard C++, slower code, buggy compilers significantly lagging the standard when it finally arrived). Of course in the mean time, there have been 3 major language versions (98, 11, 4), one minor one (03), and a bunch of TS (<3 concepts! finally!), not to mention truly vast improvements in compiler performance, and the final arrival of two production quality open source compilers which are generally in advance of the standards, not behind.

          Back in '94 when they tried compiling Linux in C++ and it went slower, well, then C had advantages over C++. That was over two decades ago. The world has moved on since then.

          As we've seen with GCC who have been undergoing a heroic effort, it's a lot of work to move an old project from C to C++, and you have to have the devs on board (given Linus's major blind spots he'll never do that for Linux). There's also very little advantage initially because most of the code is idiomatic C, and getting good paramaterised containers, type safety, leak safety etc etc is a lot of very slow work. It's not merely enough to switch your compiler, to get the full advantages you more or less have to rewrite the entire project from the inside out.

          And as for OSX, well, parts of the kernel are written in C++, and in fact the device driver layer supports it. It's a subset, which doesn't allow any of the bits requiring significant support from the runtime (exceptions, RTTI/multiple inheritance) and bizarrely, templates which are basically invisible at that level.

          C++ is a terrible language for most purposes. No good for system programming, and not great for application development. Later languages vastly improve upon it.

          Many of the big "applications" on my machine that I regularly use are written in C++. There's firefox, Eagle CAD, Libreoffice, IAR embedded workbench, inkscape, okular not to mention GCC 5. Oh and the JVM of course. And unity (the game engine) is itself written in C++ even if most of the game code is C#. Oh and llvm. I almost forgot about that!

          In the case of Firefox, C++ is apparently so far superior to everything else that the only way to move off C++ was to develop a completely new language, because nothing out there was worth moving to.

          Fortunately, Rust is written by people who seem to know, understand and like C++, which means it has a much greater chance of actually being better, unlike all the supposed C++ replacements which are mostly much worse except for some small domain.

          No good for system programming

          It's excellent for systems programming. It's better than C in pretty much every single regard[*].

          Later languages vastly improve upon it.

          Such as? One of the nice things about watching a talk by Stroustrup is he has a bunch of pretty pictures about where C++ is used. C++ is on mars. And there's a reason you haven't heard about the Emma Maersk drifting around unpowered in the Pacific ocean (the ECU for the Flex96-C engine is written in C++). And there's also a reason you're almost certainly reading this post in a browser written in C++.

          And not one of those other vastly improved languages.

          So finally a challenge for you and everyone who modded you as insightful:

          I like C++, but I could bend your ears for days about what's wrong with it, and why it's a pain in the ass in a variety if interesting and distressingly subtle ways. If there are vastly superior languages out there for what I do, then let me know, because I'd love to use them.

          [*] The only regard in which it's not is that a few obscure platforms don't have a C++ compiler.

          • Go as a C++ replacement should be fine unless you need manual memory management. D as a C++ replacement should be awesome - D has garbage collection by default but manual memory management as optional. I'm surprised the Mozilla team didn't go with D. I don't have anything against Rust, mind. It just seems to me that in general terms D already provided almost everything the Rust designers had in mind.

            C++ drawbacks:
            1. The language has a long history, which by its nature means there is tons of older C
            • Go as a C++ replacement should be fine unless you need manual memory management.

              No, not really. Go as a C++ replacement for writing server side RESTish sort of code would be fine. As a general C++ replacement not so much.

              Go has much weaker abstraction mechanims, so you can't build your own datastructures that work like the builtin ones. Unless your problem happens to map well on to slices and maps, it's just not very good. I'm currently writing quite a bit of computer vision code in C++ (and the operator ov

              • Good point on your criticism to my first comment. Old C++ libraries are baggage that newer languages don't have, but clean slate new C++ programs can ignore old libraries as easily as new languages can. I was hypocritical with that argument and didn't notice. Thanks.

                I would assume that for developing most code, unless you're hitting specific performance-related problems you need to debug, you do most of your compiling without the optimizer. Once it's more or less feature complete, then you have a fe
          • If there are vastly superior languages out there for what I do, then let me know, because I'd love to use them.

            Self-regurgitating assembly with macro's.
            I could try and explain, it's just too powerful and expressive.
            Its purity and speed would leave you alone and crying for mommy.
            Variadic pointers and memory strategy? Who cares, assembly INVENTED virtual endless memory.

            Of course, when things need to get done, you fetch any script- /garbage collected lang is available and supported in vi/emacs/whatever

        • by Yunzil ( 181064 )

          C++ is a terrible language for most purposes. No good for system programming, and not great for application development.

          Well, that's one person's opinion. I mean, it's completely wrong, but it's an opinion.

        • by MSG ( 12810 )

          C is an excellent system programming language and nothing else has managed to supersede it. All major operating systems are written in C, including Linux, the BSD/MacOS kernel and the Windows kernel.

          Both the XNU kernel (OS X and iOS) and Windows kernel are written, in part, in C++. A subset of C++, in both cases, to be fair, but C++ all the same.

        • All major operating systems are written in C, including Linux, the BSD/MacOS kernel and the Windows kernel.

          The Symbian kernel is written in c++, proving that that there is no technical obstacle. The real reason that (nearly) all major kernels are written in C is that these kernels predate the time when c++ was suitably mature. Things have changed. OSv [wikipedia.org] is an example of a new kernel written in c++. A bit simplistic at the moment, but then so was Linux when it arrived on the scene.

      • Re:Finally! (Score:5, Insightful)

        by DarkOx ( 621550 ) on Thursday August 20, 2015 @07:54AM (#50352849) Journal

        I agree the issue here isn't ditching C so much as having a self hosting language. Self hosting has all sorts of advantage the ones you point out are the biggest.

        With a youthful language often new features and revision appear in the reference compiler first. If designing something like a new syntax or language construct a good hit you are doing something right is when its strait forward to express within the existing language. When it comes time to implement and you are working in the native language if you find you can't express the new construct easily it might mean the relationships and orthogonality are not as clean as you think.

        I disagree that is bad new for maintainability and abstraction. There are plenty of very large very old C projects that are perfectly maintainable. Its a question of discipline mostly and selecting right abstractions. GTK is a mess because its an objected oriented library written in a procedural language. OO isn't the only possible design choice even though that is all many people are taught today. Had a procedural abstraction been chosen I am sure it would be fine.

      • by caseih ( 160668 )

        Actually GTK+ is quite maintainable, both in terms of the toolkit development itself, and app development. The patterns it uses are easily seen, and replicated, and also easily automated. For example, to gobject-based toolkit code is often automatically generated from more abstracted definition files. GTK+ is definitely not an embarrassment, nor is it haphazard.

        The biggest problem with C++ is language bindings, and also a the lack of a standard ABI. Unless things have radically changed recently, I canno

    • by DrXym ( 126579 )
      C and C++ barely lift a finger to help with memory safety, concurrency and a whole bunch of other problems that continuously catch developers out. Thus far they've survived because higher level languages (that solve these issues) tend to impact on performance.

      Now we're seeing the likes of Swift, Rust, Go which allow developers to enjoy the speed of C/C++ but without as many pitfalls. They also tend to be more terse languages, produce more meaningful error messages and compilation is faster. These things s

    • by jbssm ( 961115 )
      Same reason we ditched Assembler somewhere in the past. Languages need to evolve, we can't be stuck with C and it's design limitations forever. C served us well, just like Assembly had done, but as compilers evolve we can proceed to higher level languages paying a very little penalty in execution time and in control.
      • My question wasn't generic, it was rather specific. Go was written in C. What was the big drive and from the sound of the headline an urgent and repeatedly delayed push to write it in something else that warrants the use of the word "Finally".

    • Comment removed based on user account deletion
  • No generics (Score:5, Insightful)

    by renzhi ( 2216300 ) on Thursday August 20, 2015 @02:27AM (#50352001)
    I was playing with it when it just came out, and wow, the compiler was fast. It was great and all. So to find out how much I can do or to figure out my own skill level in Go, I started to port one of my C++ libraries to Go. That library has made heavy use of tree and trie data structures, which were implemented as template in C++. Then, bang, I hit a wall with Go. How to do generics? There was no way to do it. Looking on the web, I even saw someone create a kind of "compiler" to generate different code set for different types, say, you want a b-tree for class A? Fine, one set of code for that. Want a B-tree for class B? Fine, another set. Using his tool, I ended with five or six different sets of duplicated code, and I had a few more to go. That's when I stopped using that language.
    • I expect that the Go compiler written in Go compiles slower than the Go compiler written in C, however the Go-in-Go compiler is undoubtedly more loved by the devs, which counts for a lot. Over time, it is probable that the optimizer will develop faster in the Go-in-Go version, which if true, means that the Go-in-Go version will ultimately be superior.

    • Generics are a touchy subject, they make the code awful but they save you from writing more of it. As a side note C++ does just that with its generics implementation (the compiler creates a different code for each class that uses the generic class) that is why C++ compiler is slow. Java does not do that in its generics implementation, but the Java way has its own trade-offs.

  • by T.E.D. ( 34228 ) on Thursday August 20, 2015 @07:22AM (#50352745)

    Having the compiler for a language written in itself is what pretty much every serious compiler is expected to do. Its called being self-hosted [wikipedia.org], and a compiler is generally not considered very mature [stackexchange.com] until it does this.

    So basically what this is saying is that Go has started to grow up.

  • by Applehu Akbar ( 2968043 ) on Thursday August 20, 2015 @08:17AM (#50352927)

    On when Google will suddenly back out of this language project - or both of them, as the case may be - and just go with Swift?

Our business in life is not to succeed but to continue to fail in high spirits. -- Robert Louis Stevenson

Working...