Блог* – Telegram
1.9K subscribers
3.46K photos
135 videos
15 files
3.7K links
Блог со звёздочкой.

Много репостов, немножко программирования.

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
Блог*
#prog #rust #article И ещё немного про мьютексы в Rust. Why Rust mutexes look like they do (перевод) (от автора m4vgalib, между прочим)
#prog #rust #article

Safely writing code that isn't thread-safe

One of the nice things about the Rust programming language is that it makes it easier to write correct concurrent (e.g. threaded) programs – to the degree that Rust’s slogan has been, at times, “fearless concurrency.”

But I’d like to tell you about the other side of Rust, which I think is under-appreciated. Rust enables you to write programs that are not concurrent. This feature is missing from most other languages, and is a source of much complexity and bugs.

“But wait,” you might be saying, “of course I can write code that isn’t concurrent in Java or Python or C!”

Can you, though? You can certainly write code that ignores concurrency, and would malfunction if (say) used from multiple threads simultaneously. But that’s not the same thing as writing code that isn’t concurrent – code that simply can’t be used concurrently, by compiler guarantee.

In Rust, you can. Let’s look at why you can do it, and why it’s awesome.
👍72
1👎1
#prog #rust #puzzle

Дано:

let s = "\\\\";
assert_eq!(s.len(), 4);

Добавьте один символ так, чтобы ассерт не паниковал.
🤯2🤮2🔥1
😢11😁61🔥1
Страдательный залог должен быть избегаем
😁1
Forwarded from ozkriff.games 🦀 (ozkriff🇺🇦)
# cargo-deny

For those of you that may not be aware yet: cargo-deny has built-in support for detecting multiple versions of the same dependency. And it also can ban specific dependencies, discover vulnerabilities, do a license checkup, etc. It even has a ready Github Action, so please consider using it.
8
1❤‍🔥1👎1🔥1
Forwarded from Konstantin Redkin
😁53😢1💩1😭1
👏4👎21❤‍🔥1
😁61🔥1
Forwarded from PB
This media is not supported in your browser
VIEW IN TELEGRAM
или я, который 5 день подряд вижу 38,5 на градуснике:
👍31👎1
Добро пожаловать в проклятый мир, который сами и создали.

Теперь проектам, которые написаны не на Rust нужно оправдываться, причём даже до того как выйдет их первая публичная версия
😁295👍4🌚1
Forwarded from Mikail Bagishov
тут 14 ошибок в слове "благословенный"
👍3🔥2😁2🤮2💩1
О, телега и так умеет.

(а консистентно менять шрифт для эмодзи — до сих пор нет)
😭10🤡3💩2🤨21👍1
Придумал гениальную видеоигру будущего, записывайте. Битвы магов, но вместо маны, маги тратят газ смартконтрактов на эфире. Не благодарите за эту гениальную идею
🤔11👎1🔥1
👎2