React Native in Golang for iOS/Android UI?

1,575 views
Skip to first unread message

Ming Li

unread,
Aug 15, 2015, 9:07:25 AM8/15/15
to golang-nuts
Hi Gophers,

I came across React Native a couple days ago and immediately like it. You can now write native iOS UI (Android to come) with node.js, and (some of) the code can be shared across iOS/Android/Web. Internally React Native maintain a virtual UI (or DOM) structure in memory, and only apply the diff to the native UI widgets.

I have the impression that Golang's mobile strategy is to focus on non-UI logic. This was because it's very hard to abstract a common UI library that works on both iOS and Android. Now React Native gives a perfect example that it can be achieved in a clean way. I am wondering whether it's possible to implement React Native with Go so that we can write entire native iOS/Android app with Go? If using gopherjs, it could support web too?

Ming

gilles...@gmail.com

unread,
Aug 16, 2015, 12:56:07 AM8/16/15
to golang-nuts
Hi,

In Go, you can use Gowut (Go Web UI Toolkit) is a full-featured, easy to use, platform independent Web UI Toolkit written in pure Go.
It's not exactly the same, but you can write with the same code for Windows, OS X, Linux, IOS, Android, etc.
See here: https://sites.google.com/site/gowebuitoolkit/
After React Native
looks pretty good

Roberto Zanotto

unread,
Aug 16, 2015, 6:45:01 AM8/16/15
to golang-nuts
It is certainly possible to create something like React (Native) in Go, maybe with a bit more simple and concurrent API. But it's a big amount of work and the Go team at Google is busy, it's on us :)

Ming Li

unread,
Aug 16, 2015, 8:27:47 PM8/16/15
to golang-nuts, gilles...@gmail.com
React Native targets to build native iOS and Android app, not web app ...

Gowut is interesting. However frankly speaking I feel it confusing to blur the boundary between the code of client side and server side. Also, consider that only AdWords team at Google is using GWT (and they are trying to get rid of it), claiming Gowut similar to GWT will probably scare away many people :-)

Ming Li

unread,
Aug 16, 2015, 8:32:04 PM8/16/15
to golang-nuts
Indeed it's a big amount of work. Most Google's mobile apps have both iOS and Android version. So I think it will be a great return if Go can be a total solution to write native iOS and Android app. Hopefully they will bet on it!

Roberto Zanotto

unread,
Aug 16, 2015, 9:25:52 PM8/16/15
to golang-nuts
I also think that Go would benefit a lot by a good standard GUI library.
Google should kill Dart and move all its people and money to front-end with Go (just kidding here (maybe?)) :D

Golang/mobile has like 4 contributors and they have bigger problems, like porting everything to iOS.

Also designing a cross platform GUI library with a concurrent API will require a lot of thought and experiments. Go has the chance to be the first important language with a concurrent, thread-safe GUI library. It's not trivial as it might seem, take a look at this if you are interested: https://weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html

Personally I think the API should be message based like plan9's libcontrol. And it should be backed by HTML with a virtual DOM, it's like the only option to have it look and behave consistently on all different platforms, from desktop to mobile (even browser). It's not easy to conciliate a declarative interface like that of React with a message based one.

I would love to start a project like this, but my life is a mess right now...

marcit...@gmail.com

unread,
Sep 23, 2015, 1:08:07 PM9/23/15
to golang-nuts
And seems that google is using GWT in new products, like Inbox: http://gmailblog.blogspot.ru/2014/11/going-under-hood-of-inbox.html, there is a presentation about that here: https://drive.google.com/file/d/0B3ktS-w9vr8IS2ZwQkw3WVRVeXc/view

The good (or not so good) old java is a way to reduce the trade offs when the subject is multi platform development. Indeed, I would love some kind of lib/toolkit similar in golang, maybe it'll be a good experince to use gopherjs with reactnative and reactjs

Egon

unread,
Sep 24, 2015, 2:35:56 AM9/24/15
to golang-nuts, gilles...@gmail.com
On Monday, 17 August 2015 03:27:47 UTC+3, Ming Li wrote:
React Native targets to build native iOS and Android app, not web app ...

I wouldn't call "React Native" completely native -- it still uses JS under the hood.
Reply all
Reply to author
Forward
0 new messages