In Rust We Trust

Designed and developed by Graydon Hoare at Mozilla Research, the Rust programming language arrived on the scene in 2010. The multi-paradigm programming language has become one of the most favoured languages in the last few years. 

As per O’Reilly’s annual ranking, Rust grew 94 percent over the past year. Further, the annual Stack Overflow Developer Survey has picked Rust as the ‘most loved’ language for five consecutive years now.

Advantages

Rust blends the performance of languages such as C++, adds a friendlier syntax, with a higher focus on code safety and simplifies the development process. Notably, a few portions of the Mozilla Firefox browser are written in Rust. Microsoft is also turning to it for recoding the parts of Windows operating systems. 

THE BELAMY

Sign up for your weekly dose of what's up in emerging technology.

Let’s examine what makes Rust so irresistible:

  • R, Python, Matlab are the common languages used for data analysis. However, since these languages interpret the code line-by-line, the speed factor is compromised. While C and C++ offer an advantage in this aspect, they have no ‘guide rails’. Meaning, there are no controls to stop them from inappropriately accessing memory sent back to the OS or from releasing the same piece twice. This can result in meaningless data, or in the worst case, expose security issues or cause the program to crash. Rust successfully overcomes this problem.
  • Rust has a strong memory management system. It assigns each piece of memory to a single owner and determines who can access it. It also ensures parallelized code, enabling software to run safely on multiple processors. Rust is easier to maintain and debug.
  • Unlike languages such as C, Rust has a single tool Cargo to compile, run, download libraries, auto-generate documentation, among other things. Rust works well with intricate codes when the project consists of multiple crates. It comes with a plug-in, Clippy, to catch common mistakes on the go, and further improve the code.
  • Dynamic vs static typing is a bone of contention when it comes to programming languages. It is easier to produce software with dynamic typing, as in Python, but it may also lead to unmaintainable code. Rust takes the middle path. It is a static type system that requires the programmer to specify parameters such as function arguments and constants. Inside the function body, however, inference, as observed in case of dynamic typing, is allowed.

Is It Good Enough?

Rust is good, but is it good enough to replace stalwarts such as Python? 

Rust is a relatively new entrant. Hence, the language has a significantly lesser number of libraries than Python. Lack of machine learning-specific libraries also means that a lot of codebases have to be written from scratch. For a user without a background in low-level programming, using Rust is a challenge. The community support, though vibrant, lacks in volume.

That said, Rust is a good fit to build an efficient and reliable data science backend. The language can be used in high-level libraries. Also, Rust is a better choice for low-level code optimizations and parallelization, but falls short when it comes to front-end architectural implementations. 

More Great AIM Stories

Shraddha Goled
I am a technology journalist with AIM. I write stories focused on the AI landscape in India and around the world with a special interest in analysing its long term impact on individuals and societies. Reach out to me at shraddha.goled@analyticsindiamag.com.

Our Upcoming Events

Conference, in-person (Bangalore)
Machine Learning Developers Summit (MLDS) 2023
19-20th Jan, 2023

Conference, in-person (Bangalore)
Rising 2023 | Women in Tech Conference
16-17th Mar, 2023

Conference, in-person (Bangalore)
Data Engineering Summit (DES) 2023
27-28th Apr, 2023

Conference, in-person (Bangalore)
MachineCon 2023
23rd Jun, 2023

Conference, in-person (Bangalore)
Cypher 2023
20-22nd Sep, 2023

3 Ways to Join our Community

Whatsapp group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our newsletter

Get the latest updates from AIM