是否有Rust的已发布语言格式标准? [英] Is there a published language format standard for Rust yet?

查看:65
本文介绍了是否有Rust的已发布语言格式标准?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Rust编程语言,并试图找到一个权威的已发布标准(或至少一个功能正常的文档),例如ECMA Standard或C ++ Standard或类似的东西,它定义了语言的语法和库.

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?

推荐答案

2014年1月的首次响应,比Rust 1.0早一年了:

不,目前没有健全的Rust正式规范.语言会进一步稳定.

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

大多数事物都有形式化的语法,但是其中一些是不正确的和过时的. Rust参考手册是您最接近所需内容的手册.(并且代码是最正确的规范.)

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.

2020年9月更新:

当我第一次写这个答案的时候,大多数人期望Rust 1.0会带来一个粗略的规范-无论如何,这不是正式的形式,或听起来不是合理的,而是某种形式的规范. did 的情况有所改善,并且一直在改善(参考手册不应不正确或过时,尽管它肯定仍不完整),但不超出发问者和其他人的范围曾经希望.

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.

但是有进步:Ralf Jung刚获得博士学位,其学位论文为 了解和发展Rust编程语言 ,介绍了两个为Rust奠定正式基础的项目".

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".

这篇关于是否有Rust的已发布语言格式标准?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