Rust – a concise overview of the modern programming language coders love

Learn what kind of language Rust is, what it is used for, alternatives and commercial considerations when choosing Rust development, the market for Rust expertise and advice on learning it.

Blockchain & Web3 developmentUPDATED ON April 24, 2024

John Adam K&C head of marketing

Author

Hero image for a blog providing a concise overview of the Rust coding language

Rust was released in 2010 as an open-source systems-level language designed by then-Mozilla engineer Graydon Hoare. Initially a side project, Hoare motivation was to develop a new language as the antidote to the memory management and allocation problems of C and C++.

He did and Rust was born. Hoare’s initial work saw the new language sponsored by Mozilla in 2009, released as an open-source project a year later and declared “stable and mature” in 2015 – when Rust 1.0 was released.

It has since become popular with developers (as of 2023, over 12% use the language), technical decision-makers and businesses including Microsoft, Alphabet and Dropbox

Rust is most used in the coding of:

  • Performance-critical backend systems
  • The development of operating systems, OS-adjacent code and other low-level components (eg. Android and Google Chrome)
  • Server-side web development
  • Blockchain infrastructure and smart contract coding
  • CLI tools
  • Embedded systems and IoT development

 

Infographic showing common areas of use of the Rust programming languages

 

At K&C, we’ve had teams work on a handful of projects that included Rust in their tech stacks or used it as a core programming language. But we’ve seen a major uptick in demand for the language over the past year or two – especially in the blockchain and dApp development space.

Developers themselves love Rust and have voted it the “most admired” programming language in common use 8 years running.

And the evolution of the software development sector is fuelling demand for developers with experience in the language.

The rise of IoT devices, the development of which involves much more lower-level programming, its utility in other trends such as blockchain technology are all fuelling a rise in demand for Rust developers. As its greater stability and security compared to older system programming languages like C and C++.

This blog will give you a concise overview of the Rust programming language. I’ll look at:

  • What kind of coding language is Rust?
  • What is it used for?
  • Technical and commercial considerations when choosing Rust in your tech stack
  • The market for Rust developers
  • Learning Rust
  • The Future for Rust – expected trends

 

What kind of coding language is Rust?

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.

Systems programming languages like Rust, other examples include C, C++, Go and Assembly, are typically used to code low-level system components like the operating systems and browsers higher level programming languages like JavaScript run on, device drivers, system utilities, game and VR simulation engines and IoT devices.

System languages offer close-to-hardware level access, enabling developers to control hardware resources to more precisely execute performance-critical tasks.

 

Infographic showing different programming languages classified from low to very high level

 

Considered the most contemporary low-level language in mainstream commercial use (Rust was created in the internet age), the first stable version of the language was released in 2015- the language was created as a solution to the limitations of older alternatives like C and C++.

As the software systems that are integrated with hardware have grown in complexity, the more the limitations of existing low-level languages had  been exposed – particularly with regard to memory management.

The Rust eureka moment occurred when the language’s creator Hoare returned home to his Vancouver apartment after a day working in the offices of open-source software giant Mozilla. The then-29-year-old was frustrated to find the building’s elevator out of action again because its software had crashed – again.

As a software engineer, he could make a strong educated guess that the frequency of the elevator’s software system crashing was down to the memory bugs often introduced by the languages used to code system-level programs – usually C or C++.

He started a side project to create a new language that would represent all of the advantages of compactness and speed embodied by ageing system languages – without the memory bugs.

Read our in-depth comparison guide to learn more about the differences between Rust and other programming languages like C, C++, or Go.

 

Why is Rust’s compile-time approach to memory allocation important to security?

The tech giants Microsoft and Google both attribute as much as 70% of all serious security vulnerabilities in their respective Windows and Chrome projects to memory problems.

Rust overcomes this by representing memory-safe code without the performance drag of runtime garbage collection or putting the onus on the developer to erase redundant objects using up memory. The latter introduces human fallibility and the kind of bugs that lead to software crashes and security vulnerabilities.

 

“In C or C++ you always have this fear that your code will just randomly explode”Mara Bos, cofounder of Fusion Engineering and head of Rust’s library team.

 

Newer languages like Java, JavaScript, and Python get around this by using components called “garbage collectors” to automate the periodic cleaning up of memory allocation as software is running. That solves the memory allocation issue but at the cost of precise control and performance, due to the processing time required for garbage collection.

Rust was Hoare’s attempt to combine the best of both worlds into one new programming language. It automates memory allocation, removing the risk of memory bugs, but still offers a high level of control like C and C++  – with the compactness and speed of traditional system-level languages.

