Closed WcaleNieWolny closed 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
Please create one issue for each report you did that and link them in your original message
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:
Excellent tooling
cmake
to support this setup. Trust me on this one, make, setting up gcc for cross-compiling is HELL. I would not wish it on my worst enemy to have to set this upExcellent repository of libraries - crates.io
Memory safety
core
library would be fully safe. The bridge would be the only place where unsafe
is used and it would be managed by a library.The language itself
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.
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
capacitor.config.ts
into an executable making it much harder to retrieve. With further built time obfuscation it greatly increases the difficulty of getting the AES keybundleExists
,getBundleInfo
, methodUserDefaults
/SharedPreferences
does not include aversion
field making it impossible to add/remove fields fromBundleInfo
without breaking compatibility.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:
We are going to need a breaking release in one point or another
I propose that we:
How I plan to structure this rewrite:
rust-swift
in order to communicate with the rust library)android-plugin (An Android plugin that uses
rust-java
in order to communicate with the rust library)Here is why rust may be a terrible idea