发布于 2016-01-22 00:53:39 | 258 次阅读 | 评论: 0 | 来源: 网友投递
Rust 编程语言
Rust是Mozilla开发的注重安全、性能和并发性的编程语言。创建这个新语言的目的是为了解决一个很顽疾的问题:软件的演进速度大大低于硬件的演进,软件在语言级别上无法真正利用多核计算带来的性能提升。Rust是针对多核体系提出的语言,并且吸收一些其他动态语言的重要特性,比如不需要管理内存,比如不会出现Null指针等等。
Rust 1.6 发布,该版本最主要的新特性是 libcore 变稳定,主要更新如下:
The #![no_std]
attribute causes a crate to not be linked to the standard library, but only the core library, as described in RFC 1184. The core library defines common types and traits but has no platform dependencies whatsoever, and is the basis for Rust software in environments that cannot support a full port of the standard library, such as operating systems. Most of the core library is now stable.
Stabilized APIs:Read::read_exact
, ErrorKind::UnexpectedEof
, fs::DirBuilder
, fs::DirBuilder::new
,fs::DirBuilder::recursive
, fs::DirBuilder::create
,os::unix::fs::DirBuilderExt
,os::unix::fs::DirBuilderExt::mode
, vec::Drain
,vec::Vec::drain
, string::Drain
, string::String::drain
,vec_deque::Drain
, vec_deque::VecDeque::drain
,collections::hash_map::Drain
,collections::hash_map::HashMap::drain
,collections::hash_set::Drain
,collections::hash_set::HashSet::drain
,collections::binary_heap::Drain
,collections::binary_heap::BinaryHeap::drain
,Vec::extend_from_slice
,Mutex::get_mut
, Mutex::into_inner
, RwLock::get_mut
,RwLock::into_inner
, Iterator::min_by_key
, Iterator::max_by_key
.
The core library is stable, as are most of its APIs.
The assert_eq!
macro supports arguments that don't implementSized
, such as arrays. In this way it behaves more likeassert!
.
Several timer functions that take duration in milliseconds are deprecated in favor of those that take Duration
. These include Condvar::wait_timeout_ms
, thread::sleep_ms
, andthread_park_timeout_ms
.
The algorithm by which Vec
reserves additional elements wastweaked to not allocate excessive space while still growing exponentially.
From
conversions are implemented from integers to floatsin cases where the conversion is lossless. Thus they are not implemented for 32-bit ints to f32
, nor for 64-bit ints to f32
or f64
. They are also not implemented for isize
and usize
because the implementations would be platform-specific. From
is also implemented from f32
to f64
.
From<&Path>
and From<PathBuf>
are implemented for Cow<Path>
.
From<T>
is implemented for Box<T>
, Rc<T>
and Arc<T>
.
IntoIterator
is implemented for &PathBuf
and &Path
.
BinaryHeap
was refactored for modest performance improvements.
Sorting slices that are already sorted is 50% faster in some cases.
Cargo will look in $CARGO_HOME/bin
for subcommands by default.
Cargo build scripts can specify their dependencies by emitting thererun-if-changed
key.
crates.io will reject publication of crates with dependencies that have a wildcard version constraint. Crates with wildcard dependencies were seen to cause a variety of problems, as described in RFC 1241. Disallowing them will create more predictable development experience and a more stable ecosystem. Since 1.5 publication of such crates has emitted a warning.
cargo clean
accepts a --release
flag to clean the release folder. A variety of artifacts that Cargo failed to clean are now correctly deleted.
The unreachable_code
lint warns when a function call's argument diverges.
The parser indicates failures that may be caused by confusingly-similar Unicode characters
Certain macro errors are reported at definition time, not expansion.
The compiler no longer makes use of the RUST_PATH
environment variable when locating crates. This was a pre-cargo feature for integrating with the package manager that was accidentally never removed.
A number of bugs were fixed in the privacy checker that could cause previously-accepted code to break.
Bugs in pattern matching unit structs were fixed: the tuple struct pattern syntax (Foo(..)
) no longer can be used with unit structs; patterns that share the same name as a const are now an error.
A bug was fixed that causes rustc not to apply default type parameters when resolving certain method implementations of traits defined in other crates.
更多内容请看:release notes。
下载页面:1.6.0
Rust 是 Mozilla 的一个新的编程语言,由web语言的领军人物Brendan Eich(js之父),Dave Herman以及Mozilla公司的Graydon Hoare 合力开发。