Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Go is a drastically different language than Java. And porting over Java's GC wouldn't make sense.

In Java, everything except primitive types is a pointer. In Go, on the other hand, programming "by value" is encouraged (pointers are explicit, never implicit). In Go, it's possible to actually avoid creating garbage altogether - you have a decent amount of control of where memory gets allocated.

Thus porting Java's GC, which has been highly optimized to deal with hundreds of short-lived objects whose allocation you as a Java programmer have no control over, wouldn't make sense - it's optimized in all the wrong places, for Go, basically.



Yeah, but we're not comparing apples and oranges here.

The Go team have already adapted GCC to their language, for example. They could have also adapted the JVM. For instance the Java guys are adding value types at the moment, but most of the reason it's hard/slow for them is backwards compatibility with existing code. Go doesn't interop with anything except C anyway, so they could just throw that requirement out and have a customised GoVM that supports value types and so on, whilst reusing all the other technology in there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: