Comment by rubenvanwyk

Comment by rubenvanwyk 10 hours ago

5 replies

Interesting how much cross-pollination is happening in the Python ecosystem with Rust.

I think the NiceGUI example is good but quite advanced, might be beneficial to contact the teams from Reflex or FastHTML, because if you could use PyTauri to create potential local apps with those popular frameworks, it could be a big win for them and that can help with marketing around the project.

wongarsu 7 hours ago

Rust and Python have very compatible ideas on a lot of topics. For example both think that a developer writing normal code should not have to worry about null pointers or be able to cause a use-after-free. It's just that Python achieves that with runtime costs and Rust with compile-time costs and a complex type system. So developers of one liking the other makes a lot of sense to me. And pyo3 is an extremely convinient way to call between the two languages

  • cardanome 5 hours ago

    > For example both think that a developer writing normal code should not have to worry about null pointers or be able to cause a use-after-free

    Like 99% of all languages currently in use.

    These things have long been solved way before Rust even existed. Rust has only filled the small niche of cases where you can't or don't want to use automatic garbage collection.

    > complex type system

    Python's type system is orders of magnitude more complex. Dynamic type systems are crazy powerful, this is why Typescript is such an complex beast.

    Rust has static type checking, which is what you mean. Which also means that Rust is limited to the types that are can be expressed and are decidable with that system, while Python allows you to do... whatever and types are only checked at runtime or with external tooling.

    Python's type system is easier to use but more complex. Rust's is simpler but harder to use. I know people forget the difference between complex and hard but it is an important one.

    A better reason Python is Rust are seen together is that Python is an excellent glue language. Same reason people like C and Python. Plus both Rust and Python are pretty trendy these days.

    • wongarsu 4 hours ago

      > Like 99% of all languages currently in use.

      Yes, but 90% of languages don't make a good complement to python. If you want to have a language to use in combination with python you want something with fast c-interop, which most garbage collected languages can't offer

      > Rust has static type checking, which is what you mean

      Maybe I shouldn't have used the word complex. But I did primarily mean that Rust uses the type system to ensure "safety", while Python primarily uses other methods. Yes, Rust doing static type checking is also an important component of it.

      > A better reason Python is Rust are seen together is that Python is an excellent glue language

      That would qualify any language as fitting well to Python. Which I don't agree with. C fits well to Python because it is a good complement: Python is slow to execute and easy to write, C is fast to execute and hard to write, and communication between the two is fast. Rust fits even better to Python because it's easier to write than C (well, easier to write correctly) and because interop is fast and convinient