News for hackers. Stuff that matters.
Re:See Android Go by tosseraccount on Friday July 24, 2015 @08:59AM (#9941623)
Why not write it in C and slap on the native cocoa/win/gtk/android front end and have something totally "portable" to mac/ios/android/windows/linux?
Re:See Android Go by jaegerpicker on Friday July 24, 2015 @09:23AM (#9941770)
Because go is significantly safer and more productive (of course this depends on the developer in question but on average) and using the ndk with c/c++ for serious development on android is absolutely one of the worst modern platform development experiences out there.
Re:See Android Go by cartoonfoxes on Friday July 24, 2015 @03:20PM (#9944510)
> using the ndk with c/c++ for serious development on android is absolutely one of the worst modern platform development experiences out there.

I have to second this. Serious attempts to use the NDK for application-layer work will turn your hair white. It's by far the most god-awful mobile/quasi-embedded tasks I've had professionally. In my experience it's second maybe only to porting C-decompiled FORTRAN between families of obsolete and badly documented DSP chips.

Re:See Android Go by Zigurd on Friday July 24, 2015 @12:02PM (#9942899)
Because it would suck. Android is about app modularity and inter-app cooperation. It is about installable services with high and low-level APIs. It is about handling multiple screen geometries not just with conditional layouts, but also with code reusability in Fragment objects. Skin-deep UI "portability" results in a lowest-common-denominator experience.
Re:See Android Go by rhodysurf on Friday July 24, 2015 @01:54PM (#9943868)
Why does nay of that restrict writing business logic in c or go, then just interfacing it in the Fragment or whatever?
Re:See Android Go by Zigurd on Friday July 24, 2015 @02:05PM (#9943948)
It doesn't. But that's not what the parent comment was suggesting.

If you have anything compute-intensive enough to affect battery life in an Android app, you really ought to use the NDK, and Go will probably be officially supported: https://docs.google.com/document/d/1N3XyVkAP8nmWjASz8L_Ojjnj...

Or if you want Android/iOS portability, find a common API for SQLite and implement in C.

Re:See Android Go by rhodysurf on Friday July 24, 2015 @09:26AM (#9941787)
How is go not portable to all of those platforms?
Re:See Android Go by tosseraccount on Friday July 24, 2015 @10:24AM (#9942158)
No doubt it's potentially portable. Can I compile a GO only program and run on ios?
Re:See Android Go by fit2rule on Friday July 24, 2015 @10:57AM (#9942406)
I did it, its trivial. The magic sauce is all in the use of the #cgo directive, which gives you a way of exporting Go to iOS code and vice versa. I ported IPFS (http://ipfs.io/) as a test, and it runs quite well on iOS:

https://github.com/seclorum/ios-go-ipfs/blob/master/ipfsios/...

Re:See Android Go by tosseraccount on Friday July 24, 2015 @12:25PM (#9943090)
Is see stuff like 'cgo' and 'import "C"'.

What's going on here?

Re:See Android Go by fit2rule on Friday July 24, 2015 @12:53PM (#9943336)
This is the glue that the Go compiler needs to export its symbols in a way that they can be used from the C side of things in Objective-C, and vice versa. Think of it like a toll-free bridge [ * ] between the ObjC and Golang runtimes.

[ * - See https://en.wikipedia.org/wiki/Bridging_(programming) ]

Re:See Android Go by rhodysurf on Friday July 24, 2015 @01:19PM (#9943560)
You dont need to do any of the cgo stuff manually anymore with gomobile