The existence of a garbage collection component did, however, initially compromise Rust’s speed. However, by 2013, the Mozilla team assigned to accelerate the development of the newly open-source Rust project were able to remove it.

 

Rust as a ‘strongly typed’ language

A big part of why Rust’s core was able to be developed in a way that removed the need for garbage collection is that it became a very strongly typed language.

Strongly typed languages enforce restrictions on the mixing of different data types and values. This forces developers to learn and comply with strict rules on how they write code in Rust – but removes most of the space for error.

Rust’s open-source community and the Mozilla team working on the language introduced an  “ownership” system for how the language manages memory. It means any single piece of data can only be referred to by one variable –preventing different threads of code running in parallel from trying to modify the same piece of memory at nearly the same time.

These ownership rules are enforced by a compiler that refuses to compile code into a runnable program if data typing rules are not complied with.

 

“Rust imposes discipline on a developer” – Tim Reznichenko, Team & Tech Lead, Senior Full Stack TypeScript Engineer & Web3 developer with K&C.

These strict data typing rules mean software developers using Rust can’t make the kind of mistakes that would introduce memory bugs. If any are present, the code simply won’t compile. That meant the garbage collection component could be disposed of, with only traces like the reference countingsystem remaining – allowing Rust to run even faster.

Rust was now able to get as close to the hardware as C and C++ – offering the same level of performance but without the memory bugs.

The result has been the language’s booming popularity with software developers and project sponsors.

 

What is Rust used for?

“Companies from Microsoft to Amazon regard it (Rust) as key to their future. The chat platform Discord used Rust to speed up its system, Dropbox uses it to sync files to your computer, and Cloudflare uses it to process more than 20% of all internet traffic….Even the US government is avidly promoting software in Rust as a way to make its processes more secure.”Clive Thompson, MIT Technology Review.

Low-level languages like Rust are used to write the code machines that don’t have an operating system like Windows or Linux run on. That includes everything from dialysis machines to cash registers and…elevators.

System languages are also used for software that needs to communicate with hardware, like operating systems. The kernels of Windows, Linux, and MacOS were all historically written in C – though migration to Rust is now a major trend for the biggest tech companies.

Mozilla was, unsurprisingly, the first big software company to make extensive use of the new low-level language conceived of by one of its engineers and further developed by a Mozilla team. Hoare himself stepped back from the project he had initiated in 2013, confident the Mozilla team and quickly growing open-source community that had formed around Rust would take it forward.

Mozilla saw Rust’s potential to help them improve the open-source company’s browser engine. Browsers are famously complex software systems that introduce multiple opportunities for the introduction of memory bugs.

In 2016, Mozilla released Servo, a new browser engine coded with Rust. In 2017, the part of Firefox that rendered CSS was migrated to Rust, giving the browser a significant performance boost.

 

  • Meta has used Rust to redesign software used by its engineers to manage their internal source code.
  • Dropbox used Rust to develop a new version of the software that’s synchronises files between users’ devices and the company’s cloud storage.
  • Discord engineers rewrote chunks of the app’s code in Rust, migrating from Go (which uses a garbage collection component) and achieved x10 the speed as a reward.
  • AWS created a Rust team in 2022 to write safer, faster code for its cloud computing platform and tooling. An AWS research group found code written in Rust used x2 less electricity than if written in Java. That would double the capacity of data centres or allow them to be built in urban locations.

 

Rust isn’t just used by tech giants. It’s becoming a key part of the tech stack for IoT devices, including modern vehicles and in the aerospace sector.

In our blog post on Rust use cases, you can find out more about the diverse applications of the programming language in areas like web development, game development, networking etc. and which major companies make use of it.

 

Rust for blockchain development

The language is also popular in blockchain development and used to program smart contracts and blockchains themselves, including Solana, Polkadot and Hyperledger Fabric – a private enterprise blockchain developed by a consortium led by the Linux Foundation. In total, over 50 blockchains and blockchain frameworks are built with or support Rust.

 

Rust is popular with developers

Rust may not be among the most used programming languages, with just over 12% of developers working with it. But it is the most “admired” of all the languages covered by the Stack Overflow Developer Survey 2023, a title now held for 8 years.

The category is based on the percentage of developers using a language that wish to continue coding with it. 80% of developers using Rust want to continue to do so.

Its popularity is also mushrooming. SlashData’s State of the Developer Nation report indicates there were around 2.8 million Rust developers in 2023. That number has nearly tripled in the past two years.

 

12% of software developers actively use Rust

 

Chart showing programming language by order of popularity based on the % of software developers that use them

 

