Rust programming language outlines plan for updates to style guide

Image: skynesher/ Getty

The Rust programming language is getting so popular that the team behind is creating a team that’s dedicated to defining the default Rust coding style. 

Rust, as developed analyst RedMonk put it, is the “developer darling” of the moment and the most desirable contender for new code that would otherwise be written in C or C++ thanks to its automated way of ensuring secure memory management. 

It’s not one of the most popular languages like Java or Python, but it’s being used by developers on big infrastructure projects. Rust has been officially welcomed by Linux kernel creator Linus Torvalds and has made inroads into Android, Windows, Amazon Web Services, and Facebook parent Meta, to name a few — often where a project sees it fit for Rust to be used where C/C++ would have been.  

Each language has style guides and, if they’re popular enough, may have multiple style guides from major users, like Google, which has its guide for C++ — the language Chrome is written in. Python’s Guido van Rossum’s posted his styling conventions here.

Rust, which reached version 1.0 in 2015, has a style guide in the “rustfmt” or ‘Rust formatting tool’ published on GitHub

The tool automatically formats Rust code to let developers focus on output and aims to reduce the steep learning curve confronting new Rust developers. The guide instructs developers to “Use spaces, not tabs” and says “each level of indentation must be 4 spaces”, for example.

As Josh Triplett explains in a recent Rust blog post: “The standardized style helps Rust developers feel comfortable and at home in many different projects, and the tooling support from rustfmt makes it easy to maintain and to incorporate in continuous integration.”

But the team responsible for writing the style guide between 2016 and 2018 has “by design” come to end, so now it’s now been decided to create the Rust style team, consisting of Triplett, Caleb Cartwright, Michal Goulet, and Jane Lusby. 

The crew will first tackle a “backlog of new language constructs that lack formatting guidance” and move on to “defining and implementing the mechanisms to evolve the default Rust style, and then begin introducing style improvements.”

The work includes minor language changes, big structural changes, and backwards compatibility and the style team wants to craft the tool to make it current for easier coding in Rust, and help adoption. 

“As the Rust language develops, we have a regular need for improvements to the style guide, such as to support new language constructs. This includes minor language changes, as well as highly anticipated new features such as let-chaining (RFC 2497) and let-else (RFC 3137). New constructs like these, by default, get ignored and not formatted by rustfmt, and subsequently need formatting added. Some of this work has fallen to the rustfmt team in recent years, but the rustfmt team would prefer to implement style determinations made by another team rather than making such determinations itself,” writes Triplett. 

“In addition, rustfmt maintains backwards compatibility guarantees: code that has been correctly formatted with rustfmt won’t get formatted differently with a future version of rustfmt. This avoids churn, and avoids creating CI failures when people use rustfmt to check style in CI. However, this also prevents evolving the Rust style to take community desires into account and improve formatting over time. rustfmt provides various configuration options to change its default formatting, and many of those options represent changes that many people in the community would like enabled by default.”

For all the latest Technology News Click Here 

 For the latest news and updates, follow us on Google News

Read original article here

Denial of responsibility! TechNewsBoy.com is an automatic aggregator around the global media. All the content are available free on Internet. We have just arranged it in one platform for educational purpose only. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials on our website, please contact us by email – [email protected]. The content will be deleted within 24 hours.