mfikes / goby

Develop iOS apps with ClojureScript
Eclipse Public License 1.0
344 stars 17 forks source link

React Native #7

Closed artemyarulin closed 9 years ago

artemyarulin commented 9 years ago

Hi, thank you for your project,

Just wondering - React Native functionality overlaps with goby, what are your thoughts about that?

mfikes commented 9 years ago

Indeed. Goby can be summarized as a thin ClojureScript layer over the mutable iOS SDK. I've thought that, to "fix" the mutability issue would involve a lot code to render an iOS UI using pure functions driven by app state, perhaps making use of Om, or being Om-like. Given the likely size of this effort, for now, I just stuck with the simpler "thin wrapper" approach in order to get something out the door.

In the meanwhile, Facebook has been chewing on the same fundamental problem internally (see some of the older videos by Adam Ernst, describing how they rewrote the Facebook app in a functional way using Objective-C++), and ultimately they surfaced the same concepts as React Native in a way that is consistent with React (Web). (In fact, the existence of Goby being used in a shipping app was one small example the Facebook React Native team could point to proving that the "crazy" concept of a Hybrid native/JS app could indeed fly. Of course, they took it much farther.)

So, David Nolen and I have been working on the idea of essentially making Om work with React Native. The first step was putting together Ambly. And other bits to be sorted through include being able to consume React Native JavaScript modules (CommonJS), which David's been working on (see here).

In my mind, Goby is fine—it works—but the future of Om on React Native looks much much more compelling, and is in line with my initial motivations for getting into this business of writing iOS apps in ClojureScript.

If you haven't seen it yet, check out David Nolen's Clojure/West presentation from yesterday: https://youtu.be/NvF-GZI20L4 (the relevant bits for the above start at around 19:00 into the presentation).

artemyarulin commented 9 years ago

I've seen this video yesterday - and this was a reason why I decided to create this issue :)

I'm already using ClojureScript in my iOS application, but I've done it in the most easiest way - ClojureScript contains only business logic, while Objective-C responsible for UI and calling appropriate functions in ClojureScript. Ability to update part of application multiple times per day - makes me so happy :)

Looking forward to see Om and React Native together, immutability FTW, it's gonna be really awesome, I promise to test and provide you a feedback as early as possible.

Thank you!

mfikes commented 9 years ago

@artemyarulin Thanks! Also, the intent is that Ambly be generally useful (outside of the context of React Native). Previously I would use Weasel (and simple-brepl) to establish a REPL into my Goby-based iOS app and have since switched to dog-fooding Ambly. I've updated Shrimp to do the same. If you are ever interested in using Ambly to REPL into the business logic of your current application, I'd be curious if it has sufficient hooks.

artemyarulin commented 9 years ago

I have a task on my list to start running unit-test on JSCore, like it is described here ClojureScript Compiler Tests on iOS, so I'll deffinitly start using Ambly in some near feature.

Once again - thank you very much for all this information and projects. I've started using Clojure just a couple of months ago and I haven't been so much in love with programming language in my life :)