* You can write part of your app in Go
* You can share that code across your Android and iOS apps?
Is that right? If so, seems like a solid use case for Go. Until Swift compiles to Android...
* You can write part of your app in Go
* You can share that code across your Android and iOS apps?
Is that right? If so, seems like a solid use case for Go. Until Swift compiles to Android...
[1]: https://github.com/rust-lang/rust-wiki-backup/blob/master/Do...
[2]: https://github.com/rust-lang/rust-wiki-backup/blob/master/Do...
I was tempted with robovm, but found the 30s minimum build & run cycle for trivial code changes too slow for me.
And the performance is pretty good for these guys, they're all as fast as objective-c:
https://medium.com/@harrycheung/mobile-app-performance-redux...
At my last job we did the C++ cross platform layer, and it was very painful. C++ is slow to compile and can create bloated binaries. There can be something said for the freedom of having separate platform teams with just a server api.
That means no stl or boost, but (and this is not a popular opinion at all) this tends to lead to cleaner code, and more productive programmers.
My experience is that templates do allow for more code reuse than you can typically get in other languages, however they do so at a high complexity and maintenance cost -- not to mention binary bloat and long compile times.
However stay away from Qt if you don't want over 30MB with almost no mobile support.
And de-templating, removing stl & boost from 300k+ line projects and debugging it all is something most orgs wont swallow.
We looked at doing cross-platform, but we would have to retrain a lot of iOS-only or Java-only developers so no luck.
One additional issue is that an abstraction layer also adds up in development time. Someone needs to write the platform specific glue, create abstractions that work across all platforms lifecycles, debug if errors happen in the middleware or device firmware...
So it is not always a clear win to not have focused device teams.
Each OS is very complex and no developer can know all of it.
Then the UI engineers often had to create wrappers for the C++ objects (in the iOS Objective-C++ case at least), because ObjC objects only take NSString, while the C++ types only give C++ strings and other such glue things.
Then lazy engineers / deadlines would move business logic into the UI layer wrappers, because development speed wise it was much easier to work with there than to put inside the C++ layer.
Cross platform makes it's own work. But this was with a 'homegrown' C++ solution, so maybe something made by a third party like xamarin might be a very different experience.
It's actually pretty amazing. C/C++ has lots and lots of well established, well tested, open source code in every possible domain. There's also a pretty large base of programmers familiar with the language. There's no dearth of tooling on any platform. And you can do pretty much anything you want to squeeze performance out of the mobile platform (think watches).
If you can write bulk of your business logic as a C/C++ library with clear API's to call into it, then you can simply compile it directly into the ObjC code on iOS and add a thin JNI wrapper on those API's on Android. It works beautifully. We do this for our mobile specific protocol code.
"What is the build cycle time for your C++ code?"
Depending on the machine, 10-20 seconds
"Does it kill xcode's indexer?"
Not at all.
"Does it get included into the iOS project?"
Yes it does. We have it as a git sub repo and a sub project in XCode. Both those things allow us great freedom in independent development, testing, release versioning etc. Of course there are also make files for independent build/test cycles on linux etc.
Another bonus of having it as a first class XCode project, clang Analyze tool does beautiful static analysis. What a godsend that is.
You guys have a far more manageable size.
Has anybody had any real benefit from doing this in the past? I know Facebook did it with moments, but the image processing code could at least be shared here.
I've worked on about 20 enterprise apps and they are nothing more than pretty API wrappers with some trivial functionality implemented on the phone.
Just in time for all the Oracle lawsuits confirming that Java apis are patent encumbered.
IMO, moving to another language should be taken as an opportunity to fix the oversights of the Framework. Things like the atrocious Activity lifecycle or the backstack handling.
There are several contenders :
-Dart : Google controls this language and the Dart Team is openly experimenting with their own Android fralewirj. The results are extremely underwhelming so far though.
-Kotlin : A better Java. I doubt that it would solve Android legal troubles though.
-Rust : the language has so many interesting ideas. I don't know if its complexity is warranted in Android's context though.
-a new language inspired by Kotlin, Rust, Go, Swift,... . Why not ? It would need a serious value proposition in order to be interesting though.
-insert your pet language here : everyone seems to want to develop Android apps in their most familiar language ...
Again, the official word from the Android team is that Java is the language of the platform for the time being. I just hope that if they are indeed planning a switch to another language, it will be discussed in the open beforehand. Such a debate is not always constructive, but it could be very important in Android's context.
That's the use case they're targeting. They want Go to be a viable language for mobile games, not mobile apps.
I guess there is a lot of complex logic in there, the GWT chunk is a good megabyte or so, if I remember right. I think it's all syncing and conflict resolution stuff, but it's hard to tell for sure. (GWT code is optimized/compacted enough that I only have the string constants to go on.)
[0]: http://gmailblog.blogspot.ca/2014/11/going-under-hood-of-inb...
[1]: http://arstechnica.com/information-technology/2014/11/how-go...
Regardless of what is going on with Oracle, the Android team sees the NDK as a nuisance and only offers NDK APIs suitable for games.
How does Go represent UIkit and similar APIs?