Need feedback about developing reactive framework

Hi everyone!

This topic is not really a request for code review but request for feedback of an idea. The reason I am asking feedback from you is that most of the profiles in this forum have great experience in terms of software engineering as far as I can observe.

Here is the origin of idea. There are lots of frameworks to build cross platform applications from mobile to desktop. However, using a cross platform framework does also bring its hassles to the development. You mostly need to use abstractions provided by the framework to access native APIs. And if you want to develop an app other than a simple one, you will need at some point to interact with native API. For me, using these abstraction is not ideal for a long term project, due to any update in native one can break your whole application until framework also updates itself. Or even any update in native toolchains can break your build infrastructure until framework updates its infrastructure. These bad experiences let me think a different approach to app development.

Cross platform frameworks let you write a single project and deploy to multiple targets. Therefore, they encapsulates the native APIs. Instead of writing a single project and deploying to multiple targets, we can write one native code for each target and let them share their common parts by extracting them to a shared library written in Rust. Thus let the native codes encapsulate the framework. I know that this is not a new thing and used by many applications. What I want more from this shared library is being reactive similar to ReactiveX.

This approach divides an application into two separate parts, frontend and backend. Frontend consists of a natively implemented GUI with the responsibility of listening data from backend and putting them to screen. It also has the responsibility of interacting with native APIs and calling functions in the backend with the information received from native APIs. Whereas, backend is a platform agnostic library which performs data management like fetching data over network or disk.

An example can be:

  • User fills name input with his/her name.
  • User presses the save button on the screen
  • Frontend handles this event and calls save function in the backend with the user name and also passes two callbacks, one for successful handling of event and one for failed handling of event.
  • Backend calls appropriate callbacks upon completion of handling.
  • Frontend notifies user when one of the callback is called.

This example shows only one time event binding. Backend could have called callbacks more than once until frontend unsubscribes from the event, in another word, it could be a reactive library.

This is an overview of the framework itself. The expected features from the framework are:

  • Reactive store implementation
  • Compile time ffi checks
  • Automatic ffi code generation
  • e2e testing support from frontend implementation to backend implementation
  • stability guarantees between frontend and backend (do not break the builds even the environment changes)

The things that I want feedback about the framework are (you can also give feedback about anything other than these):

  • With your experience, can you see any blocker for this idea?
  • Would you use a framework with these features?
  • Can this framework hold its stability guarantees?
  • Is there something similar to this approach?

Before writing this topic, I was experimenting with the idea. You can see an implementation of it in this repo reax-demo. And reax-rs contains the framework itself, ( mostly empty since it is in experimental stage and reax-demo contains the implementation ). Note that the implementation is experimental ( it has lots of bad parts). Another general overview of framework can be found in reax-rs repo's readme file.

Thanks

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.