Mozilla's systems programming language Rust

Pit Stop

© Lead Image © Paul Maydikov, 123RF.com

© Lead Image © Paul Maydikov, 123RF.com

Article from Issue 179/2015
Author(s):

We look at a few features of Rust, Mozilla's systems programming language, and its similarity to other languages.

The statically typed programming language Rust [1] places much emphasis on speed and security. Rust, like its inspiration C, stores fixed-sized variables in a stack. However, it stores pointer values in the main memory heap. The code in Listing 1 demonstrates controlled handling of allocated memory in Rust. If you compile Listing 1 in the shell via

rustc moved.rs

the compiler will abort the process with the error message moved_type.rs:8:3: 8:6 error: use of moved value: `vec` for line 8.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Embedded Rust

    Rust, a potential successor to C/C++, claims to solve some memory safety issues while maintaining high performance. We look at Rust on embedded systems, where memory safety, concurrency, and security are equally important.

  • Rust

    Largely unnoticed by the public, the Mozilla Foundation is tinkering with its own programming language, Rust, which is intended to make writing reliable, fast, and concurrently running applications easier. For this purpose, the developers are borrowing generously from other languages.

  • Kernel News

    In kernel news: Rust in Linux; and Compiler and Kernel Frenemies.

  • Topgrade

    Topgrade detects all the package managers installed on a system and executes them one by one at the command line.

  • Kernel News

    This month in Kernel News: Shared Processes with Hyper-Threading; Cleaning Up printk(); and Rust in the Kernel.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News