Skip to content

Main πŸ‘βš“

Logo

Python πŸπŸ€πŸ¦€Rustβš“

This is not a challenge or benchmark comparison, this a simple documentation, that might be helpful for Python Software Engineers that want to learn Rust.

Description πŸ“‘βš“

This documentation is designed for developers who know Python 🐍 (like me) to gradually understand Rust πŸ¦€ by analyzing code examples and differences and similarities in these programming languages.

Definitions in docs πŸ—ƒοΈβš“

Code inside examples will be written in 2, 3 or 4 blocks, where:

  • "Python 🐍" - full Python example (usually declared with if __name__ = "__main__:), possible to run with python -m <path.to.module>;
  • "🐍" - short Python example;
  • "Rust πŸ¦€" - full Rust example (usually declared with fn main() {}), possible to run with cargo run --bin <bin_name>;
  • "πŸ¦€" - short Rust example (example, probably not possible to compile);

Example with 4 blocks

if __name__ == "__main__":
    print("Hello Python!")
1
2
3
fn main() {
    println!("Hello Rust!");
}
print("Hello Python!")
println!("Hello Rust!");

Example with 2 blocks

if __name__ == "__main__":
    print("Hello Python!")
1
2
3
fn main() {
    println!("Hello Rust!");
}

Switch tabs

It's a possible to move tabs (when you click on one tab and it's already active).

To move it, use Left or Right.