{"id":8487,"date":"2020-12-16T13:45:47","date_gmt":"2020-12-16T11:45:47","guid":{"rendered":"https:\/\/atostek.com\/?p=8487"},"modified":"2022-09-05T14:48:43","modified_gmt":"2022-09-05T11:48:43","slug":"programming-with-rust","status":"publish","type":"post","link":"https:\/\/atostek.com\/en\/programming-with-rust\/","title":{"rendered":"Programming with Rust"},"content":{"rendered":"

Rust is a young programming language; not brand-new, but not old or rusty by any means.<\/strong><\/p>\n

Rust was first introduced at Mozilla in the 2010s, and it proved its worth at the core of Firefox. The parts written in Rust made the browser fast. The programming language was useful in implementing parallel layout algorithms and utilizing graphics cards.<\/p>\n

Using Rust also made the browser more stable and secure. In one of the Mozilla Hacks articles, Diane Hosfelt says that she went through all of the security bugs in Firefox\u2019s style component since its publication in 2002 \u2014 and found a total of 69 of them. She writes that 51 of these bugs would not have been possible if the component had been written in Rust from the start<\/a>.<\/p>\n

Rust makes programmers feel confident that it is difficult, almost impossible, to make the errors typical of other languages. It is usually difficult to avoid memory management errors in programming, and C++, for example, gives far too many chances for you to make mistakes.<\/p>\n

What does Rust offer?<\/h2>\n

Every year since 2016, Rust has been voted the most beloved programming language<\/a> in the Stack Overflow Developer Survey.<\/p>\n

Rust appeals to developers by offering something familiar. The familiar rhythm of parentheses and braces make many C and C++ users feel safe.<\/p>\n

For me, the most unpleasant thing about Rust is particularly the flood of parentheses and braces and the unnecessarily long format. Since there was a chance to create a programming language from scratch, they could have copied the minimal syntax along with the other good features they got from Haskell. After all, Haskell successfully makes room for the relevant things while leaving out the superfluous \u201cnoise\u201d.<\/p>\n

Once I manage to get over the external issues, I admire the better aspects of the language.\u00a0The best thing about Rust is that it focuses on speed, safety, and parallelism.\u00a0<\/strong>Just the kind of things that matter when I want to build mobile robots.<\/p>\n

Rust offers sturdy static typing and clear semantics. Rust takes a strong stance against undefined behavior: it is not allowed. In C++, undefined behavior is always lurking in the shadows, from where it may emerge at a bad moment. This makes programmers live in a state of constant low-level anxiety.<\/p>\n

Regarding parallelism, Rust is precise yet careful. The compiler checks that the code is not accidentally interfering with a memory that belongs to a different thread and that no other similar, minor mistakes are made. This automatically reduces the possibility of parallelism errors that are difficult to discover.<\/p>\n

Speed was not compromised when developing Rust\u2019s admirable features. Instead, coders sometimes have to wrestle with the compiler to get their way, and, in the end, one of them always gives up. It is worth remembering that the compiler is a strictler for a reason. It wants to make sure that the product does not contain errors that even a machine could have avoided.<\/p>\n

Rust is becoming more and more popular. It is equally liked by enthusiasts, scientists, system developers and game coders. Some have already declared that they will no longer be coding in C++.<\/p>\n

In November, as Mozilla Foundation reallocated its resources, Rust\u2019s maintenance was transferred to Linux Foundation. I believe that Rust will find a good home there, and I\u2019ll continue following the development of the language with interest.<\/p>\n

Read more:<\/strong>
\n\u00bb
RustDDS \u2013 Data Distribution Service implemented in Rust<\/a><\/p>\n


\n
\n
\n

Harri J\u00e4rvi<\/strong>
\nSoftware architect\u00a0<\/em><\/p>\n

 <\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

Rust is a young programming language; not brand-new, but not old or rusty by any means. Rust was first introduced at Mozilla in the 2010s, and it proved its worth at the core of Firefox. The parts written in Rust made the browser fast. The programming language was useful in implementing parallel layout algorithms and…<\/p>\n","protected":false},"author":4,"featured_media":8284,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false},"categories":[114],"tags":[252,253],"_links":{"self":[{"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/posts\/8487"}],"collection":[{"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/comments?post=8487"}],"version-history":[{"count":1,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/posts\/8487\/revisions"}],"predecessor-version":[{"id":11742,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/posts\/8487\/revisions\/11742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/media\/8284"}],"wp:attachment":[{"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/media?parent=8487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/categories?post=8487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atostek.com\/en\/wp-json\/wp\/v2\/tags?post=8487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}