Skip to content

Commit

Permalink
Merge pull request #519 from cunarist/organize-introduction-docs
Browse files Browse the repository at this point in the history
Organize introduction docs
  • Loading branch information
temeddix authored Feb 23, 2025
2 parents daa7981 + a977342 commit 79f56b4
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 98 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ All message classes and structs are generated by Rinf. You can define the messag
- **Truly easy**: It only takes about a minute or two to fully setup your app.
- **Efficient**: All communication occurs solely through native FFI. There are no webviews, web servers, hidden threads, or unnecessary memory copying that might cause performance overhead. This setup acts as a very thin wrapper around Dart and Rust.
- **Minimal**: This is not a bulky framework that requires you to install so many dependencies and use complicated CLI commands. Just focus on your code using your preferred Flutter and Rust libraries.
- **Event-driven**: The system reacts to events like user actions, messages, or signals. This allows for advanced concurrency, task cancellation, and non-blocking business logic.
- **Scalable**: Creating hundreds or even thousands of message APIs between Dart and Rust feels smooth and clean. Additionally, you have the flexibility to utilize any number of Rust library crates, perhaps including those you might have been working on.
- **High-level interface**: No messing with sensitive build files, no concerns about memory safety. Stay with Dart and Rust that you're familiar with.
- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rinf/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized.
Expand Down
Binary file added documentation/source/_static/rinf_design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/source/_static/rust_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 0 additions & 61 deletions documentation/source/_static/rust_icon.svg

This file was deleted.

2 changes: 1 addition & 1 deletion documentation/source/_templates/icon_pair.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
}
</style>

<img src="/_static/rust_icon.svg" class="icon-box" alt="Rust Icon" />
<img src="/_static/flutter_icon.svg" class="icon-box" alt="Flutter Icon" />
<img src="/_static/rust_icon.png" class="icon-box" alt="Rust Icon" />
4 changes: 0 additions & 4 deletions documentation/source/applying-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,3 @@ If you already have a Rust crate that you want to use here, just put it inside `
Now, by heading over to `./native/hub/src/lib.rs`, you can start writing Rust!

Example code for guidance can be found [here](https://github.com/cunarist/rinf/tree/main/flutter_package/example).

```{important}
Rinf expects that the application's main logic is written in Rust, with Flutter solely serving the purpose of managing the GUI
```
45 changes: 13 additions & 32 deletions documentation/source/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

## Why Rinf?
## About Rinf

Rinf combines Flutter's UI ease with Rust's speed, enabling efficient, scalable cross-platform apps.

Expand All @@ -9,44 +9,25 @@ Rinf combines Flutter's UI ease with Rust's speed, enabling efficient, scalable
:file: _templates/icon_pair.html
```

### Flutter for Aesthetics
### Design

Flutter provides a mature and efficient ecosystem for building cross-platform graphical user interfaces. It compiles to all six major platforms and offers:
Rinf expects the application's main logic to be written in Rust, with Flutter solely managing the GUI.

- Declarative UI pattern
- Beautiful widgets
- Hot reload for rapid development
- Dedicated debugging tools
- Comprehensive UI packages
![Rinf design](_static/rinf_design.png)

### Rust for Performance
Rinf uses a two-way, stream-based message-passing mechanism instead of function calls. This decouples the business logic from the UI, ensuring a clear separation of concerns.

While Dart is excellent for UI, Rust excels in performance-critical tasks. Rust offers:
It is recommended to use the actor model on the Rust side and tree-based state management techniques such as `InheritedWidget` or `provider` in Flutter for efficient state propagation.

- 2-40x speed advantage over Dart
- Memory safety without garbage collection
- Multi-threading support
- Access to a vast ecosystem of crates
- A highly loved and robust community

### Benefits

- **Easy setup** – Setup takes only a minute or two.
- **Efficient** – Uses native FFI with no webviews, servers, or extra memory copying.
- **Minimal** – No bulky framework, just Flutter and Rust with minimal dependencies.
- **Scalable** – Easily handle hundreds or thousands of message APIs.
- **High-level interface** – No need to modify build files or worry about memory safety.
- **Well maintained** – Automated tests, low dependencies, and clear documentation.
- **Convenient debugging** – No browsers or emulators; Rust logic restarts on hot restart.
- **Reliable** – Backed by strong communities and a simple, future-proof design.
Actors in Rust should hold the state, while Flutter widgets receive only the view data needed to update the UI.

## Cross-Platform Compatibility

Rinf enables seamless development across major platforms:

- ✅ Linux
- ✅ Android
- ✅ Windows
- ✅ macOS
- ✅ iOS
- ✅ Web
- ✅ Linux: Tested and supported
- ✅ Android: Tested and supported
- ✅ Windows: Tested and supported
- ✅ macOS: Tested and supported
- ✅ iOS: Tested and supported
- ✅ Web: Tested and supported
1 change: 1 addition & 0 deletions flutter_package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ All message classes and structs are generated by Rinf. You can define the messag
- **Truly easy**: It only takes about a minute or two to fully setup your app.
- **Efficient**: All communication occurs solely through native FFI. There are no webviews, web servers, hidden threads, or unnecessary memory copying that might cause performance overhead. This setup acts as a very thin wrapper around Dart and Rust.
- **Minimal**: This is not a bulky framework that requires you to install so many dependencies and use complicated CLI commands. Just focus on your code using your preferred Flutter and Rust libraries.
- **Event-driven**: The system reacts to events like user actions, messages, or signals. This allows for advanced concurrency, task cancellation, and non-blocking business logic.
- **Scalable**: Creating hundreds or even thousands of message APIs between Dart and Rust feels smooth and clean. Additionally, you have the flexibility to utilize any number of Rust library crates, perhaps including those you might have been working on.
- **High-level interface**: No messing with sensitive build files, no concerns about memory safety. Stay with Dart and Rust that you're familiar with.
- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rinf/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized.
Expand Down
1 change: 1 addition & 0 deletions rust_crate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ All message classes and structs are generated by Rinf. You can define the messag
- **Truly easy**: It only takes about a minute or two to fully setup your app.
- **Efficient**: All communication occurs solely through native FFI. There are no webviews, web servers, hidden threads, or unnecessary memory copying that might cause performance overhead. This setup acts as a very thin wrapper around Dart and Rust.
- **Minimal**: This is not a bulky framework that requires you to install so many dependencies and use complicated CLI commands. Just focus on your code using your preferred Flutter and Rust libraries.
- **Event-driven**: The system reacts to events like user actions, messages, or signals. This allows for advanced concurrency, task cancellation, and non-blocking business logic.
- **Scalable**: Creating hundreds or even thousands of message APIs between Dart and Rust feels smooth and clean. Additionally, you have the flexibility to utilize any number of Rust library crates, perhaps including those you might have been working on.
- **High-level interface**: No messing with sensitive build files, no concerns about memory safety. Stay with Dart and Rust that you're familiar with.
- **Well maintained**: Our [automated workflows](https://github.com/cunarist/rinf/actions) including build tests are always kept passing, thanks to the main branch protection rule. Also, the number of external dependencies is kept as low as possible and documentations are thoughtfully organized.
Expand Down

0 comments on commit 79f56b4

Please sign in to comment.