Forwarded from Pragmatic Programmer (Nikita Bishōnen)
Немного размышлений на тему Rust и его развития без стагнации.
Для поддержания этого "девиза" в Rust появились "издания", сейчас на носу издание 2024. Вот среднего размера изменение, которое это издание привнесёт. С ним, код работающий в издании 2021:
fn indices<'s, T>( slice: &'s [T], ) -> impl Iterator<Item = usize> { 0 .. slice.len() } ... fn main() { let mut data = vec![1, 2, 3]; let i = indices(&data); data.push(4); // <-- Error! i.next(); // <-- assumed to access `&data` }
перестаёт работать и выдаёт ошибку, потому-что новое издание задействует lifetime в возвращаемом impl Trait.
Для исправления предлагается ввести некий use:
) -> impl Iterator<Item = usize> + use<> { // ----- // Return type does not use `'s` or `T`
и на мой взгляд, это конечно выглядит как костыль. Думаю сейчас я понимаю тех, кто в мою молодость программиста сидел и говорил что Java 8 это всё сахар и не нужно программистам. Думаю что дальше тянуть обратную совместимость у Rust будет получаться всё сложнее и сложнее, пора работать над Rust 2.0.
Немного размышлений на тему Rust и его развития без стагнации.
Для поддержания этого "девиза" в Rust появились "издания", сейчас на носу издание 2024. Вот среднего размера изменение, которое это издание привнесёт. С ним, код работающий в издании 2021:
fn indices<'s, T>( slice: &'s [T], ) -> impl Iterator<Item = usize> { 0 .. slice.len() } ... fn main() { let mut data = vec![1, 2, 3]; let i = indices(&data); data.push(4); // <-- Error! i.next(); // <-- assumed to access `&data` }
перестаёт работать и выдаёт ошибку, потому-что новое издание задействует lifetime в возвращаемом impl Trait.
Для исправления предлагается ввести некий use:
) -> impl Iterator<Item = usize> + use<> { // ----- // Return type does not use `'s` or `T`
и на мой взгляд, это конечно выглядит как костыль. Думаю сейчас я понимаю тех, кто в мою молодость программиста сидел и говорил что Java 8 это всё сахар и не нужно программистам. Думаю что дальше тянуть обратную совместимость у Rust будет получаться всё сложнее и сложнее, пора работать над Rust 2.0.
BY Type Driven Thoughts 🦀
Warning: Undefined variable $i in /var/www/group-telegram/post.php on line 260
If you initiate a Secret Chat, however, then these communications are end-to-end encrypted and are tied to the device you are using. That means it’s less convenient to access them across multiple platforms, but you are at far less risk of snooping. Back in the day, Secret Chats received some praise from the EFF, but the fact that its standard system isn’t as secure earned it some criticism. If you’re looking for something that is considered more reliable by privacy advocates, then Signal is the EFF’s preferred platform, although that too is not without some caveats. "There is a significant risk of insider threat or hacking of Telegram systems that could expose all of these chats to the Russian government," said Eva Galperin with the Electronic Frontier Foundation, which has called for Telegram to improve its privacy practices. On Feb. 27, however, he admitted from his Russian-language account that "Telegram channels are increasingly becoming a source of unverified information related to Ukrainian events." Emerson Brooking, a disinformation expert at the Atlantic Council's Digital Forensic Research Lab, said: "Back in the Wild West period of content moderation, like 2014 or 2015, maybe they could have gotten away with it, but it stands in marked contrast with how other companies run themselves today." In February 2014, the Ukrainian people ousted pro-Russian president Viktor Yanukovych, prompting Russia to invade and annex the Crimean peninsula. By the start of April, Pavel Durov had given his notice, with TechCrunch saying at the time that the CEO had resisted pressure to suppress pages criticizing the Russian government.
from us