GitHub’s Top Programming Languages 2022 report puts Rust as the programming language to see the most growth in usage last year – up 50.5%. That reflects our experience of increasing enquiries for Rust development and staffing services.

Github also ranks Rust as the second fastest growing programming language between 2021 and 2022, with a 50.5% increase in its use.

 

Table showing programming languages by % growth in usage between 2021 and 2022

Source: GitHub

 

Not everybody loves Rust

While this article has turned into a bit of a Rust ‘love in’ and our Rust developers at K&C love using the language, it is important to add some balance – not everybody loves Rust.

The language’s strict rules can be hard for even experienced developers to learn and adjust to, causing frustration. It’s not the gentlest learning curve.

One experienced developer shared his frustrations with Rust on Reddit, with:

“I’ve been programming for well over thirty years. I’m quite good at it (usually). I have been told by many coworkers and managers that I’m super fast. Well, not in Rust!”

“Now, here I am, forced to use Rust for a project at work. It is beyond painful.”

“All in all, Rust is a nightmare. It is overly verbose, convoluted, hard to read, slow to compile, and lifetimes really are a cruel joke. Googling for what I need rarely results in good answers.”

 

“I am truly convinced that all the people who claim Rust is great are either lying to themselves or others, or it is just a hobby for them. It shouldn’t be this hard to learn a language. Rust feels like a MAJOR step back from Java.”

I’ve skipped the details of the technical issues the contributor was struggling with – for more details follow the link to the thread above. There’s also an impressive community effort to help the contributor get to grips with what they are struggling with – despite their fairly aggressively critical language.

The issues experienced appear to boil down to how strongly opinionated Rust is compared to other languages the developer has worked with – C and Java.

One reply sums it up:

“You’re trying to write code in a way that is fundamentally different from the way Rust wants you to, that’s the crux of it. Start smaller, learn what it wants from you….”

Developers who are unwilling to appreciate the need to adapt the approach to coding they have become accustomed to when using other languages may push back against Rust’s strict rules.

This satirical video  “10 reasons not to use Rust” from the fasterthanlime YouTube channel is entertaining, if a little biased:

 

Rust development costs and Rust developer salaries

Rust developers may not command the highest salaries in the industry but they are towards the top of the scale with an average annual salary of $87,102. That figure rises to $105,000 in the USA but is closer to $55,000 in IT outsourcing markets like Ukraine.

 

Chart showing programming languages including Rust ranked by average developer salary

 

By comparison, the average annual salary for a JavaScript developer is $74,034 and Java developers earn $72,701.

The relatively high salaries of Rust developers reflect both current demand for the language and the fact that the strict rules that govern its strongly typed nature make it a challenge to learn.

Rust developer salaries have remained stable over the past year with the medium average almost exactly the same in 2023 as it was in 2022.

 

Chart showing variation in average median annual salary of Rust developers between 2022 and 2023

Source: StackOverflow Developer Survey 2023

 

For a full break down and analysis of Rust developer salaries and rates across a range of international geographies from high wage economies to nearshore and offshore IT outsourcing tech talent markets – International Rust developer salary and rates ranges

Higher costs for tech talent proficient in Rust, eg., compared to Java and Python, may mean a higher monthly bill for payroll or IT outsourcing at the superficial level. However, if it is “more expensive” to develop in Rust compared to alternatives is a far more complex equation than that.

 

  • Developing in Rust can mean investing significantly less in testing and QA because the code is so intrinsically secure and bug-free.
  • Rust’s ecosystem of libraries, tooling and its community is already far richer than that of C++, all of which speeds up the development process and helps lead to better software performance – it’s already been mentioned that AWS research discovered that data centres running on Rust code would use half the electricity of others that are Java-powered – a saving worth huge sums, especially when compounded over time.
  • More performant software either saves or makes more money – if Rust achieves that, slightly higher dev team salaries during the initial development lifecycle will represent a drop in the ocean.

 

If developing in Rust will cost more or less than choosing an alternative will be very much down to the context of the software to be coded and what it will be used for. But Rust’s strengths mean developer salaries should, in most cases, probably not be what the language’s commercial viability is judged on.

 

Learning Rust – how hard is it, can or should junior developers start with Rust as their first coding language and educational resources

“Rust is infamous for having one of the steepest initial difficulty curves. However, the thing about steep curves is, they get you higher faster. The curve also flattens a lot and says pretty flat all the way into expert level. This is in contrast to most other languages, which get more and more difficult as your expertise grows.”kohugali, Reddit contributor.

 

Rust is generally considered to be a hard language than most for developers to master because of its difficult syntax and steep learning curve. Low level languages are notoriously difficult and Rust’s strict rules and different approach to handling certain problems make getting to grips with it even harder.

