Is Rust a high-level language or a low-level language? Does rustlang's developme... (2024)

yingw787 on June 5, 2019 | parent | context | favorite | on: Actix-web 1.0 – A small, pragmatic, and fast web f...


Is Rust a high-level language or a low-level language? Does rustlang's development prove you don't have to choose? My impression of Rust is that it's intended to replace C/C++, and that web frameworks are high-level libraries (whereas something like an HTTP library would be low-level). I guess you could write a web framework in C/C++ but I don't know of any that are popular or widely used off the top of my head. IIRC I think golang was meant to be low-level, but the community mostly came from high-level scripting languages that saw a visible boost in performance.

Congratulations to the authors/contributors of actix-web on the 1.0 release!

Is Rust a high-level language or a low-level language? Does rustlang's developme... (1)

kaiby on June 5, 2019 | next [–]


Coming from mostly a web programming background, it certainly feels more low-level than PHP/JavaScript, but not by much, at least for web/backend work. You can still code without having to delve into low-level/unsafe coding, but that stuff is available to you if you need to squeeze more performance out of your app.

The biggest hurdles for me (I'm still learning) compared to JS is the borrow checker, lifetimes, and strings (they are handled very precisely in Rust).

The benefits are huge though. My time coding in JS feels like 50% coding & writing tests, 40% debugging my app, 10% reading documentation. The "debugging" portion can sometimes be painful when fixing race conditions. Rust on the other hand, feels like 30% reading documentation, 30% coding, 30% getting my code to compile, and the other 10% debugging/testing my app. For the most part, if your code compiles and your logic is correct, your app is guaranteed to run the way you expect it to.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (2)

holy_city on June 5, 2019 | parent | next [–]


Coming from a systems/DSP background, Rust feels at times "higher level" than C/C++ (especially w.r.t. the crates ecosystem, although I suspect a large part of that is its youth and general instability), but mostly akin to writing C-with-classes-style C++ with static analysis baked into your build script.

The "high level" stuff baked into Rust makes it great for "low level" tasks, notably imo:

- Tests (and micro benchmarks, with nightly) alongside code, without dependencies or build system hackery.

- An incredibly powerful macro system, supplanting a lot of the templated code generation I've done in C++ which is a nightmare. Not that proc macros are perfect (yet) but at least they're legible.

- If you've ever tried to do away with dynamic dispatch via templates in place of inheritance, then Rust's generics with trait bounds are an absolute godsend

- A gosh darn dependency solution (now with custom repositories on stable!) makes dependency hell is less hellish

Is Rust a high-level language or a low-level language? Does rustlang's developme... (3)

nickpsecurity on June 5, 2019 | parent | prev | next [–]


I always ask people that say this if they tried using reference counting during the times the borrow checker was too difficult. Rust supports it. There's going to be some performance hit. Most in your situation use GC'd languages, though. So, it seems like Rust with ref counting could still make for easy web development where you get Rust benefits in borrow-checked code but rest is still safe and quick to write.

That's the theory anyway. I haven't gotten any data from people trying that on real-world apps, though. There could be non-obvious problems with it.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (4)

hathawsh on June 5, 2019 | root | parent | next [–]


I suspect that it might be easy to port most code written in high level languages to Rust if you're willing to use "Rc" or "Arc" liberally. The drawback is Rc does not support cyclic garbage collection (AFAIK), so the resulting code would often have memory leaks.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (5)

pimeys on June 5, 2019 | root | parent | next [–]


It does. You just have to use an Rc/Weak Arc/Weak combination.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (6)

hathawsh on June 5, 2019 | root | parent | next [–]


Weak refs are a way to work around reference counting cycles, but cyclic garbage collection is a more complete solution and it's a core feature of nearly every high level language.

https://www.php.net/manual/en/features.gc.collecting-cycles....

It seems like people who often use Rust's Rc and Arc will long for some way to implement generic cyclic garbage collection. I don't yet see a way (other than unsafe code), but I may be missing something.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (7)

bluejekyll on June 5, 2019 | root | parent | prev | next [–]


The biggest issue, and I fall back on Rc a lot, is that often you end up needing Arc. Especially in async code, where Send is generally desirable. But it's a great way to get around annoyances with shared memory.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (8)

gnode on June 5, 2019 | prev | next [–]


I would describe Rust as, for the most part, a very high-level language, with a strong penchant for zero-cost abstractions. I think many people fall into the trap of considering a language with a static type system as low level. Conversely, Rust's generics, traits, operator-overloading, type inference, substructural typing, and type-directed meta-programming are high-level concepts.

Low-level programming is possible in Rust, as it is in many high-level languages, but it is discouraged. Use of "unsafe" is rightfully met with scepticism.

C++ is also a high level language, but does not enforce use of high-level safety abstractions by default. Web programming in C/C++ is possible, and frameworks exist to do it, but memory safety (security) concerns make it undesirable.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (9)

danielscrubs on June 7, 2019 | parent | next [–]


What keeps me from Rust is the documentation of the third party libraries. It’s exactly like Java documentation, Here’s 50 classes with functions with no context good luck and have fun! Meanwhile in Python and JS third party libraries have no choice but to provide great documentation front and center. I’m convinced that if there was some kind of tweaks for Rust to be able to tag small inline tests with comments as front page docs, the language usability would shoot through the moon.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (10)

icxa on June 5, 2019 | parent | prev | next [–]


That plus the unfortunate fact that Rust as a language has no specification, so technically speaking, all of Rust is undefined behavior. It's the only thing that holds me back from taking Rust more seriously. I'm enjoying using it on pet projects for now.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (11)

pcwalton on June 5, 2019 | root | parent | next [–]


Rust has documentation which describes how it's supposed to behave, which is a far cry from everything being undefined behavior. It also has a formal specification of a subset of the language.

It's not like the C/C++ specs are particularly precise. I think people tend to have a mental model of specs as equivalent to formal semantics, which they very much are not.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (12)

steveklabnik on June 5, 2019 | root | parent | prev | next [–]


You should check out https://news.ycombinator.com/item?id=20105996

And I think it’s a bit more subtle than you’re giving credit for.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (13)

Retra on June 7, 2019 | root | parent | prev | next [–]


That wouldn't mean that all of Rust is undefined behavior, it means the compiler is the spec, and the behavior is defined by what the compiler will do. The language having no specification only means that you can't easily determine if what the compiler does is "technically correct", but that's always secondary to the matter of whether the compiler does what you actually want.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (14)

Dowwie on June 5, 2019 | prev | next [–]


It's both high-level and low-level. It can go all the way down to bare metal. actix-web abstracts away so much complexity that it's possible to program high-level tasks and be productive, but eventually work will require Rust expertise. In my first year with Rust, I accomplished a lot by using the high-level actix-web api and learning the language as I went along. I still have a lot more to learn. For instance, I can't write low-level network Connectors required of 3rd party clients (for instance, redis). Community can only help answer so many questions. It's important to develop competencies and achieve self-sufficiency (easier said than done).

Is Rust a high-level language or a low-level language? Does rustlang's developme... (15)

derefr on June 5, 2019 | prev | next [–]


I see web frameworks like this as being useful to expose an IPC/RPC service layer into a low-level component.

If you’ve noticed that lately there are a lot more pieces of systems software built in the architecture of “a daemon plus a client executable that talks to it over a control-channel Unix domain socket, but where that same control-channel [with different auth logic] can also be exposed over the Internet” — that’s thanks mostly to people writing things in Go, and Go making that architecture easy to set up (with the simplest option being a gRPC-protocol connection, but a RESTful HTTP service layer being only a little bit more work.)

Now it’s easy to set up such a RESTful service layer for your daemon in Rust, too!

Is Rust a high-level language or a low-level language? Does rustlang's developme... (16)

untog on June 5, 2019 | prev | next [–]


In my experience it has elements of both, but stuff like managing lifetimes means that (IMO) it's more trouble than it's worth when you're creating a web backend. Any more established garbage collected language is absolutely fine. Unless it needs to, say, run in a very resource constrained environment, in which case it's a pretty interesting possibility.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (17)

james-mcelwain on June 5, 2019 | parent | next [–]


It's certainly a less mature ecosystem, but once you get over the hump of understanding lifetimes, there's nothing preventing you from using lots of owned values and clone in a way that makes it really easy to ignore annoying lifetime problems. And, the benefit being if you ever need to get more performance out of a hot part of your code, you can always optimize to get that zero copy goodness.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (18)

Matthias247 on June 5, 2019 | root | parent | next [–]


There is however a downside to the „clone everything“ approach: The performance might get worse than what it would be in an optimized GCed language that doesn’t require cloning (eg C#/Java).

At least I would only reach out for Rust at the moment for performance critical code, and then don’t leave easy optimizations on the table due to lifetimes.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (19)

james-mcelwain on June 5, 2019 | root | parent | next [–]


There are other solutions (like Rc<RefCell<T>>) that allow you to avoid cloning as well if you still don't want to deal with lifetimes.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (20)

the_duke on June 5, 2019 | parent | prev | next [–]


Lifetime issues are not really relevant in a classic web backend context, since you generally just pull data out of a DB and return it to a web request, or the other way around. You generally don't have to share you data structures.

I do agree though that the tooling is very immature compared to other ecosystems, and Rust is generally quite boilerplate heavy and slower to develop.

It can still be a good choice if you need really high performance/low resource consumption - or you are going for high correctness and robust error handling.

But for most web backends Rust won't make much sense.

(I say this as someone who even writes web frontends with Rust via wasm, where it is even less optimal - mainly due to the high compile times)

Is Rust a high-level language or a low-level language? Does rustlang's developme... (21)

bpye on June 5, 2019 | root | parent | next [–]


Do you have any examples of the sort of front end work your doing with Rust? I've been toying with an idea using Rust but I haven't started really working on it.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (22)

antisemiotic on June 5, 2019 | parent | prev | next [–]


Rust's lifetimes make it about the only language that gets shared-memory concurrency right. And I don't like the trend of pushing for message passing just because historically it was hard to do shared memory. The only thing I've found more convenient than that was software transactional memory in Haskell (monads and do notation working with it barely different than regular mutable memory), maybe by the next 10 years or so we'll get that in a mainstream language.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (23)

whateveracct on June 5, 2019 | root | parent | next [–]


To add to the STM conversation, the stm-containers libraries is insanely cool (& performing with high concurrent access!)

Is Rust a high-level language or a low-level language? Does rustlang's developme... (24)

EugeneOZ on June 5, 2019 | parent | prev | next [–]


Not any language have such smart compiler, perfect errors handling system, "cargo" crates system. Not in every language refactoring is so nice that you can do it absolutely without fear.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (25)

cyberprunes on June 9, 2019 | prev | next [–]


Good question. I've been using Rust exclusively for a few months. I came from C#/python. typical GC'd application languages.

With Rust I don't think you have to choose.

Once you "get" the borrow checker and understand the ownership model Rust becomes very productive and feels like a high level language. There's a little noise in the syntax but what you get in return is so worth it. There are quite a bit of high level features to take advantage of that "compile away" with so called zero-cost abstractions.

It's a legit low level language in the sense that you can write a legit OS. No GC, guaranteed memory safety. It's bonkers.

I believe it is blurring the lines of what it means to be high/low level.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (26)

devit on June 5, 2019 | prev [–]


It's intended to be both.

Is Rust a high-level language or a low-level language? Does rustlang's developme... (2024)

FAQs

Is Rust a high-level language or a low-level language? Does rustlang's developme...? ›

Rust is a “low-level” or system programming language. That means it can sit close to and interact directly with hardware, without the need for an abstraction layer like an operating system or web browser like web development languages including JavaScript.

Is Rust highlevel? ›

But it's a great way to get around annoyances with shared memory. I would describe Rust as, for the most part, a very high-level language, with a strong penchant for zero-cost abstractions. I think many people fall into the trap of considering a language with a static type system as low level.

Is Rust a low level language on Reddit? ›

Both Go and Rust are compiled high level languages.

Is Rust a high performance language? ›

That said, Rust is generally considered to be a fast language out of the box, and well-written optimized Rust is considered competitive with well-written optimized C, C++ and Fortran (which are the other usual culprits when people start talking about "fastest" language).

Is Rust the future of low-level programming? ›

Performance: Rust can achieve better performance than Go in some cases, especially for low-level tasks. Systems Programming: Rust is better suited for systems programming due to its fine-grained memory control.

Is Rust language mature? ›

The emergence of these frameworks underscores Rust's position as a mature language, and also helps increase the support for folks looking to use Rust in front or backend work.

What language is Rust used for? ›

Established in 2006 by the software company Mozilla, Rust is a systems programming language that is largely used for memory management, safety, and performance. Programmers have praised Rust for its emphasis on memory safety, an aspect that makes it all the more attractive to businesses that value data security.

Is Rust high or low-level? ›

Rust is a “low-level” or system programming language. That means it can sit close to and interact directly with hardware, without the need for an abstraction layer like an operating system or web browser like web development languages including JavaScript.

Does Rust outperform C++? ›

When comparing, Rust performance vs C++ is often cited as being faster because of its unique components. More often than not, their speed depends on the program being developed, the compiler, and the quality of the code. Thus, if your product written in C++ performs badly, poor code may be the culprit.

Is Rust a dying language? ›

Rust is One of the Fastest Growing Programming Languages, According to The IEEE Spectrum Development report by Tiobe Co. There are 2.8 million coders writing in Rust, and companies from Microsoft to Amazon regard it as key to their future.

Why is Rust language so hard? ›

The compiler is a very strict teacher

All things together, Rust insists that your program will be correct or it won't compile. Strict typing makes you think about the relations in your program. It checks that you don't get data races. It will tell you if you try to free some memory too soon.

Is Rust faster than Python? ›

Python, as an interpreted language, typically exhibits slower performance compared to compiled languages like Rust. This characteristic comes from Python's dynamic nature, where code is executed line by line by the interpreter, creating a higher overhead.

Will Rust replace Python? ›

Rust will not replace Python because it is faster. More Python libraries will be written in rust maybe, like polars or ruff, which is totally fine. But they will be called using Python because it is simpler and faster to code. That's why numpy is also so popular.

Why is Rust not popular? ›

Rust, by comparison, is also usually considered more difficult because the memory safety guarantees force the programmer to think more critically about (though not limited to) their code wrt variable ownership and lifetimes in order to satisfy the strictness of the rustc borrow-checker.

Does NASA use Rust programming? ›

As NASA continues to push the boundaries of exploration, Rust is finding its place in projects that demand both speed and security.

Why do people love Rust? ›

Rust is loved for its memory safety, performance, and concurrency. It enables developers to create reliable and effective apps.

What language is faster than Rust? ›

Mojo is built on the latest compiler technology in MLIR, an evolution of LLVM which Rust lowers to, and so it can be faster. It depends largely on the skill of the programmer and how far they're willing to go with optimizations.

What are the disadvantages of Rust programming language? ›

Cons of Rust

Compilation Time: Rust programs can have longer compile times compared to some other languages. Lesser Library Support: While growing, the Rust ecosystem is still smaller than those of older languages like C++ or Python.

Is Rust replacing C++? ›

jasmer on Jan 30, 2023 | parent | context | favorite | on: Swift Achieved Dynamic Linking Where Rust Couldn't... Rust will not replace C++. Everything is thrown out the window, including developer productivity in order to provide the 'zero overhead runtime guarantee' feature.

What language is closest to Rust? ›

Rust's syntax is similar to that of C and C++, although many of its features were influenced by functional programming languages such as OCaml. Hoare described Rust as targeted at "frustrated C++ developers" and emphasized features such as safety, control of memory layout, and concurrency.

Is Rust better than Java? ›

In addition, Rust code often uses less memory and runs faster than Java, which means it's better for the environment and your apps can work well on devices with limited resources or in the cloud. Java is also a sustainable language choice in many cases.

Is Rust more high-level than C? ›

To sum it up

Rust is low-level enough that if necessary, it can be optimized for maximum performance just as well as C. Higher-level abstractions, easy memory management, and abundance of available libraries tend to make Rust programs have more code, do more, and if left unchecked, can add up to bloat.

Does Rust have a high learning curve? ›

Rust does have a steep learning curve, but I'd argue that it's shallower than that of C++ (which puts shoots up in complexity as soon as you wish to include a dependency). This is especially true if you are actually intending to write production code.

Is Rust a heavy game to run? ›

Rust system requirements state that you will need at least 8 GB of RAM. If possible, make sure you have 16 GB of RAM in order to run Rust to its full potential. An Intel Core i7-3770 CPU is required at a minimum to run Rust. Whereas, an AMD Ryzen 5 1600 is recommended in order to run it.

Is Rust in high demand? ›

The demand for high-quality candidates to fill Rust jobs is intensifying, so those with Rust expertise are likely to be inundated with job opportunities over the coming years.

Top Articles
S'implanter en Chine : pièges et succès
The 3 Percent Rule
Friskies Tender And Crunchy Recall
Knoxville Tennessee White Pages
Roblox Roguelike
Week 2 Defense (DEF) Streamers, Starters & Rankings: 2024 Fantasy Tiers, Rankings
Login Page
Martha's Vineyard Ferry Schedules 2024
Myhr North Memorial
Craigslist Pet Phoenix
Ashlyn Peaks Bio
Yi Asian Chinese Union
Bank Of America Appointments Near Me
Clafi Arab
Meg 2: The Trench Showtimes Near Phoenix Theatres Laurel Park
Sinai Web Scheduler
The Weather Channel Facebook
iLuv Aud Click: Tragbarer Wi-Fi-Lautsprecher für Amazons Alexa - Portable Echo Alternative
Enterprise Car Sales Jacksonville Used Cars
2 Corinthians 6 Nlt
Adam4Adam Discount Codes
Tyler Sis University City
Georgetown 10 Day Weather
Toyota Camry Hybrid Long Term Review: A Big Luxury Sedan With Hatchback Efficiency
Glover Park Community Garden
Gas Buddy Prices Near Me Zip Code
Anotherdeadfairy
Play Tetris Mind Bender
Asteroid City Showtimes Near Violet Crown Charlottesville
1 Filmy4Wap In
Marlene2995 Pagina Azul
Sony Wf-1000Xm4 Controls
Revelry Room Seattle
Imagetrend Elite Delaware
How Do Netspend Cards Work?
Perry Inhofe Mansion
What Happened To Father Anthony Mary Ewtn
Forager How-to Get Archaeology Items - Dino Egg, Anchor, Fossil, Frozen Relic, Frozen Squid, Kapala, Lava Eel, and More!
Of An Age Showtimes Near Alamo Drafthouse Sloans Lake
Supermarkt Amsterdam - Openingstijden, Folder met alle Aanbiedingen
Skill Boss Guru
Duff Tuff
7543460065
Stanley Steemer Johnson City Tn
Jetblue 1919
Wordle Feb 27 Mashable
Value Village Silver Spring Photos
Sams Gas Price San Angelo
The Latest Books, Reports, Videos, and Audiobooks - O'Reilly Media
Black Adam Showtimes Near Kerasotes Showplace 14
Where and How to Watch Sound of Freedom | Angel Studios
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated:

Views: 6407

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.