Tuesday, August 1, 2023

Python to Rust


1.Error handling - Rust vs Python

    Every programming language come up with strategies to handle recoverable and unrecoverable errors.

Most languages do not distinguish between these errors. But Rust has a type of Result<T,E>  for recoverable errors and panic! macro for unrecoverable errors.

Unrecoverable Errors with panic!
      

2.CLI arguments

3.Types 

4.functions and closure 

5.Class and struct

6.iterator and functional programming 

7.testing and test frame work

8. Visibility- pub and private 

9.async programming 

10.Concurrent programming and parallel programming 

11.File Reading and IO 

12.Network programming 

13.Serialization and deserialization 

14.Decorators and Macros in Python vs Rust

Wednesday, May 4, 2022

Rust bare metal programming

If you are a Rust enthusiast and looking for something to read and try. I would recommend https://os.phil-opp.com/minimal-rust-kernel 

The blogs explains how to build OS in rust.

You can have a start over and build OS if you missed to build it in your college days . Blog starts from OS bigbang with a compiler story telling way. A basic understanding of Rust would be a prerequisite , but the blog explains the builing steps in Rust compiler driven programming method. So it would be good learning experience in embedded Rust programming .

Friday, April 15, 2022

Type-Driven API Design in Rust by Will Crichton

I think that below video is one of the must seen video before reading any source code in Rust language. I was confused with this Trait futures::future::FutureExt when I read through some of the async programs. It is very common that people extending the traits and types in Rust. The "ext" traits were very hard to digest for me.

After seeing this video, these APIs makes more sense.



.