Rust 1.0.0-alpha is about to release

Source: Internet
Author: User
Tags traits

Rust 1.0.0-alpha is about to release

Release Notes and References:

Version 1.0.0-alpha (January 2015)

----------------------------------

* ~2300 changes, numerous bugfixes

* Highlights

* The language itself is considered feature complete for 1.0,

Though there is a significant amount of cleanup and bugfixes

Remaining.

* Nearly 50% of the public API surface of the-the-Library has

been declared ' stable '. Those interfaces won't change.

* Most crates that is not ' STD ' has been moved out of the Rust

Distribution into the Cargo ecosystem so they can evolve

Separately and don ' t need to be stabilized as quickly, including

' Time ', ' getopts ', ' num ', ' regex ', and ' term '.

* Documentation continues to being expanded with more guides, more

API coverage and more examples.

* All official Rust binary installers now come with [Cargo], the

Rust Package Manager.

* Language

* Closures has been [completely redesigned][unboxed] to be

Implemented in terms of traits, can now is used as generic type

Bounds and thus monomorphized and inlined, or via an opaque

Pointer (boxed) as in the old system. The new system is often

Referred to as ' unboxed ' closures.

* Enum variants is [namespaced by their type names][enum].

* [' WHERE ' clauses][where] provide a more versatile and attractive

syntax for specifying generic bounds, though the previous syntax

Remains valid.

* Rust again picks a [fallback] (either I32 or f64) for uninferred

numeric types.

* Rust [no longer have a runtime][rt] of any description, and only

Supports OS threads, not green threads.

* At Long, Rust had been overhauled for ' dynamically-sized

Types ' ([DST]), which integrates ' fat pointers ' (object types,

arrays, and ' str ') more deeply into the type system, making it

More consistent.

* Rust now have a general [range Syntax][range], ' I.. J ', ' I.. ', and

`.. J ' that produce range types and which, when combined with the

' Index ' operator and Multitispatch, leads to a convenient slice

notation, ' [I.] J] '.

* The new range syntax revealed an ambiguity in the Fixed-length

Array syntax, so-now fixed length arrays [is written ' [T;

N] '][arrays].

* the ' Copy ' trait is no longer implemented automatically. Unsafe

Pointers no longer implement ' Sync ' and ' Send ' so types

containing them don ' t automatically either. ' Sync ' and ' Send '

is now ' unsafe traits ' so one can "forcibly" implement them via

' Unsafe impl ' if a type confirms to the requirements for them

Even though the internals do not (e.g. structs containing unsafe

Pointers like ' ARC '). These changes is intended to prevent some

Footguns and is collectively known as [Opt-in built-in

Traits][oibit] (though ' Sync ' and ' Share ' would soon become pure

Library types unknown to the compiler).

* Operator traits now take their operands [by Value][ops], and

Comparison traits can use Multidispatch to compare one type

Against multiple other types, allowing e.g. ' String ' to be

Compared with ' &str '.

* ' If let ' and ' when let ' is no longer feature-gated.

* Rust has adopted a more [uniform syntax for escaping Unicode

Characters][unicode].

* ' macro_rules! ' [has been declared Stable][mac]. Though it is a

Flawed system It is sufficiently popular the It must be usable

For 1.0. Effort has gone to future-proofing it in ways that

Would allow the other macro systems into being developed in parallel, and

Won ' t otherwise impact the evolution of the language.

* The prelude have been [pared back significantly][prelude] such

That it's the minimum necessary to support the most pervasive

Code patterns, and through [generalized where Clauses][where]

Many of the prelude extension traits have been consolidated.

* Rust ' s rudimentary reflection [has been REMOVED][REFL], as it

Incurred too much code generation for little benefit.

* [Struct Variants][structvars] is no longer feature-gated.

* Trait bounds can be [polymorphic over LIFETIMES][HRTB]. Also

Known as ' higher-ranked trait bounds ', this crucially allows

unboxed closures to work.

* Macros invocations surrounded by parens or square brackets and

Not terminated by a semicolon is [parsed as

Expressions][macros], which makes expressions like ' vec! [1i32,

2, 3].len () ' work as expected.

* Trait objects now implement their traits automatically.

* Automatically deriving traits is now do with ' #[derive (...)] `

Not ' #[deriving (...)] ' For [consistency and other naming

Conventions][derive].

* Importing the containing module at the same time as items it

