Блог*
رفتن به کانال در Telegram
Блог со звёздочкой. Много репостов, немножко программирования. Небольшое прикольное комьюнити: @decltype_chat_ptr_t Автор: @insert_reference_here
نمایش بیشتر1 928
مشترکین
اطلاعاتی وجود ندارد24 ساعت
+37 روز
+330 روز
آرشیو پست ها
1 928
Repost from N/a
Был такой английский ботаник Ньюман, и вот он в середине 19-го века пытался воссоздать облик птеродактилей. Живите теперь с этим, не мне же одной
(господи, все мы)
1 928
Repost from мне не нравится реальность
Occult club registration rejected after complaint it may summon Satan to University of Adelaide
> "Even if we did want to summon Satan, it's not against university or union policy to do so, so it's still not really grounds to reject us," Adelaide University Occult Club president Ashley Towner said.
теперь это моя любимая новость
1 928
#prog #rust #article
Статья в двух частях о rust-minidump — библиотеки для разбора minidump, разработанного в microsoft портируемого формата для хранения дампов памяти. К слову, именно она сейчас используется по умолчанию в Firefox в проде на протяжении где-то шести месяцев.
Everything Is Broken: Shipping rust-minidump at Mozilla – Part 1
В это части, в частности, рассказывается, зачем вообще решили делать RIIR, когда есть Breakpad от Google:
> Meanwhile, Google has kind-of moved on to Crashpad. I say kind-of because there’s still a lot of Breakpad in there, but they’re more interested in building out tooling on top of it than improving Breakpad itself. Having made a few changes to Breakpad: honestly fair, I don’t want to work on it either. Still, this was a bit of a problem for us, because it meant the project became increasingly under-staffed.
<...>
> Why is working on Breakpad so miserable, you ask?
> Parsing and analyzing minidumps is basically an exercise in writing a fractal parser of platform-specific formats nested in formats nested in formats. For many operating systems. For many hardware architectures. And all the inputs you’re parsing and analyzing are terrible and buggy so you have to write a really permissive parser and crawl forward however you can.
<...>
> Hey, you know who has a lot of experience dealing with really complicated permissive parsers written in C++? Mozilla! That’s like the core functionality of a web browser.
> Do you know Mozilla’s secret solution to writing really complicated permissive parsers in C++?
> We stopped doing it.
> We developed Rust and ported our nastiest parsers to it.
Fuzzing rust-minidump for Embarrassment and Crashes – Part 2
Во второй части рассказывается о том, как фаззинг сумел найти кучу багов, и подробно разбираются парочка из них (включая тот, который был сделан и Breakpad).
1 928
Repost from ozkriff.games 🦀
# lib.rs Version Pages Now Link to Git Commits
When you publish a crate, Cargo makes a note of its git repository commit hash and includes it in the crates-io crate tarball. A few days ago Kornel announced that lib.rs started exposing this information, nice!
Also, check out https://lib.rs/stats if you haven't seen it yet, it has a bunch of cool graphs.
1 928
Repost from мне не нравится реальность
Ещё одно классное:
(|_, ()| ())([return, ()]);
На этот раз аж ICE (internal compiler error)!
А основная причина скорее всего всё та-же: некорректный код в диагностике неправильных аргументов функции.1 928
#rust
https://github.com/rust-lang/rust/pull/96709#issuecomment-1173170243
Список крейтов, которым так или иначе требуются GAT
1 928
#prog #rust #rustlib
Reinventing Rust formatting syntax — заметка о fmtools, библиотеке, которая позволяет использовать в форматных строках произвольные выражения вместо просто идентификаторов и включать в них if-ы.
Пример
До:
let power = 0.5;
print!("At ");
if power >= 1.0 {
print!("full");
} else {
print!("{:.0}%", power * 100.0);
}
print!(" power");
После:
let power = 0.5;
fmtools::println!("At "
if power >= 1.0 { "full" }
else { {power * 100.0:.0}"%" }
" power");1 928
Repost from мне не нравится реальность
Вы спросите: what???, а я отвечу:
Это MRE (minimal reproducible example) который показывает неправильную диагностику в компиляторе:
error[E0308]: `if` and `else` have incompatible types
--> ./t.rs:2:18
|
2 | (|_, ()| ())(while true {});
| ^^^^^^^^^^^--
| | |
| | expected because of this
| expected `()`, found `!`
|
= note: expected unit type `()`
found type `!`
В реальном коде ошибка ещё страннее выглядела X)