Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a published language format standard for Rust yet?

I was doing some research on the Rust programming language, and I was trying to find an authoritative published standard (or at least a document that functions as if) like the ECMA Standard or the C++ Standard or something like that, which defines the syntax of the language, and the library.

Does such a thing exist yet? Or is it still in the works?

If it does not exist, what's the resource that's the closest thing?

like image 986
OmnipotentEntity Avatar asked Jan 17 '14 03:01

OmnipotentEntity


People also ask

What language is Rust written in?

First created in 2006 by Graydon Hoare as a side project while working at browser-developer Mozilla, headquartered in Mountain View, California, Rust blends the performance of languages such as C++ with friendlier syntax, a focus on code safety and a well-engineered set of tools that simplify development.

When was Rust released language?

Rust was first released in early access in December 2013 and received its full release in February 2018. Rust is available on Windows and macOS. Console versions for PlayStation 4 and Xbox One developed in conjunction with Double Eleven were released in May 2021.

Is Rust just C++?

Rust is a multi-paradigm programming language focused on performance and safety, especially safe concurrency. It is syntactically similar to C++ but provides memory safety without using garbage collection.


1 Answers

Initial January 2014 response, more than a year before Rust 1.0:

No, there is no sound formal specification of Rust at present. It will come when the language stabilises further.

There are formal grammars for most things, but some of those are incorrect and out of date. The Rust reference manual is the closest you'll get to what you want. (And the code is the most correct specification.)

Do not fear—this situation will improve in the coming months.


September 2020 update:

At the time I first wrote this answer, most expected that a rough specification would come by Rust 1.0—not formal by any means, or sound for that matter, but a specification of some sort. The situation did improve, and has continued to improve (the reference manual should not be incorrect or out of date any more, though it is definitely still incomplete), but not as far as the questioner and others may have hoped.

For at some point the community as a whole realised that in the short term no one wanted to put in the effort (or could justify putting in the effort) to make a thorough informal specification, and that making a formal specification was in fact a very deep research area, as we wouldn’t want to formalise the ad hoc implementation as it was, but rather create a sound model of it first (and then adjust the compiler to match that model).

So priorities shifted, with the rustc developers not planning to make any specification themselves, but just assist others who want to make it happen. I think people generally expect it to happen eventually, but only eventually, not any time soon.

But there is progress: Ralf Jung just got his PhD with a dissertation entitled Understanding and Evolving the Rust Programming Language, which “presents two projects establishing the first formal foundations for Rust”.

like image 102
Chris Morgan Avatar answered Oct 15 '22 14:10

Chris Morgan