How variables are saved in Python and Rust. Side by Side 1: float

Series article to show how variables work in Python and Rust. Give us a better understanding of both languages. This is 1st article about float.

Marshal SHI
Geek Culture

--

Image by Author

Background

I have been a Python programmer around 10 years ago and started learning and using Rust a while ago. When learning Rust, the 1st thing which we are thinking about is how the data is saved in memory. When using Python, mostly we didn’t really care how the data works at the low level, we are more focused on implementing. But still, we are curious how data are saved in Python such that it could be dynamic.

In this series of articles, I will show how variables work in Python and Rust side by side such that we could have a better understanding of both. I will keep each article short as a bathroom reading article.

In addition, I am not comparing which language is better. They all have their pros and cons. Also, please comment if there is anything that my understanding is wrong.

Environment

Python: version 3.9.7

Rust: 1.56.1

OS: 64bits Linux 5.12.19–1-MANJARO

--

--

Marshal SHI
Geek Culture

Robots make our life easier | Robotics, Reinforcement Learning, Web, Python, Rust & Life Hacking. At MotivEdge.io