6 ms·
I mean those are two separate things. Depending on how you code, Rust can be similarly high level as Python, make it much easier to design with types than C++ a
by carlmr 4y ago
I mean those are two separate things. Depending on how you code, Rust can be similarly high level as Python, make it much easier to design with types than C++ and has great package management with cargo.
You can find plenty of reasons to love Rust, without even getting to the technical details.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- Thaxll 4y ago> Rust can be similarly high level as Python Not really, once you start something more complicated than hello world and start to try mutate things for example it get 100x more complicated that Python.
- melissalobos 4y ago> start to try mutate things for example it get 100x more complicated that Python. 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.
- Thaxll 4y agoI don't see where in Rust you could have code that looks high level as in Python.
- melissalobos 4y agohttps://actix.rs/ https://actix.rs/ Look at the first example. It can be very similar.
- jay_kyburz 4y agoHaha, I think you might need to have another look at Python.
- gpm 4y agoNote 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.
- deleted 4y ago[deleted]
- code_biologist 4y agoFor 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/ https://www.starlette.io/ [2] https://fastapi.tiangolo.com/ https://fastapi.tiangolo.com/ [3] https://trio.readthedocs.io/en/stable/ https://trio.readthedocs.io/en/stable/
- gpm 4y agoThanks, I appreciate it :)
- steveklabnik 4y agoI did a random little comparison a while back https://news.ycombinator.com/item?id=22712441 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.
- ZephyrBlu 4y agoI recently ported some Python to Rust and I actually did feel like a lot of the Rust code was pretty similar to Python. Mutating things is mostly not that difficult, just add mut to the declaration and then &mut if you pass it around. The most difficult thing was lifetimes. E: borrows got a little tricky as well
- carlmr 4y agoThis is what I mean, I ported some Python code almost 1:1. If you program in a functional way anyway, i.e. having data go through a series of filters, it is quite easy. But not all ways of programming are so easy to port to Rust.
- mamcx 4y ago> Rust can be similarly high level as Python In fact, Rust is MORE high level than python and most languages. That is exactly the borrow checker and all the other things are. What is not, is being "simple" as python. I code now full Rust and is the most productive language in my +20 years of this. My other picks: python, Delphi, FoxPro. But is not productive exactly the same way python/delphi is. It has other axes of it. So in some task Python is unmatched and my main pick for scripting or brainstorming stuff. But Rust is the best at being overall productive. Where is not (today) is lack of time/resources to be there (like GUIs. But honestly, nothing compare to FoxPro/delphi)...
- girvo 4y ago> nothing compare to FoxPro/delphi Amen. Every so often I boot up Lazarus and lament what could have been. Even the best web-dev frontend tools and frameworks do not come close. I wonder if there is even a market for those sorts of tools today, though. I wasn't there for the decline of Delphi (and FoxPro, et al), so I've no real reference as to why they declined.
- mamcx 4y agoI think all the stuff about nocode/lowcode/jupyter/etc say exist the market, but is going in a overly weird route, as if nobody know what this tools can do. My dream is rebuild it: https://tablam.org https://tablam.org!
- pjmlp 4y agoQt, WPF, OutSystems,... The tools are out there, even Delphi is still being sold and having a yearly conference in Germany. They declined because only developers working at Fortune 500's get to pay for software. When one only wants to have free beer, they get to have what the street bazaars can offer, instead of what the monks are using at the cathedral.
- kaba0 4y agoNo, this low-high level axis is not really “permeable”. You can maybe get as productive in rust as in some managed language at the first time you write the program. But later maintenance will simply drop your productivity as any refactor will likely alter your whole memory/ownership model and cause much more refactor recursively. Sure, you may say that “but it will be correct in the end while in python you have to hunt down the newly created bugs” and you might be right, but it is not a small price to pay. Managed languages let you get away with many many unanswered questions that you have to meticulously answer in case of low level ones, and I think it is a fair tradeoff depending on use-case. But as much as I love Rust, I won’t choose it for some database-mangling web service.
- DeathArrow 4y ago> Rust can be similarly high level as Python What about Haskell? Can it be similarly high level as Haskell?
- dsQTbR7Y5mRHnZv 4y agoThis may be the closest thing I've personally seen: https://github.com/timvisee/advent-of-code-2021 https://github.com/timvisee/advent-of-code-2021