Cap-go / capacitor-updater

Capacitor plugin for Instant updates: Ship updates, fixes, changes, and features within minutes
https://capgo.app
Mozilla Public License 2.0
538 stars 107 forks source link

feat: rewrite in rust #432

Closed WcaleNieWolny closed 3 months ago

WcaleNieWolny commented 3 months ago

First of all, I know how radical proposal it is. However, I think that it is something that we should consider.

Currently, this plugin is composed of a lot of features that have been designed in one point of time that may or may not work currently and that may or may not integrate well with different features.

There are A LOT of things that are in a semi-working, semi-broken state that would require a breaking release to get fixed. For example

Those are just some of the example that I could think of right now. There are very likely more problems that I forgot to mention.

The biggest reason for rewriting this is the potential introduction of partial update.

Martin has told me that he wishes to implement partial update V0 without making it a breaking release and release a breaking one once capacitor V7 is released. This likely is possible; however, it's likely that by the time that capacitor v7 is released we are going to have very little time to address all of those issues. It IS possible to resolve most of them them without a rewrite but with the amount of changes required it's very likely going to take quite a while

My motivation for this rust rewrite are as follows:

Here is why rust may be a terrible idea

riderx commented 3 months ago

Why rust over c++, kotlin or others language who compile binary? Never ear about rust for mobile, but did for others so it’s not a good sign at all and will be my last choice if rewrite is decided

riderx commented 3 months ago

Please create one issue for each report you did that and link them in your original message

WcaleNieWolny commented 3 months ago

Why rust over c++, kotlin or others language who compile binary?

Kotlin native is a garbage collected language with experimental swift interop and no java interop as far as I can see (C interop is possible [but experimental] and from C we can do JNI but that is just terribly complicated). This alone should be enough to eliminate kotlin native

Both C and C++ are viable alternatives to rust but they I believe more in rust them in C or C++

Rust has:

riderx commented 3 months ago

Rewrite to another language is out of scope.

Learning from this discussion. I think we can write abstraction to separate, Capacitor stuff to Capgo stuff, and in the future make it easy to bridge, if we find a better way, mature enough, fitting Capgo philosophy.