Code Monkey home page Code Monkey logo

calc-rs's Introduction

calc-rs

calc-rs is a template project for using Rust in Python, Java, WASM and as Rest-API service.

The project is a workspace containing the following packages:

  • Rust. 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.
  • Python. The Python layer for creating the Python module.
  • Java. The Java layer for creating the Java module.
  • WASM. The Web Assembly layer for creating the WASM module.
  • REST-API. The REST-API server extension.

Recommendations

For learning Rust you should read this book. You REALLY should read this book before you start coding, because Rust is not easy to learn. Especially to understand and solve the findings of the Rust compiler can drive you crazy. But in the end, after solving all the findings you'll understand that the compiler was absolutely right and it saved you a lot of future work finding and fixing the bugs by yourself.

For testing simple code examples online, without installing Rust locally, you can use the Rust playground.

If you've issues you can't fix then it is a good idea to ask in the user forum. My experience is that you'll get useful help within a short time. When asking questions you can use the playground to paste a short (working) example, which describes your problem.

And last but not least at This Week in Rust you'll find interesting news and projects.

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.

A promising alternative is RustRover. 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, 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.

My preferred combination is Python and Rust. If the application has a UI I usually use Qt. For very simple UIs FLTK 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.

License

Licensed under either of

at your option.

calc-rs's People

Contributors

brmmm3 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.