使用Go语言编写一个用于iPhone应用的库。

huangapple go评论142阅读模式
英文:

Using Go to write a library for an iPhone app

问题

我正在考虑使用Go作为C/Objective-C的低级、高性能的替代语言,为iPhone应用程序实现一个库。Go编译器中的任何一个能够生成一个可以与Go运行时等链接到本地iPhone应用程序的库吗?Go是否有ARM版本,或者gccgo/gcc是否支持这一点?我想象,由于gccgo使用gcc作为后端,而Xcode使用gcc编译iPhone应用程序,所以这是可能的。如果可能的话,我该如何在Xcode项目中设置?有人尝试过这个或者看到过相关讨论吗?(当我像“编译go代码iphone”这样进行谷歌搜索时,“go”部分完全没有被使用,我只得到关于iPhone开发的东西。)

英文:

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.)

答案1

得分: 7

Go目前不支持iPhone平台,但它支持ARM处理器。尽管在邮件列表上对此没有进行过多的讨论。

英文:

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.

答案2

得分: 2

即使可能,我怀疑Go比C或Objective C慢得多。大多数独立的基准测试似乎表明当前开发版本的性能较差。这些与C的微基准测试表明Go比C慢2到150倍。它甚至比Java和C# Mono还要慢。所以我认为没有太多理由称Go为高性能的替代品。

虽然这取决于你的应用程序,但我怀疑利用GPU API是解决大多数性能问题的最佳选择。

英文:

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.

答案3

得分: 2

至少要考虑的一件事是Lua。它快速且是我喜欢使用的语言。iPhone Wax使用lua。

英文:

One thing to at least look at would be Lua. It is fast and is a language I like using. iPhone Wax uses lua.

答案4

得分: 0

Go Mobile 项目现在对于 IOS 和 Android 移动开发有一些支持。有关您的应用程序的详细信息,请参阅 Building for IOS 的维基部分。

英文:

The Go Mobile project now has some support for IOS and Android mobile development. See the wiki section on Building for IOS for details for your application.

huangapple
  • 本文由 发表于 2010年2月14日 06:05:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/2259242.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定