Time to learn to use rust with python. from this guy

@mistersql

Time to learn to use rust with python.

from this guy

youtube.com/@davidhewittdev

Self-replies

Pydantic will be selling an observability tool.
---
Why python + rust? (me: python is slow, duh)
Rust apps force developer to think about `panic` s
Rust is a more secure option than c/c++ for native coding with python

Rust has novel solution for concurrency. (the borrowing/ownership thing I think)
Rust has borrowed features from modern languages like python
---
PyO3 with maturin let's you call rust from python or call python from a rust app.

Slap this on your rust function
`#[pyfunction]` and C code will be generated to compile it to an extension. (py03 makes the C, maturin compiles the C.... I think)

`import b` will import b.pyd using the ABI the same as if it were `b.py`
Cython *et al *do the same thing.
----
In 2 years, 1/2 of new packages using native code will be using Rust instead of C/C++

Rust to python cheat sheet, they are similar
---
def - fn
str - &str
int - usize
let mut - (initialization)
return - (last line in function is return)

Expect 2 to 4x speedup without trying. (me: even on string intensive code & no particular math?)