128 points · by ConceitedCode · 11y ago · 59 comments
* 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.
We looked at doing cross-platform, but we would have to retrain a lot of iOS-only or Java-only developers so no luck.
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.
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.
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 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...
That's the use case they're targeting. They want Go to be a viable language for mobile games, not mobile apps.
Just in time for all the Oracle lawsuits confirming that Java apis are patent encumbered.
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.
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?
Probably the business logic, which is what least needs to interact with the OS APIs.
Judging from the popping a dialog example, I think the main use case is reusing a Go library inside an iOS app, not any kind of standalone app development entirely with Go. At least, not without a lot of helper libraries which don't exist yet!
(the previous title was something like "Go 1.5 will add support for building iOS apps")
Submitters make up titles all the time that are (to use the sibling comment's words) "clear, descriptive", and wrong. Set aside the fact that HN's rules explicitly ask people not to do that. What would you have us do?
If you say "never change them", that would flood HN with false and manipulative titles forever. (Not that this one was false and manipulative—I wouldn't know. But I do know that that would be the consequence of never changing titles.) If you say "change the ones that are false and keep the ones that are true", you're asking us to be experts on everything.
The submitted title was "Go 1.5 will have iOS support". The submitted web page says nothing of the sort. What should we do? Being an expert on the Go project's internal progress—that is, being an expert on everything in the general case—is not an option. So we look for language in the article itself that is representative of what it says. That has two merits: (1) it preserves the neutral quality of HN's front page and (2) it's doable.
If you'd like to propose a change that doesn't demand superhuman powers of us and wouldn't destroy the character of HN, please do. But getting upset over a single suboptimal example doesn't seem serious to me. HN sees a thousand stories a day. Not every example is going to come out optimal no matter what we do.
Change Ibc23b6d3: cmd/gomobile: enable target=ios
builds | go-review.googlesource Code Review
which a) doesn't fit, and b) doesn't make any sense. A potential technical fix would be to allow both titles and descriptions on posts with URLs.> allow both titles and descriptions on posts with URLs.
I appreciate the suggestion, but we're unlikely to do that. On HN, submitting a story conveys no special rights, and submitters do not get to frame the story for everybody else. Framing it for everybody else effectively means controlling the discussion. We want discussion to be driven by the article itself, not a single user's spin. If a submitter wishes to offer a description or say what they think is important about a story, they're welcome to do so by adding a comment to the thread on the same footing as everybody else.
Didn't know that. Why don't remind that on the "Post to YC" page?
https://news.ycombinator.com/item?id=9812968
Edit: not exact same title, but similar.
Their current guidelines only prohibit dynamic code download (that is: installable plugins from outside the App Store):
3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple’s built-in WebKit framework.
Please do at least a cursory bit of research before commenting about an area you're clearly not familiar with! It will save a lot of time, and prevent FUD like this from continuing to spread.