Re:Why Android should switch to Go
by jff on Tuesday May 15, 2012 @02:04PM
(#3977857)
I would love to see Go being used instead of Java, however unlikely that may be (don't think the Android guys would be that thrilled to throw out all their work). This article, though, doesn't really make a good case for it. It just says, "Hey, Go is BSD licensed, and they call it a systems language! Look, here's Hello World!"
Re:Why Android should switch to Go
by jzs on Tuesday May 15, 2012 @12:48PM
(#3977416)
While i truly love Go as a language i think it might still not be mature enough to be used as a full fledged language for Android. The garbage collector is still not mature and could use some optimizations.
You also call Java a systems language. I'm not sure i agree in that view since you don't have direct access to the hardware it runs on. You're still running on JVM which does jit compilation of your code. Java is a high level language falling into the came category as the .NET languages and Python.
I would still very much see Go on android as a fully supported language. Go is beautiful.
Re:Why Android should switch to Go
by pcwalton on Tuesday May 15, 2012 @04:32PM
(#3978656)
I'm skeptical. Incremental cycle collection is quite hard, and you lose the benefits of cycle collection (only tracing suspected-dead objects) when you move to tracing garbage collection as a backup for reference counting.
For mobile I would just use an incremental garbage collector with heavy usage of stack allocation and interior objects. Or use a reference-counted system and disable the GC entirely (leaking cycles).
Re:Why Android should switch to Go
by AncientPC on Tuesday May 15, 2012 @03:42PM
(#3978397)
When Go came out in 2009, Android was only 2 years old. Go was easily not mature enough.
Another consideration is Android was fighting for market share from Apple. Forcing Go on developers would just create another barrier to switching.
Go's ARM compiler (5g) still needs quite a bit of work before it can be used on Android. Right now, even the canonical "Hello World" program fails to work on a lot of Android phones.
There is too much momentum behind Dalvik that it would be near suicide to discontinue support. However that doesn't mean Android can't support both Java and Go in the future, but there must be a compelling reason to switch.
Re:Why Android should switch to Go
by gatlin on Tuesday May 15, 2012 @01:52PM
(#3977773)
Objective-C, despite not being popular outside Apple, isn't proprietary at all. Many of Apple's frameworks are but the language itself is open. GNUStep is a resource for that.
Re:Why Android should switch to Go
by geoffhill on Tuesday May 15, 2012 @02:18PM
(#3977939)
Probably a much better idea with the gift of hindsight. However, Objective-C is more than 28 years old, and Go is just 3 years old at time of writing. The Go language has changed and continues to change a lot, and tying such a large platform to it before it is ready would make backwards-compatibility a huge concern for Go, and stifle its innovative growth.
Re:Why Android should switch to Go
by salimmadjd on Tuesday May 15, 2012 @07:54PM
(#3979593)
Go has a low adoption rate compared to Java among developers. Go can be the best language in the world, but until there is enough developers using it, it will be a huge gamble by Google. Also this would cause a huge distraction and it would surly put them further behind IOS.
Re:Why Android should switch to Go
by lucian1900 on Tuesday May 15, 2012 @06:07PM
(#3979162)
With some work, Go can already work with the NDK. The problem is that almost all the APIs are Java only. The only exceptions are things strictly necessary for writing games.
Re:Why Android should switch to Go
by melling on Tuesday May 15, 2012 @02:13PM
(#3977914)
How much more does it need to mature? The Android VM is not very mature and it isn't nearly as performant as Sun's Hotspot compiler. I would never throw out the "Java" language but having Go as an option might be good for developers, with its near instantaneous compile times and concurrency model. It could be used instead of the NDK, for example.
Re:Why Android should switch to Go
by loudmax on Tuesday May 15, 2012 @03:14PM
(#3978259)
I agree, there's too much invested in Dalvik as a Java environment for Google to throw that out, however the Oracle lawsuit works out. I wonder how feasible it would be to make Dalvik run Go the way it runs Java. If it runs reasonably well, that would be a great option.
Re:Why Android should switch to Go
by ajross on Tuesday May 15, 2012 @01:47PM
(#3977741)
Strictly NaCl is a VM, not an API or platform. What APIs there are are limited to a handful of system libraries used for in-memory work supporting a broader UI written in the browser.
So you could make your "platform" a HTML5 environment supporting NaCl, which is more or less what ChromeOS is. But that's not Android, and doesn't really have a migration path from the existing Dalvik frameworks.
You also call Java a systems language. I'm not sure i agree in that view since you don't have direct access to the hardware it runs on. You're still running on JVM which does jit compilation of your code. Java is a high level language falling into the came category as the .NET languages and Python.
I would still very much see Go on android as a fully supported language. Go is beautiful.
For mobile, I'd use reference counting, with an incremental collector working on the cycles. (And encourage the pros to use weak references.)
For mobile I would just use an incremental garbage collector with heavy usage of stack allocation and interior objects. Or use a reference-counted system and disable the GC entirely (leaking cycles).
Incremental GC has been done. It wouldn't be super efficient, which is why one would encourage the pros to use weak references.
Another consideration is Android was fighting for market share from Apple. Forcing Go on developers would just create another barrier to switching.
Go's ARM compiler (5g) still needs quite a bit of work before it can be used on Android. Right now, even the canonical "Hello World" program fails to work on a lot of Android phones.
There is too much momentum behind Dalvik that it would be near suicide to discontinue support. However that doesn't mean Android can't support both Java and Go in the future, but there must be a compelling reason to switch.
There are regular discussions on the golang-nuts mailing list about Go on Android: https://groups.google.com/group/golang-nuts/search?q=android
I certainly hope for Go as a core Android language.
So you could make your "platform" a HTML5 environment supporting NaCl, which is more or less what ChromeOS is. But that's not Android, and doesn't really have a migration path from the existing Dalvik frameworks.