Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!

The TIOBE Programming Community index is an indicator of the popularity of programming languages. The index is updated once a month. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. Popular search engines such as Google, Bing, Yahoo!, Wikipedia, Amazon, YouTube and Baidu are used to calculate the ratings. It is important to note that the TIOBE index is not about the best programming language or the language in which most lines of code have been written.
якобы у C++ скоро повиснет указательвесёлая формулировка :)
Знание C++ вряд ли серьёзно поможет в изучении, скорее нужен хаскель со штангой.Да ну, как по мне Rust достаточно далек от абстрактных материй Haskell, и мне в его освоении как раз помогло осознание того, как все это работает «на голом железе».
&foo в Rust означает совсем не тоже самое, что в С/C++, хотя на первый взгляд как-будто одно и тоже.trait Trait1 {
type Output;
}
trait Trait2 {
type Output;
}
impl Trait1 for Foo {
type Output = Bar;
}
impl Trait2 for Foo {
type Output = Baz;
}
<Foo as Trait1>::Output // Bar
<Foo as Trait2>::Output // Baz
// Полиморфная структура
struct Decorator<T> {
item: T
}
// Полиморфный трейт
trait From<T> {
fn from(x: T) -> Self;
}
impl<T, U> Foo<U> for T where T: Bar<U> {
...
}
Ну вот к примеру, если в двух типажах есть один и тот же тип Output, как конфликт имен разрешить?
trait First {
type Output;
fn conflict(&self) -> Self::Output;
}
trait Second {
type Output;
fn conflict(&self) -> Self::Output;
}
struct Both;
impl First for Both {
type Output = String;
fn conflict(&self) -> Self::Output {
"First<Output=String>".to_owned()
}
}
impl Second for Both {
type Output = String;
fn conflict(&self) -> Self::Output {
"Second<Output=String>".to_owned()
}
}
fn main() {
let its_both = Both;
println!("{}", First::conflict(&its_both));
println!("{}", Second::conflict(&its_both));
}
<Both as Second>::Output
Rust попал в индекс TIOBE