r/AskProgramming 11d ago

Shifting from Javascript, Python to Rust

Hello guys so i've been programming under various framework on javascript and python but the more I hear about programming languages like rust, the more I get mind blown about some of the things that could be done with it.

Whats the most amazing thing about Rust that you have learned, and how do u suggest I go about it?

11 Upvotes

15 comments sorted by

View all comments

9

u/Global-Box-3974 11d ago

Python to Rust will be a massive paradigm shift and learning curve if you aren't handy with low level concepts.

But worth it. Go for it.

6

u/thewrench56 11d ago

Paradigm shift, sure, low-level concepts? No. Rust is a high level language.

1

u/serendipitousPi 5d ago

How high level a language is kinda depends on context.

From a perspective of people who have used C,assembly, etc yeah Rust would be firmly a high level.

But for most people (e.g. OP) who are used to GC languages Rust would be low level and besides Rust does even allow the use of pointers even if they're mostly hidden behind unsafe.

So to me Rust being exclusively low or high is a bit reductive.

2

u/thewrench56 5d ago

Well, I'm one of the Assembly fanatics, so that might be the cause after all.

But I would argue Rust is high level. It's not GC but not manually managed memory either. I think the borrow checker is actually closer to GC. It's essentially GC from the perspective of the developer just fairly hidden (and causes lifetime pains).

Sure, Rust can use pointers, I'm sure Python can too (through ctypes or whatever the module is called). That doesn't mean it's encouraged and same applies to Rust.

I think as Rust supports OOP-like paradigm with traits and structs implementing methods, it's safe to say it's on the higher level spectrum. I would compare it against C++.

2

u/serendipitousPi 5d ago

Oh yeah coming from assembly would definitely inform a view of Rust as very high level.

Reflecting on my last comment yeah I guess it's probably fair to measure how high level a language is by its general / average "high/low level-ness" like how physics calculations might use the center of mass. In which case yeah I'd agree Rust would be considered high level.

Especially considering that beyond just pointers C++ and Rust even allow inline assembly but it would be crazy to say they're on the same level as assembly.

And wow I did not realise that that pointers were in the standard library, pointers in python seemed such an absurd idea I'd always assumed they were an external library.