Contains is (now do with ' self ' instead of ' mod '][self '), as in

Use ' Foo::{self, bar} '

* Libraries

* A [SERIES][COLL1] of [efforts][coll2] to establish

[Conventions] [Coll3] For collections types have resulted in API

Improvements throughout the standard library.

* New [APIs for error Handling][err] provide ergonomic interop

Between error types, and [new Conventions][err-conv] Describe

More clearly the recommended error handling strategies in Rust.

* the ' fail! ' macro has been renamed to [' panic! '][panic] so that

It is easier-discuss failure in the context of the error handling

Without making clarifications as to whether you is referring to

The ' fail ' macro or failure more generally.

* on Linux, ' osrng ' prefers the new, more reliable ' getrandom '

Syscall when available.

* the ' serialize ' crate has been renamed ' Rustc-serialize ' and

Moved out of the distribution to Cargo. Although it is widely

Used now, it's expected to being superceded in the near future.

* the ' Show ' formatter, typically implemented with

' #[derive (Show)] ' is [now requested with the ' {:?} `

Specifier][show] and is intended for use by all types, for uses

such as ' println! ' debugging. The new ' String ' formatter must be

Implemented by hand, uses the ' {} ' specifier, and is intended

For full-fidelity conversions of things so can logically be

represented as strings.

* Tooling

* [Flexible target Specification][flex] allows RUSTC ' s code

Generation to being configured to support otherwise-unsupported

Platforms.

* Rust comes with rust-gdb and RUST-LLDB scripts that launch their

respective debuggers with Rust-appropriate pretty-printing.

* The Windows installation of Rust is distributed with the

MinGW components currently required to link binaries on that

Platform.

* Misc

* Nullable enum optimizations has been extended to more types so

that e.g. ' option<vec<t>> ' and ' option<string> ' take up no more

Space than the inner types themselves.

* Work have begun on supporting AARCH64.

[Cargo]: Https://crates.io

[unboxed]: https://github.com/rust-lang/rfcs/blob/master/text/0114-closures.md

[Enum]: https://github.com/rust-lang/rfcs/blob/master/text/0390-enum-namespacing.md

[Flex]: HTTPS://GITHUB.COM/RUST-LANG/RFCS/BLOB/MASTER/TEXT/0131-TARGET-SPECIFICATION.MD

[Err]: https://github.com/rust-lang/rfcs/blob/master/text/0201-error-chaining.md

[Err-conv]: https://github.com/rust-lang/rfcs/blob/master/text/0236-error-conventions.md

[RT]: HTTPS://GITHUB.COM/RUST-LANG/RFCS/BLOB/MASTER/TEXT/0230-REMOVE-RUNTIME.MD

[Mac]: https://github.com/rust-lang/rfcs/blob/master/text/0453-macro-reform.md

[DST]: http://smallcultfollowing.com/babysteps/blog/2014/01/05/dst-take-5/

[COLL1]: https://github.com/rust-lang/rfcs/blob/master/text/0235-collections-conventions.md

[Coll2]: https://github.com/rust-lang/rfcs/blob/master/text/0509-collections-reform-part-2.md

[Coll3]: https://github.com/rust-lang/rfcs/blob/master/text/0216-collection-views.md

[OPS]: HTTPS://GITHUB.COM/RUST-LANG/RFCS/BLOB/MASTER/TEXT/0439-CMP-OPS-REFORM.MD

[Prelude]: Https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md

[WHERE]: https://github.com/rust-lang/rfcs/blob/master/text/0135-where.md

[REFL]: https://github.com/rust-lang/rfcs/blob/master/text/0379-remove-reflection.md

[Panic]: https://github.com/rust-lang/rfcs/blob/master/text/0221-panic.md

[Structvars]: https://github.com/rust-lang/rfcs/blob/master/text/0418-struct-variants.md

[HRTB]: https://github.com/rust-lang/rfcs/blob/master/text/0387-higher-ranked-trait-bounds.md

[Unicode]: https://github.com/rust-lang/rfcs/blob/master/text/0446-es6-unicode-escapes.md

[Oibit]: https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md

[Macros]: HTTPS://GITHUB.COM/RUST-LANG/RFCS/BLOB/MASTER/TEXT/0378-EXPR-MACROS.MD

[Range]: https://github.com/rust-lang/rfcs/blob/master/text/0439-cmp-ops-reform.md#indexing-and-slicing

[Arrays]: https://github.com/rust-lang/rfcs/blob/master/text/0520-new-array-repeat-syntax.md

[Show]: https://github.com/rust-lang/rfcs/blob/master/text/0504-show-stabilization.md

[Derive]: https://github.com/rust-lang/rfcs/blob/master/text/0534-deriving2derive.md

[Self]: https://github.com/rust-lang/rfcs/blob/master/text/0532-self-in-use.md

[Fallback]: https://github.com/rust-lang/rfcs/blob/master/text/0212-restore-int-fallback.md

Version 0.12.0 (October 2014)

-----------------------------


Rust 1.0.0-alpha is about to release

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.