Re:Bugs that the Rust compiler catches for you
by Thaxll on Thursday May 05, 2022 @07:20PM
(#31279432)
I don't see where in Rust you could have code that looks high level as in Python.
Re:Bugs that the Rust compiler catches for you
by steveklabnik on Thursday May 05, 2022 @07:54PM
(#31279588)
I did a random little comparison a while back https://news.ycombinator.com/item?id=22712441
One tiny program does not a realistic comparison make, of course. There’s tons of situations where either language can make things more complex than this example. But for basic tasks it’s not particularly complicated.
Re:Bugs that the Rust compiler catches for you
by melissalobos on Thursday May 05, 2022 @07:22PM
(#31279448)
https://actix.rs/
Look at the first example. It can be very similar.
Re:Bugs that the Rust compiler catches for you
by jay_kyburz on Thursday May 05, 2022 @07:39PM
(#31279523)
Haha, I think you might need to have another look at Python.
Note that their example is something like making a hello world web server using twisted (or whatever the current async framework is) in python...
Strange example, but I suppose making the corresponding python more complex is one way to make them equivalent.
Re:Bugs that the Rust compiler catches for you
by code_biologist on Thursday May 05, 2022 @08:54PM
(#31279973)
For reference I'd say the "current async framework" is either Starlette [1] (low level) or FastAPI [2] (high level) for web stuff, and trio [3] for more stupidproof general async than twisted. IMHO of course!
[1] https://www.starlette.io/ [2] https://fastapi.tiangolo.com/ [3] https://trio.readthedocs.io/en/stable/
I don't know about 100x, using Box and mutexes it is pretty much as complicated or maybe 2x. If you want it to be efficient and leverage all of Rust then sure, but that wasn't what they were meaning.