banner



How To Find A Rust Clan

Why Rust Is And then Popular?

image

Francesco Gadaleta HackerNoon profile picture

@ frag

Francesco Gadaleta

I exercise stuff with computers, host data science at home podcast, lawmaking in Rust and Python

If you are looking for some kind of metal panel business concern thought, permit me to be clear: the Rust I am referring to is a programming language.

However there?

When I started learning programming languages I was 8 years former, the world was in unlike shapes and computers were more like romantic and
magical boxes rather than the tools people TikTok with today.

GW-Bones and C were my first shots in informatics during the time in which retentiveness was directly attainable — for the fun of many and the turn a profit of others. It was so piece of cake to perform brutal attacks on the operating system kernel via some legit constructs that those languages provided.

My years in academia have been characterized by the massive use of C (much less of C++) for dorsum-end systems and implementing common and more than exotic algorithms in computer science. Large spring ahead, the years of my Ph.D. have been characterized past the massive use of C and instructing
compilers to mitigate some of the nasty bug all low-level programming languages are afflicted past, which is direct access to memory.

Hence, issues like forgetting that you have already freed memory (double free), reading/writing beyond the limits of an array (buffer overflow), pointing and accessing invalid memory, etc. have led to some of the most serious attacks we know in the history of computer science then far.

And so what does this take to do with Rust?

Equally a matter of fact, Rust has literally wiped off most of my Ph.D. material in one new programming prototype. And I am not pissed at all.

My most ambitious objective (and not merely mine) during my Ph.D. was to
build a compiler that fixed the double free issues, buffer overflows and invalid pointers, automatically (sometimes without even informing the developer who ended up repeating that nasty bug over and over — how
mean?).

Rust has washed just that: it has moved many of the responsibilities from the
developer to the compiler (for Python programmers, the compiler is that
affair you surrender your flexibility and functioning to, every time y'all write well… Python) past introducing a new image of programming.

In such a image it is not possible to have those bugs ever. The compiler volition just decline to continue and generate a buggy program. The only side consequence of the more pedantic Rust compiler is that it will definitely frustrate the developer. Only I don't accept a solution for that. Time for another Ph.D.?

Rust provides this level of awesomeness past leveraging 5 cardinal concepts in programming language pattern. While some are tightly related, let me briefly get through each of them.

The borrow checker

Rust'south borrow checker makes sure that references (and pointers!) do not
outlive the data they point to. All memory unsafety bugs? Gone. "Yeah but dude… I am losing flexibility" yous say?

Worry not, yous tin still use dangerous Rust. If you feel like you deserve that responsibleness (and you better know WTF you lot are doing) go ahead, make your lawmaking dangerous and unlock some super-powers. The good affair is that when you take a bug (because yous will, dude), you would know exactly where to look at. Remember that dangerous block y'all wrote and felt so proud of? Perhaps you lot wanna look in that location.

Ownership

If y'all don't want to tidy upwardly your room, someone else (mum?) volition take to.
And that volition come at a price (don't let me go there). At that place is a reason why all languages based on a garbage collector are slower than those without. Gauge what?

Ownership is a prototype of programming that allows Rust to keep track of memory (and freeing it when no longer in use) at zero toll. How? Past irresolute the way programmers are used to thinking (and believe me, the way Rust forces you to recall is the right manner). A picayune

                                  let                  y = SomeType {                  field:                  String::from("hullo") };                  let                  x = y; println!("{:?}", y);                  // This volition fail. We no longer ain y                              

moves ownership of y to ten. This ways that y cannot be used after that statement. This elementary concept allows the compiler to manage memory for you and keep your room in an impeccable country.

Concurrency

This is a big ane. Especially due to the general trend of distributing computation on multiple cores. Not but Rust makes concurrency easy
(alright relatively easy — sometimes the syntax is a b!tch). The combination of buying and locking mechanisms make concurrency fearless in Rust.

Channels enforce thread isolation and data are protected by locks and can get accessed but when locks are held. This prevents one from accidentally sharing states. Data races are never possible (the compiler will just refuse to generate code that might potentially lead to information races).

Portability

The Rust compiler is built on LLVM that in turn tin can generate machine code for a plethora of target platforms. While this level of portability is still not as big every bit C/C++, please remember that Rust is only 10 years onetime (merely a scrap older than myself when I started programming, how beautiful?)

Speed and security

If y'all want a compiler to generate safety code, be prepared to give up performance. The low-level security community is aware of how much code instrumentation techniques tin can make your software slowdown (to the point that many prefer to trade unsafe lawmaking for performant i). With Rust, you tin have both. Rust is a compiled language.

The automobile code that is generated can exist optimized (and will be optimized even more equally the compiler gets smarter) every bit much as the one coming from C/C++ and other compiled languages.

Every bit for speed, a decent Rust vs C comparison can be constitute here and a more detailed explanation hither. Just consider that comparisons should be performed betwixt idiomatic Rust and idiomatic C. Needless to say, sh!tty lawmaking = sh!tty performance, and that has zero to do with the language of choice.

Of course, this post does not give Rust justice, as at that place are many more than
amazing things Rust has to offering. While this is a language that shall definitely exist considered for system programming, the customs is growing at an incredible pace, populating crates.io, the repository for packages and libraries in pure Rust.

I've to say that at that place is a lot of duplication and many libraries seem abandoned. I believe that's a upshot of the initial enthusiasm from many developers and engineers who have been putting Rust to the test.

Despite making some of my publications — especially those almost low-level countermeasures to mitigate buffer overflows — I strongly believe Rust is the language of the futurity.

I am also contributing to a project that utilizes Rust for data processing (the stuff that people must do before copy&paste Tensorflow models :) ) and I am looking frontwards to publishing information technology soon.

In any case, follow me on GitHub.

Previously published at https://medium.com/@frag/5-reasons-why-rust-is-the-future-3e23adf0803b

Tags

# rust# programming# computer-scientific discipline# code-quality# programming-languages# concurrency# software-technology

Source: https://hackernoon.com/why-rust-is-so-popular-gk1p3ur5

Posted by: pattersonparienve.blogspot.com

0 Response to "How To Find A Rust Clan"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel