News for hackers. Stuff that matters.
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.