Oberon space
General Category => Общий раздел => Тема начата: valexey_u от Октябрь 17, 2012, 10:32:57 am
-
А между тем, тихо и незаметно вышла новая версия убийцы С++ от мозиллы.
Что нового:
- Реализация точного сборщика мусора.
- Причесали и стабилизировали синтаксис. В частности - для идентификаторов типов теперь обязательно использование Camel case (мой опыт показывает что такие правила в языке хороши на практике).
- Выкинули классы. Теперь вместо них структуры. Это упростило синтаксис и семантику. При этом ничего (из функциональности) не потеряли. Скажем деструкторы никуда не делись.
- Выкинули интерфейсы (interface) теперь там "характерыне черты", в общем traits там теперь. Насколько я понимаю, эта штука столь же крута (если не круче) чем интерфейсы в Go. Вот что про них пишут в Rust-доке:
they can be mixed in any order, can be declared independent from the type they affect, and are compiled independently for each type that implements them (indeed, will inline and specialize exactly as any other function will
- Поскольку изменяемость - это уязвимость, а Rust позиционируется как язык безопасный, ключевое слово mut (mutable) теперь является квалификатром типа памяти (аналог всяких там static в сях) и применяется к конкретной переменной. Например:
let mut a = 42; // это изменяемая штука
let b = 42; // а это нет, хотя тип у них один и тот же (int)
При этом этот самый mut рекурсивно распространяется на все что внутри переменной находится. Если бы 'a' была структурой, то и все её поля стали бы mut. Естественно в функцию ожидающую не mut-переменную передать таковую нельзя. - Также там расширили и углубили систему многозадачности и взаимодействие задач.
Кроме того, с февраля этого года силами Мозиллы развивается новый асинхронно-параллельний движок для браузера - Servo (https://github.com/mozilla/servo) который пишется, естественно, полностью на Rust'e.
Ссылки по теме:
- Подробное описание новшеств: https://github.com/mozilla/rust/wiki/Doc-detailed-release-notes
- Новость на opennet'e с описанием что такое Rust вообще: http://www.opennet.ru/opennews/art.shtml?num=35097
-
На днях вышла версия 0.7 с более чем 2000 изменениями относительно предыдущей версии:
https://github.com/mozilla/rust/blob/release-0.7/RELEASES.txt
-
На днях вышла версия 0.7 с более чем 2000 изменениями относительно предыдущей версии:
https://github.com/mozilla/rust/blob/release-0.7/RELEASES.txt
При этом язык не менялся - изменения в стандартной библиотеке.
-
На днях вышла версия 0.7 с более чем 2000 изменениями относительно предыдущей версии:
https://github.com/mozilla/rust/blob/release-0.7/RELEASES.txt
При этом язык не менялся - изменения в стандартной библиотеке.
Э...https://github.com/mozilla/rust/blob/release-0.7/RELEASES.txt (https://github.com/mozilla/rust/blob/release-0.7/RELEASES.txt)
Version 0.7 (July 2013)
-----------------------
* ~2000 changes, numerous bugfixes
* Language
* `impl`s no longer accept a visibility qualifier. Put them on methods
instead.
* The borrow checker has been rewritten with flow-sensitivity, fixing
many bugs and inconveniences.
* The `self` parameter no longer implicitly means `&'self self`,
and can be explicitly marked with a lifetime.
* Overloadable compound operators (`+=`, etc.) have been temporarily
removed due to bugs.
* The `for` loop protocol now requires `for`-iterators to return `bool`
so they compose better.
* The `Durable` trait is replaced with the `'static` bounds.
* Trait default methods work more often.
* Structs with the `#[packed]` attribute have byte alignment and
no padding between fields.
* Type parameters bound by `Copy` must now be copied explicitly with
the `copy` keyword.
* It is now illegal to move out of a dereferenced unsafe pointer.
* `Option<~T>` is now represented as a nullable pointer.
* `@mut` does dynamic borrow checks correctly.
* The `main` function is only detected at the topmost level of the crate.
The `#[main]` attribute is still valid anywhere.
* Struct fields may no longer be mutable. Use inherited mutability.
* The `#[no_send]` attribute makes a type that would otherwise be
`Send`, not.
* The `#[no_freeze]` attribute makes a type that would otherwise be
`Freeze`, not.
* Unbounded recursion will abort the process after reaching the limit
specified by the `RUST_MAX_STACK` environment variable (default: 1GB).
* The `vecs_implicitly_copyable` lint mode has been removed. Vectors
are never implicitly copyable.
* `#[static_assert]` makes compile-time assertions about static bools.
* At long last, 'argument modes' no longer exist.
* The rarely used `use mod` statement no longer exists.
* Syntax extensions
* `fail!` and `assert!` accept `~str`, `&'static str` or `fmt!`-style
argument list.
* `Encodable`, `Decodable`, `Ord`, `TotalOrd`, `TotalEq`, `DeepClone`,
`Rand`, `Zero` and `ToStr` can all be automatically derived with
`#[deriving(...)]`.
* The `bytes!` macro returns a vector of bytes for string, u8, char,
and unsuffixed integer literals.
...
-
Ну, ок. Основные изменения были не в языке. http://www.opennet.ru/opennews/art.shtml?num=37354