I'm considering using Go as a low-level, performant language alternative to C/Objective-C to implement a library for an iPhone App. Could either of the Go compilers generate a library that could be linked into a native iPhone app with the Go runtime, etc.? Is there an ARM port for Go or does gccgo/gcc support this? I imagine that since gccgo uses gcc as the back-end and Xcode uses gcc to compile iPhone apps that there is a strong chance that this is possible. If it's possible, how would I set that up in an Xcode project?
Has anyone tried this or seen it discussed before? (When I do a Google search like "compiling go code iphone" the "go" part is completely unused and I get only stuff about iPhone development.)
Apps written entirely in Go have a main function, and can be built with `gomobile build`, which directly produces runnable output for Android and iOS. The gomobile tool can get installed with go get. For reference, see https://golang.org/x/mobile/cmd/gomobile.
On an iPhone or Android device, gently place your finger on an icon and drag it on top of another app. The phone will automatically create a folder containing those two apps. Tap Done. To add apps into an existing folder, drag an app into that folder.
App Library shows your apps organized into categories, such as Creativity, Social, and Entertainment. The apps you use most are near the top of the screen and at the top level of their categories, so you can easily locate and open them.
Go doesn't support the iphone platform right now, but it does support ARM processors. There hasn't been much discussion about this on the mailing list though.
Even if possible, I suspect Go is significantly slower than C or Objective C. Most independent benchmarks seem to suggest poor performance using the current development versions. These microbenchmarks against C suggest Go is 2 to 150 times slower than C. It is even slower than Java and C# Mono. So I see little reason to call Go a performant alternative.
Although it depends on your application, I suspect leveraging the GPU api is the best bet for most performance problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With