Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
brmmm3 committed Apr 22, 2024
1 parent cbc9752 commit b7d57f0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,39 @@

The project is a workspace containing the following packages:

- [Rust](calclib/README.md). This is the main package containing all the logic. It is intended to be used in other Rust projects without any dependency to `pyo3` and `jni`.
- [Rust](calclib/README.md). This is the main package containing all the logic. It is intended to be used in other Rust projects without any dependency to [pyo3](https://github.com/pyo3/pyo3) and [jni](https://github.com/jni-rs/jni-rs).
- [Python](pycalclib/README.md). The Python layer for creating the Python module.
- [Java](java/README.md). The Java layer for creating the Java module.
- [WASM](wasmcalc/README.md). The Web Assembly layer for creating the WASM module.
- [REST-API](calcserver/README.md). The REST-API server extension.

## Recommendations

### IDE

For programming Rust the best IDE is VS Code with the following plugins:

- Rust Extension Pack
- rust-analyzer
- crates
- Even Better TOML
- Prettier - Code formatter (Rust)
- Microsoft C++ on Windows
- CodeLLDB on maxOS / Linux
- Python, if you plan to develop Python extensions.

A short guide can be found [here](https://code.visualstudio.com/docs/languages/rust).

A promising alternative is [RustRover](https://www.jetbrains.com/rust). A feature rich Rust IDE from JetBrains. Currently preview releases are available. If you plan to develop Python extensions then you should install the Python plugin.

## Code quality

To improve the code quality I use [clippy](https://doc.rust-lang.org/stable/clippy/usage.html), which is a very powerful linter.

## Conclusion

Rust is a very versatile power horse. It is easy to use Rust in most used programming languages. For web applications Rust can be used on the server side with REST-API and on the client side with the [wasm-pack](https://github.com/rustwasm/wasm-pack).

My preferred combination is Python and Rust. If the application has a UI I usually use Qt. For very simple UIs [FLTK](https://fltk-rs.github.io/fltk-rs) is preferred for smaller executables and easier license handling.
My preferred combination is Python and Rust. If the application has a UI I usually use Qt. For very simple UIs [FLTK](https://fltk-rs.github.io/fltk-rs) is preferred for smaller executables and easier license handling. In Rust I implement the performance and security critical parts. The rest in Python for reduced development costs.

If speed and / or security matters I would really recommend using Rust. The power features of Rust helps you reducing bugs and follow up costs.
30 changes: 30 additions & 0 deletions calclib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,36 @@
This is the pure Rust library without any `pyo3` or `jni` dependencies.
This package contains all the logic and is intended to be used in other Rust projects.

Build the library in debug mode with

```sh
cargo build
```

and in release mode with

```sh
cargo build --release
```

Run tests with

```sh
cargo test
```

Run the example with

```sh
cargo run --example calculator -- +1.5 -0.9
```

## Benchmarks

The example `calc.rs` in `benches` shows how to implement benchmarking with [criterion](https://docs.rs/criterion/latest/criterion).

Run the benchmarks with the following command

```sh
cargo bench
```
4 changes: 2 additions & 2 deletions calcserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ The example [calcclient.py](https://github.com/brmmm3/calc-rs/blob/master/calcse

To run the server in `debug` mode just call

```rust
```sh
cargo run --bin calcserver
```

To run the server in `release` mode just call

```rust
```sh
cargo run --release --bin calcserver
```
7 changes: 7 additions & 0 deletions java/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# `javacalclib`

This is the Java layer for [calclib](https://github.com/brmmm3/calc-rs/tree/master/calclib). This package is for creating a Java extensions class using [jni](https://github.com/jni-rs/jni-rs).

Follow the guide to create a Java extension [here](https://docs.rs/jni/latest/jni).

Please notice the **naming convention**, which is very important here.

Run `make` to compile the Java extension.

0 comments on commit b7d57f0

Please sign in to comment.