发布于 2016-05-26 23:27:41 | 141 次阅读 | 评论: 0 | 来源: 网友投递
Rust 编程语言
Rust是Mozilla开发的注重安全、性能和并发性的编程语言。创建这个新语言的目的是为了解决一个很顽疾的问题:软件的演进速度大大低于硬件的演进,软件在语言级别上无法真正利用多核计算带来的性能提升。Rust是针对多核体系提出的语言,并且吸收一些其他动态语言的重要特性,比如不需要管理内存,比如不会出现Null指针等等。
Rust 1.9发布了。更新内容:
语言:
The #[deprecated]
attribute when applied to an API will generate warnings when used. The warnings may be suppressed with #[allow(deprecated)]
. RFC 1270.
fn
item types are zero sized, and each fn
names a unique type. This will break code that transmutes fn
s, so callingtransmute
on a fn
type will generate a warning for a few cycles, then will be converted to an error.
The parser considers unicode codepoints in the PATTERN_WHITE_SPACE
category to be whitespace.
库:
std::sync::Once
is poisoned if its initialization function fails.
The default buffer size used by BufReader
and BufWriter
was reduced to 8K, from 64K. This is in line with the buffer size used by other languages.
Instant
, SystemTime
and Duration
implement +=
and -=
. Duration
additionally implements *=
and /=
.
Cargo
Top-level overrides allow specific revisions of crates to be overridden through the entire crate graph. This is intended to make upgrades easier for large projects, by allowing crates to be forked temporarily until they've been upgraded and republished.
Cargo will pass the contents of the RUSTFLAGS
variable to rustc
on the commandline. rustc
arguments can also be specified in the build.rustflags
configuration key.
性能:
During type unification, the complexity of comparing variables for equivalance was reduced from O(n!)
to O(n)
. This leads to major compile-time improvements in some scenarios.
ToString
is specialized for str
, giving it the same performance as to_owned
.
Spawning processes with Command::output
no longer creates extra threads.
#[derive(PartialEq)]
and #[derive(PartialOrd)]
emit less code for C-like enums.
Misc:
Passing the --quiet
flag to a test runner will produce much-abbreviated output.
The Rust Project now publishes std binaries for the mips-unknown-linux-musl
, mipsel-unknown-linux-musl
, andi586-pc-windows-msvc
targets.
兼容性说明:
std::sync::Once
is poisoned if its initialization function fails.
It is illegal to define methods with the same name in overlapping inherent impl
blocks.
fn
item types are zero sized, and each fn
names a unique type. This will break code that transmutes fn
s, so callingtransmute
on a fn
type will generate a warning for a few cycles, then will be converted to an error.
Improvements to const evaluation may trigger new errors when integer literals are out of range.
下载地址: