News for hackers. Stuff that matters.
Re:"100% of our production system is now running Go" by cageface on Thursday August 30, 2012 @10:51PM (#4458010)
In hindsight it doesn't seem so surprising. Go really isn't a good alternative to C++ for the kinds of things that really need the low-level control and direct memory access C++ provides. And if you don't really need those things you probably should have moved on to Java or Ruby/Python/etc already.

And since a lot of Java shops are fantastically risk averse I'm not at all surprised that the same kind of people that were willing to take a risk on Python or Ruby are now into Go. It offers a lot of the expressiveness of either of the former with much better performance, concurrency as a fundamental, and the extra safety of static type checking.

Re:"100% of our production system is now running Go" by thebigshane on Thursday August 30, 2012 @11:21PM (#4458103)
Straight from Rob Pike -- http://commandcenter.blogspot.com/2012/06/less-is-exponentia...

  Python and Ruby programmers come to Go because they don't 
  have to surrender much expressiveness, but gain 
  performance and get to play with concurrency.

  C++ programmers don't come to Go because they have fought 
  hard to gain exquisite control of their programming 
  domain, and don't want to surrender any of it. To them, 
  software isn't just about getting the job done, it's 
  about doing it a certain way.

  The issue, then, is that Go's success would contradict 
  their world view.

  And we should have realized that from the beginning. 
  People who are excited about C++11's new features are not 
  going to care about a language that has so much less.  
  Even if, in the end, it offers so much more.
Re:"100% of our production system is now running Go" by tjoff on Friday August 31, 2012 @04:36AM (#4458836)
I have such a hard time believing how anyone could have believed that C/C++ programmers would switch to a GC-only language just like that.

I just can't see Go as an alternative to C or C++, and I'm quite surprised that anyone (especially someone such as Rob Pike) could.

Sure there are situations where a program that typically would have been written in C/C++ could benefit from Go (so there is a place for it), but the reasons for choosing C/C++ are often the same that makes Go a really bad fit.

My dreams of a C-like language where the dangerous parts have been removed (and in this context I don't consider having control of your memory dangerous) took a hit with the introduction of Go :(

Re:"100% of our production system is now running Go" by eckyptang on Friday August 31, 2012 @07:11AM (#4459151)
I think C/C++ programmers have had their reign long enough and have shown us through the amount of utterly horrible security issues that managing memory yourself is a bad idea.

Go fits an important niche: stuff that doesn't have to play with the hardware directly, which is pretty much everything but the OS.

I controversially consider there to be no other use for C bsaed languages these days other than at the kernel level.

It's better to centralise the memory management and optimisation either into a VM or compiler. It's easier and safer to verify a compiler (mathematically or otherwise) than every memory access that you do.

Due to my engineering background, I would always sacrifice performance for less risk and more reliability.

I've also spent 20 years writing C and C++ so I know how horrible it is.

Re:"100% of our production system is now running Go" by tjoff on Friday August 31, 2012 @09:11AM (#4459510)
Go fits an important niche: stuff that doesn't have to play with the hardware directly, which is pretty much everything but the OS.

The anything-but-the-OS-niche? I thought we had plenty of languages for that.

It's better to centralise the memory management and optimisation either into a VM or compiler. It's easier and safer to verify a compiler (mathematically or otherwise) than every memory access that you do.

You seem to ignore performance altogether, if you programmed in C/C++ for twenty years but don't care for performance and don't do low-level work, why have you been using C/C++?

Or if you have been doing low level or performance critical work, why wouldn't you want a safer alternative for that?

When you have to tune and debug your application to please the garbage collector having to deal with your own memory seems like child's play. It is much easier and safer to verify that your own memory management won't bite you than it is to be sure that your garbage collector won't eat you. (surely that depends on the context etc. but making broad claims seems to be on topic...)

Right tool for the right job. C/C++ has "monopoly" on a lot of use cases (way more than any other language) and considering its issues I truly believe that a "better C/C++" is needed, way more than those 20 JVM-based languages that popup every other month. Or Go.

Re:"100% of our production system is now running Go" by eckyptang on Friday August 31, 2012 @09:48AM (#4459659)
The anything-but-the-OS-niche? I thought we had plenty of languages for that.

We have plenty of languages, but most of them are low performance interpreted languages, have major compromises or are not architecturally sound. Go addresses a lot of those issues - more than any other language so far.

You seem to ignore performance altogether, if you programmed in C/C++ for twenty years but don't care for performance and don't do low-level work, why have you been using C/C++?

I don't ignore performance. There are many ways to achieve performance. I've worked on embedded systems (military, medical sector) and occasionally need direct hardware access which is where I use C/C++ and that is primarily to manipulate a device and hand off a suitable abstraction to a higher level language (with a garbage collector).

When you have to tune and debug your application to please the garbage collector having to deal with your own memory seems like child's play. It is much easier and safer to verify that your own memory management won't bite you than it is to be sure that your garbage collector won't eat you. (surely that depends on the context etc. but making broad claims seems to be on topic...)

That is all down to determinism. Determinism can be achieved in various simple ways. If you understand the language, you can write code that pre-allocates and reuses memory in critical sections therefore invoking no garbage collection penalty. Isolating critical sections from each other is still a problem in C/C++ if you consider the threading model that they use.

Right tool for the right job. C/C++ has "monopoly" on a lot of use cases (way more than any other language) and considering its issues I truly believe that a "better C/C++" is needed, way more than those 20 JVM-based languages that popup every other month. Or Go.

I'm not a fan of all "those 20 JVM-based languages" - I find them tedious and ugly. I'm the most critical person on the planet when it comes to this sort of thing. Go pretty much hits the mark.

I think your complaints could be addressed with a simple extension to pause the collector therefore introducing determinism i.e:

   func CriticalFunc() {
       defer runtime.ResumeGC()
       runtime.PauseGC()
       // critical section
   }
Re:"100% of our production system is now running Go" by pcwalton on Friday August 31, 2012 @10:13AM (#4459760)
"I think your complaints could be addressed with a simple extension to pause the collector therefore introducing determinism"

I don't think that scales to multiple threads. Remember, the GC is global. With a lot of goroutines, you're going to end up delaying GC far too long if any of them can block the GC.

These sorts of things are the reason why it's considered a bad idea to muck around with the GC settings in e.g. the JVM unless you really know what you're doing. The right way to avoid GC pauses in a GC'd language is to avoid generating garbage; e.g. with free lists.

Re:"100% of our production system is now running Go" by eckyptang on Friday August 31, 2012 @10:49AM (#4459945)
GC doesn't have to be global or blocking. If you look at the GC in CLR/.Net 4+ then it can run GC on low priority background threads.

I know Go's GC isn't there yet, but it's easier to centralize a performance improvement under this model i.e. GC improvements will lead to global improvements rather than case by case.

There's more than one way to skin a cat on this one.

Re:"100% of our production system is now running Go" by luriel on Friday August 31, 2012 @10:54AM (#4459969)
> The right way to avoid GC pauses in a GC'd language is to avoid generating garbage; e.g. with free lists.

And Go makes it much easier to avoid generating garbage than pretty much every other GC language around, already "by default" Go code tends to generate dramatically less garbage than for example Java, and when you care, you can further fine tune it to produce even less garbage.

Re:"100% of our production system is now running Go" by mogrim on Friday August 31, 2012 @01:49PM (#4460812)
Genuine question, from ignorance: How does Go create less garbage than Java? I can certainly appreciate that a lot of the common frameworks used in JEE development may be memory-hogs, but the language itself?
Re:"100% of our production system is now running Go" by vetinari on Friday August 31, 2012 @02:58PM (#4461147)
just iterating:

  for (Object o: collection) {
  }
causes memory allocation.

If you are interested, android team at had several talks at Google I/O (not just 2012) about optimizing memory usage.

Re:"100% of our production system is now running Go" by mogrim on Saturday September 01, 2012 @06:46AM (#4463334)
Cheers, will check those out.
Re:"100% of our production system is now running Go" by MatthewPhillips on Friday August 31, 2012 @07:56AM (#4459253)
Re:"100% of our production system is now running Go" by jk4930 on Friday August 31, 2012 @10:34AM (#4459872)
You should look at Ada 2005 (or Ada 2012). Ada is battle-proven and comes with plenty of reliability tools and inbuilt safety. It's also focused on embedded, distributed and real-time systems.

AdaCore provides high quality compilers and tools (GPLed) under http://libre.adacore.com/

Interested fellas might start with reading this article: http://www.adacore.com/adaanswers/gems/gem-30/

EDIT: oops, that should be an answer to eckyptang... anyway, check out Ada. :)

Re:"100% of our production system is now running Go" by tjoff on Friday August 31, 2012 @09:13AM (#4459514)
I'll definitely read up more on Rust, thanks.
Re:"100% of our production system is now running Go" by zedzedzed on Friday August 31, 2012 @08:08AM (#4459280)
+1 Rust is a lot closer to systems....
Re:"100% of our production system is now running Go" by slurgfest on Friday August 31, 2012 @12:06PM (#4460268)
> I have such a hard time believing how anyone could have believed that C/C++ programmers would switch to a GC-only language just like that.

Java believed the same thing. Many did switch. The difference today is that most of the people liable to switch already switched to Java.

If I could guess, I'd guess that Go is doing a better job at picking up Java programmers than C++ ones.

Re:"100% of our production system is now running Go" by wapper on Friday August 31, 2012 @10:59PM (#4462533)
I've been meaning to ask someone that. If you switch from java to go, is it really such an improvement in non-trivial cases ?

In Go, you'll be doing the C thing : you'll be reimplementing every datastructure from scratch (or use void, also known as interface{}), and have the same memory allocation problems as java. The problem with that is obvious : only experienced C library authors stand any chance of getting complicated trees right the first time (and I still only seen one person get red-black trees insert right first time once*, 3 other university professors and several assistants failed).

And the fact that you need to write those things from scratch everytime means you've got to debug that extremely finicky and difficult code every single time ... and then a junior programmer comes in and says "hey I can get to the internal fields easy, why don't I just" and you're in for an 8 hour debugging session because that causes a crash in the normal insert code, not the actually wrong code.

One thing I did in go that really, really bugged me was sorting a list (sorting a list of strings). I was making it as short as I possibly could without violating style rules ... 70 lines of code. That's ... well that's just not reasonable.

ArrayList<String> x = Lists.newArrayList("b", "c", "d", "a"); Collections.sort(x); System.out.println(x);

Give me the Go equivalent, in less than 50 lines of code. Please. That just has got to have a short solution, right ?

As it stands, I believe Go is good at being a fast conduit for nearly-ready data. A way to write asynchronous servers. If you need complicated algorithms or quick ways to change data operations ... maybe I'm wrong but it just looks like Go is really not going to be your friend.

Re:"100% of our production system is now running Go" by mturmon on Friday August 31, 2012 @12:19AM (#4458245)
Nice link. The separate submission and thread is here:

http://news.ycombinator.com/item?id=4158865

Re:"100% of our production system is now running Go" by batista on Friday August 31, 2012 @01:30AM (#4458400)
>The issue, then, is that Go's success would contradict their world view.

I call BS. The parent explanation is much better: for a lot of the kinds of jobs C++ is good for, Go is not that good, whereas for a lot of things Python is good for, Go is as good and has better performance.

Re:"100% of our production system is now running Go" by tptacek on Friday August 31, 2012 @11:38AM (#4460134)
If you read this whole subthread, what you basically get is a confirmation of what Rob Pike wrote in his post: a series of objections revolving around things Go doesn't have that C++ does have. Pike's point is that these objections were in hindsight inevitable, because the whole idea behind Go is to simplify the language --- Go is even simpler than ANSI C.

The Go team's idea was, look at languages like C++ and replace groups of individual features with orthogonal components that can be composed to similar effect.

Pike is a little dismissive of C++, as am I, but ultimately he acknowledges the truth of the matter: if you're dead set on writing programs using template generics and inheritance hierarchies, you're going to stick with C++. And that's OK. We don't need to argue about it.

I am very new to Go, have a background in C/C++, am Ruby today, and was Python from '02-'05. My take is that there are definitely still things I would write in C, and I would still write web frontend code in Ruby. But I see a place for Go (backend network code, network clients, things like that) and I personally see no place at all for C++ (but then, the C++ people might not see any place at all for C). Go doesn't have to be all things to all people.

Re:"100% of our production system is now running Go" by batista on Friday August 31, 2012 @01:05PM (#4460581)
>I personally see no place at all for C++

Application programming in the scale of Photoshop, Word, etc. Video games. All kinds of multimedia apps and video/music editing apps.

C is too low level for those kinds of things, and Go too high level.

Plus it's not just the language, that's a mistake: it's the whole ecosystem that matters.

E.g you're gonna find more experienced C++ programmers to make you the next, say, Call of Duty or Logic Pro 9, than you're gonna find Go programmers. And far more code and libs to leverage.

Re:"100% of our production system is now running Go" by tptacek on Friday August 31, 2012 @01:42PM (#4460779)
It's true: C++ is probably going to own AAA games for a long time, and, for desktop applications, you're going to tend to use the "golden path" dev environment for each platform (ie, ObjC for Mac apps, C++/Managed C++ for $50 Windows desktop apps. Right now, I'm not sure I know of a desktop app environment where Go fits on the golden path.

And, I'll restate: from the 1000-or-so lines of Go I've written so far, I'm pretty clear that I wouldn't want to use it for frontend web stuff (anything with serverside templates). But I'd probably use it before I would use Node.js for a backend web service, or maybe even for a single-page app.

Re:"100% of our production system is now running Go" by Nitramp on Saturday September 01, 2012 @09:09AM (#4463568)
Note that at least Adobe has started to put significant amounts of Lua into their user facing applications, as the glue on top of C++ components.

Outside of the lack of bindings to proper UI frameworks, I couldn't say why you shouldn't write e.g. Word in a higher level language than C++. You might have to be careful with memory usage in some components, maybe even write those in native code, but for the vast majority of interactions something higher level should work, shouldn't it?

After all you can implement something akin to Word in JS + HTML (Google Docs).

Re:"100% of our production system is now running Go" by qznc on Friday August 31, 2012 @02:39AM (#4458570)
C++ is better for abstraction, as Go does not have generics yet, and C++ is better for performance.

Go is faster to compile. Maybe Go is better for concurrent programming, but this is hard to measure.

Re:"100% of our production system is now running Go" by draven on Friday August 31, 2012 @04:19AM (#4458793)
Go has interfaces, which can be used to write generic code. Go performance is not on par with optimized C++ but for me it's fast enough and the performance / dev_time ratio is higher.
Re:"100% of our production system is now running Go" by qznc on Friday August 31, 2012 @04:57AM (#4458883)
http://golang.org/pkg/container/list/

Casting every list element to "interface{}" is not generic.

Re:"100% of our production system is now running Go" by luriel on Friday August 31, 2012 @05:27AM (#4458935)
Use slices.

Really, maybe we should remove container/* completely, so we don't have to answer this stuff over and over again.

Re:"100% of our production system is now running Go" by qznc on Friday August 31, 2012 @06:43AM (#4459087)
Slice still restricts you to an array data structure (a continuous block of memory). How would you implement a sorted set in Go? It should be generic and type safe and efficient, please. Compare with the C++ solution.
Re:"100% of our production system is now running Go" by draven on Friday August 31, 2012 @07:51AM (#4459235)
I think the problem with saying that Go can be used as a C++ replacement is that the statement is too vague. The problem space in which Go is a great tool and the one in which C++ is a great solution have a big overlap. But that does not mean that you will solve a given problem in this overlapping space the same way. Both languages have a different set of trade-offs.

If you need a typesafe, generic sorted set with strict efficiency needs (or things like precise control over memory layout and such) then by all means go for C++, it's been designed for that kind of constraints.

Re:"100% of our production system is now running Go" by luriel on Friday August 31, 2012 @10:47AM (#4459927)
> If you need a typesafe, generic sorted set with strict efficiency needs

When people ask for things like this, I can't help to think that what they want is not generic at all, they want something very specific to the problem they are solving, in those cases just writing custom data structures is the way to go in any language anyway.

It is the way it has been done in C for decades too.

Re:"100% of our production system is now running Go" by kragen on Saturday September 01, 2012 @11:50AM (#4464041)
You may be able to write the custom data structures more easily with the STL than in C.
Re:"100% of our production system is now running Go" by draven on Friday August 31, 2012 @05:43AM (#4458972)
Go does not have generics per se but that container looks pretty generic to me.

What's your definition of generic programming BTW? I'm looking at several definition right now and cannot find out if, for example, a generic list container in C using void pointers to data would be considered generic programming.

Wikipedia states generic programming is "a computer programming paradigm based on method/functions or classes defined irrespective of the concrete data types used upon instantiation". That reads like "templates" to me.

Re:"100% of our production system is now running Go" by microtherion on Friday August 31, 2012 @06:37AM (#4459076)
To me, generic programming implies preserving all type information, which is something the above Go container does not do (when you get an element out of the container, you cannot tell statically what type it is).

Templates are generic, but so is, e.g. the type inference used in functional languages.

Re:"100% of our production system is now running Go" by qznc on Friday August 31, 2012 @06:44AM (#4459093)
In some sense, you can do generic programming with C by using void*, but this throws out type safety.
Re:"100% of our production system is now running Go" by sixbrx on Friday August 31, 2012 @08:55AM (#4459445)
I'd say void pointers are more untyped programming than generic programming.
Re:"100% of our production system is now running Go" by tptacek on Friday August 31, 2012 @11:32AM (#4460111)
One look at the Go standard library contradicts this. Go is perfectly adequate for abstraction.
Re:"100% of our production system is now running Go" by kragen on Saturday September 01, 2012 @11:48AM (#4464032)
I think you may be talking past each other. C++ or D templates allow you to express (in a crude, verbose, error-prone way) some kinds of abstractions that are not expressible in Golang or ML. Not sure about C#.

There are certainly lots of abstractions you can express in Golang.

Re:"100% of our production system is now running Go" by jussij on Friday August 31, 2012 @09:52AM (#4459679)
> Go does not have generics yet,

From all accounts it will never ever get generics.

> and C++ is better for performance.

As Go is a GC based language I would expect it will always be slower than non GC languages like c/c++.

But the big question is, is it really that much slower?

And the fact that it is a GC language means it is a much simpler language than C++.

Re:"100% of our production system is now running Go" by vardump on Friday August 31, 2012 @03:11PM (#4461209)
> As Go is a GC based language I would expect it will always be slower than non GC languages like c/c++.

Actually C malloc, free, C++ new, etc. are really slow functions. Garbage collected languages can typically 'allocate' memory with little more than top of heap pointer increment.

You can implement similar memory pools with C/C++, but it's hard to get right when large allocations are made, compacting is very hard, etc. It does work for limited applications, for example ones that have a lot of short-lived small objects.

Multi-threaded garbage collected languages also don't need locking for freeing objects. With manual memory management you might need to lock the parent object before freeing the child to prevent some other thread from loading a pointer to the free'd child object. Locks are slow, even atomic primitives require slow inter-CPU communication. Garbage collection can avoid that completely. Performance win for gc can be hundreds of percents with 16+ CPUs.

Re:"100% of our production system is now running Go" by heretohelp on Friday August 31, 2012 @04:17PM (#4461500)
>But the big question is, is it really that much slower?

So, there's a pretty good shibboleth/knowledge smell you can use to detect whether somebody's done systems programming and knows what they're talking about or not.

Whether they think relying completely on the heap is a "small" cost or not.

Try writing some code in a real-time constrained environment where non-determinism is unacceptable. See how far malloc and Boehm gets you.

Re:"100% of our production system is now running Go" by slurgfest on Friday August 31, 2012 @11:59AM (#4460233)
I disagree that the sweet spot of Go is in the same place as the sweet spot of Python. Go has put significantly less emphasis on transparently readable code. Viewed from C++, Go looks like Python, but viewed from Python Go looks like a less crazy Java.

Fast compilation (merely being-interpreted) is surely a very cool feature which makes Go more appealing, but that is not the only productivity feature of Python.

Re:"100% of our production system is now running Go" by jlouis on Friday August 31, 2012 @06:14AM (#4459038)
Actually, If you have invested the 15+ years it takes to become a decent C++ programmer, then you won't want to throw that out just because some new language comes by.

Most of what happens in C++ is low level maintenance of data. There are certain programs where this is important, but for the largest chunk of programs, low level maintenance provides more buggy programs with considerably worse performance.

And this is the real crux of the problem. For some C++ programmers they wont or simply can't give up the low level ability to mangle data. I have a hunch though that certain lacking constructs, generics come to mind, are used as excuses for not even wanting to take a decent look at the language. I have a feeling that sometimes it ends up being a religious tirade because "then I can't do my own containers". But you really shouldn't.

Most dynamically typed languages do not really need a generic-primitive. Does that make them unsuitable for programming? Hardly. In Go you just have to work around the problem.

Re:"100% of our production system is now running Go" by stonemetal on Friday August 31, 2012 @07:12AM (#4459153)
If you have invested the 15+ years it takes to become a decent C++ programmer

I have been programming in C++ for the past 14 years. Other than fast compile times, and a little less work to wire up interfaces, what exactly I am I supposed to be drooling over Go for? Between RAII and other modern C++ practices I don't really feel the need for a garbage collector. I already have a library that gives me Channel like functionality. I am sure if I really wanted green threads I could find an implementation that was similar to goroutines. Basically when I get excited about new programming languages it is about languages different enough from C++ that they actually have a shot at being better, Clojure, Scala, and Haskell come to mind.

A language that doesn't affect the way you think about programming, is not worth knowing.

Edit: I am fully aware that I may be blind. I do plan on exploring Go at some point, but exploring other more exotic languages take priority for me.

Re:"100% of our production system is now running Go" by swah on Friday August 31, 2012 @08:38AM (#4459372)
Are you a similar username in reddit?
Re:"100% of our production system is now running Go" by stonemetal on Friday August 31, 2012 @01:39PM (#4460764)
Yes, fairly similar but not the same.
Re:"100% of our production system is now running Go" by swah on Saturday September 01, 2012 @11:19AM (#4463933)
Are you "full of bullcrap"?
Re:"100% of our production system is now running Go" by stonemetal on Saturday September 01, 2012 @07:44PM (#4465538)
Aw, how did you guess. What did you find full of it? In GC languages you still have to have to manage reference life times so that you don't leak memory by holding on to references too long(Yes I have fixed that bug in someone else's C# code). If you are already doing all the reference tracking what is wrong with making it explicit and typing the delete? Good build tools doing the minimal rebuild thing make builds manageable, sure Go's are faster but it wasn't a pain I was feeling, or have lived with so long I forgot. So for me the differences boil down to type safe generics vs the way interfaces work. Go is a worthwhile experiment(God I hope Google is doing IBM style research on Go's effect on quality, and that they share it) in how to make development better, but I don't currently think I will see enough payoff to justify the effort of switching. That is especially true when you consider all the external tidbits like library support.
Re:"100% of our production system is now running Go" by swah on Sunday September 02, 2012 @06:53PM (#4468440)
Sorry, I was just asking if you were the guy at http://fullof.bs/ which goes by stonecypher on reddit...
Re:"100% of our production system is now running Go" by stonemetal on Tuesday September 04, 2012 @11:23AM (#4474921)
Nope, not that guy. stonefarfalle on reddit. I probably am full of BS(after all the mouth is large and rarely closed for business), but a little too proud, and prudish to call myself that in public.
Re:"100% of our production system is now running Go" by stonemetal on Tuesday September 04, 2012 @05:07PM (#4476536)
Also, Sorry for forgetting the default shouldn't be snark.
Re:"100% of our production system is now running Go" by radiosnob on Friday August 31, 2012 @06:24AM (#4459059)
If you're a programmer/developer/hacker, you don't "throw out" what you already know.

Wouldn't learning a new language expand your toolset? Not replace it.

And I think most here agree that Go and C++ are solving different problem spaces. So knowing both would be a win.

Re:"100% of our production system is now running Go" by raverbashing on Friday August 31, 2012 @03:52AM (#4458741)
I think there's a bit of truth in both

And you can't use go outside of the "PC" (that is, embedded systems).

Re:"100% of our production system is now running Go" by davidw on Friday August 31, 2012 @04:14AM (#4458784)
> And you can't use go outside of the "PC" (that is, embedded systems).

Why not? It runs on Arm.

Re:"100% of our production system is now running Go" by raverbashing on Friday August 31, 2012 @04:50AM (#4458871)
PPC, MIPS, SH?

But the issue is twofold, you need a specialized GC for systems with memory limitations (and/or some realtime requirements)

Re:"100% of our production system is now running Go" by davidw on Friday August 31, 2012 @05:15AM (#4458907)
I suppose it depends on just how "embedded" what you're dealing with is. Clearly, something like Go is bigger and slower than C, so there will be places where it's not useful. I could certainly see it being useful elsewhere though.
Re:"100% of our production system is now running Go" by luriel on Friday August 31, 2012 @05:15AM (#4458911)
I think GCCGO should work for PPC and MIPS, not sure about SH, but is worth a try.
Re:"100% of our production system is now running Go" by shin_lao on Friday August 31, 2012 @06:07AM (#4459021)
You need a deterministic memory management.
Re:"100% of our production system is now running Go" by ori_b on Friday August 31, 2012 @10:02AM (#4459723)
For what? Android does fine without it, if you still consider that embedded. Java is used in a wide variety of embedded systems without trouble.

Sure, there are some places that can't use Go. But there are also places that cant use dynamically allocated memory or recursion. Not all embedded systems are safety critical or need to be absolutely deterministic.

Re:"100% of our production system is now running Go" by pcwalton on Friday August 31, 2012 @12:59PM (#4460550)
Actually, from conversations with the Android team, Android system and apps code goes to great effort to use manual free lists and object recycling to avoid allocations during animations. Manual memory management is necessary to compete with the manually-memory-managed iOS frameworks. And Dalvik has an incremental, generational GC...
Re:"100% of our production system is now running Go" by oofabz on Thursday August 30, 2012 @11:26PM (#4458122)
I write Go and I have been satisfied with the low-level control and direct memory access. The language has pointers and you can cast between ints and pointers, so you can do anything you can do in C.

If you're writing realtime code, you can avoid triggering the garbage collector simply by not allocating memory on the heap. It is harder to get anything done this way, but writing realtime code in any language is difficult.

Re:"100% of our production system is now running Go" by cageface on Friday August 31, 2012 @12:29AM (#4458263)
I actually haven't gotten this far with Go myself so I'm glad to hear that it's possible.

But there's a huge uphill battle ahead for Go here. For instance, I write C++ code because I'm doing music software and all the APIs and existing code libraries and samples are in C++. It's just so much easier in this environment to put up with C++'s warts than it would be to try to shoehorn Go in there. As John Carmack says, externalities can quickly overwhelm the advantages of any particular language.

But if you're implementing web services from scratch you don't have any of that baggage to carry around so it's much easier to choose Go.

Re:"100% of our production system is now running Go" by Evbn on Friday August 31, 2012 @01:26AM (#4458390)
Swig can help there?
Re:"100% of our production system is now running Go" by cageface on Friday August 31, 2012 @01:55AM (#4458476)
For my particular application it's not even close to worth it, but in some cases I can imagine it might be worth the hassle.
Re:"100% of our production system is now running Go" by akavel on Friday August 31, 2012 @03:55AM (#4458746)
Re:"100% of our production system is now running Go" by aaronblohowiak on Friday August 31, 2012 @03:05AM (#4458630)
>you can do anything you can do in C

This is true only for very limited meanings of "anything"; if your point was that you had direct control of memory layout and you can use CGO for those things that C offers but go does not. For instance, the volatile keyword..

Re:"100% of our production system is now running Go" by StavrosK on Friday August 31, 2012 @05:16AM (#4458913)
> In hindsight it doesn't seem so surprising.

Most things don't seem surprising in hindsight. That's why you don't judge surprises by it.

If C++ programmers did flock to Go, would you then say that that was surprising? If not, you've just fallen victim to hindsight bias (because a model that predicts everything is useless).

Re:"100% of our production system is now running Go" by cageface on Friday August 31, 2012 @07:38AM (#4459202)
Most things don't seem surprising in hindsight. That's why you don't judge surprises by it.

Surprising was GP's original term, not mine.

I don't expect Go or any other language to displace C++ any time soon. But I do think the "scripting" languages are very vulnerable to challenges from languages with static typing systems less primitive than Java's.

Re:"100% of our production system is now running Go" by StavrosK on Friday August 31, 2012 @09:05AM (#4459486)
That's because the GP was surprised. I rather should have said, you don't judge that something wasn't surprising by hindsight.

Hindsight makes things obvious.