Most books on Rust presume prior coding experience and are shorter than the weighty tomes covering languages like Java, C and CC++.

That is also a result of Rust’s holistic nature.

While books on other languages usually cover details of how particular elements like template variables, template type aliases, inheritance, virtual inheritance etc. work, Rust equivalents typically take a different approach – for example, explaining how traits work and then put the responsibility on the developer to think of everything else in terms of traits and extrapolate the approach from there.

 

As another Reddit contributor reflects:

“The end result: after these 4-5 or maybe 10 hours long course you are left with good understanding of basics… but without the ability to effectively use them!”

“Because yes, you have learned all the parts of the language but to use them you need to connect these in a certain way… but that’s not considered part of “learning Rust”!”

Kohugali adds:

“There is no comprehensive Rust document that covers EVERYTHING.”

“This mirrors how Rust’s ecosystem is structured. Rust was designed in the age of the internet – it has a thin standard library complemented by powerful package manager and build system and rich centralized registry of packages. The responsibility of comprehensive education and documentation in a particular domain usually falls on the package maintainers in that domain.”

“Giant everything-and-the-kitchen-sink standard libraries and thick comprehensive books are largely a thing of the past. In 2023 you google what you need to know, and follow the hyperlinks to learn more.”

 

Rust learning tip – rewrite existing code you’ve written in other low-level languages

One often cited piece of advice to those learning Rust is for the developer to rewrite code they have previously written in other low-level languages like Python, Java, C, C++ or Go.

It will first demonstrate how effective Rust can be at increasing the speed of a piece of software. Secondly, because the developer has already figured out the logical path to accomplishing the goal, they can focus exclusively on how to translate the existing work into Rust.

 

How long does it take to learn Rust if I have already mastered other programming languages?

There’s no straightforward answer to the question because it will vary from individual to individual and be influenced by what other languages have already been learned and to what depth.

However, a very rough rule of thumb is that 3-6 months of learning and coding in Rust would usually be expected to be enough for an already experienced developer to reach a solid intermediate level and be able to work on commercial projects.

 

Is Rust a good first coding language to learn?

Should a complete beginner to software development tackle Rust as their first language? It’s a question that has provoked debate on forums such as Rust’s own user forum and Reddit.

There is, of course, no black and white answer and varying opinions. The consensus is that going straight to learning Rust would be a significant challenge but also not an impossible one – though starting with Python could be seen as a sensible intermediate step.

One downside to starting a development career with Rust is that it may be more difficult to secure an initial position as a junior developer compared to opportunities for languages like Python and JavaScript.

That’s partly because there are simply more projects that use JS and Python and partly because Rust is most often used for particularly critical and often complex pieces of software – which is where it shines. Teams that work on that kind of project are often entirely made up of senior developers.

One plus to learning Rust as a junior developer is that while it might be more of a challenge than some languages, it is also much harder to make mistakes when you start working on real projects – the compiler won’t let you.

 

Educational resources for learning Rust

Jon Gjengset

Book – Rust for Rustaceans

YouTube tutorials

 

Amos Wenger

YouTube channel on Rust programming fasterthanlime – videos on Rust programming that don’t presume prior knowledge

Long form blog articles on Rust development topics, some technical, some conceptual – https://fasterthanli.me/

 

No Boilerplate

YouTube channel on Rust – No Boilerplate

 

GitHub Copilot

GitHub Copilot, an AI-powered pair programmer, can aid learning and refining the basics of Rust as you go with tailored code suggestions, reducing the time spent searching for documentation and advice from the Rust community.

 

What does the future hold for Rust?

Rust has exploded in popularity over the past few years after an already impressive rise in adoption after the release of Rust 1.0 in 2015. Is that likely to continue?

The smart money is on the answer to that question being “yes”.

I’ve already mentioned several trending technologies that Rust’s strengths as a coding language makes it a natural choice for, including IoT devices and blockchain. Code security becoming ever more pressing consideration for commercial software projects will further encourage its use.

The popularity of Rust with “Big Tech”, which we’ve seen is migrating much of its critical software to the language, future-proofs it – a big commercial consideration for projects when tech stack decisions are made.

Rust is also now being increasingly used in web development, used to write APIs and backend components and its influence on the biggest category of software looks set to grow.

 

If you are planning a project and considering Rust as a core component of the tech stack, get in touch. K&C has over 20 years of experience as a nearshore IT outsourcing provider and custom software development agency.

We recruit Rust developers and other IT specialists based in nearshore locations in Eastern Europe and beyond, offering 3 geography-based rate tiers to accommodate varying budgets.

Get in touch!