diff --git a/README.md b/README.md index 000b291..c81cc4f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/calclib/README.md b/calclib/README.md index 663eccc..144ed52 100644 --- a/calclib/README.md +++ b/calclib/README.md @@ -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 +``` diff --git a/calcserver/README.md b/calcserver/README.md index a95dd58..07c1210 100644 --- a/calcserver/README.md +++ b/calcserver/README.md @@ -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 ``` diff --git a/java/README.md b/java/README.md index 511f358..80fe1cf 100644 --- a/java/README.md +++ b/java/README.md @@ -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.