es
Feedback

¡No caigas en manos de tramposos! Telemetrio encuentra y marca estos canales 👉 Si quieres ver la etiqueta, suscríbete

Блог*

Блог*

Ir al canal en Telegram

Блог со звёздочкой. Много репостов, немножко программирования. Небольшое прикольное комьюнити: @decltype_chat_ptr_t Автор: @insert_reference_here

Mostrar más
1 983
Suscriptores
+124 horas
-137 días
-1330 días
Archivo de publicaciones
#prog #rust #rustlib #article Kani — bit-precise model checker for Rust. Верификатор, который исполняет код символически и потому эффективно проверяет код на всех возможных входах. Если код (без внесения ограничений на работу kani) проходит проверку, то его корректность можно считать доказанной. А также статья, которая проверяет кусок логики из реального проекта: Using the Kani Rust Verifier on a Firecracker Example
18 jul 2022, 15:54

"3-е кольцо Вавилонова И.Д." Сережа Кшатри
"3-е кольцо Вавилонова И.Д." Сережа Кшатри
18 jul 2022, 15:20

#prog #rust В Rust стабилизировали core::ptr::slice_from_raw_parts в const-контексте, изменение войдёт в Rust 1.64.0. Что это значит? А это значит, что я наконец-то могу написать свой макрос по переводу числу в строку так, чтобы он работал без UB на стабильной версии!
17 jul 2022, 16:46

IF LET CHAINS ARE STABILIZED IN RUST 1.64 rust-lang/rust/pull/94927#event-7007028976 > 2 years, 4 months, 3 weeks and 1 day of long nights, obstacles and headaches. > Hope stabilization won't be reverted but regardless, thanks to everyone who helped make this feature a reality. Для тех кто не в теме, в расте можно делать паттерн матчинг в if (и while цикле). Называется эта конструкция "if-let" и выглядит примерно вот так: // выражение vvv if let Some(x) = opt { ... } // ^^^^^^^ паттерн Синтаксис конфузный, но что имеем, то имеем, ладно. Проблемы (которые решает фича выше) начинается когда хочется сравнить сразу несколько выражений с паттернами. Можно использовать туплы: if let (Some(x), Ok(y)) = (opt, res) { ... } Но мало того, что это абсолютно не читаемо, мало того что это вычисляет res даже если паттерн и без него бы не сматчился, так ещё и в res тут нельзя использовать x. Поэтому это очень неудобно. Можно использовать вложенность: if let Some(x) = opt { if let Ok(y) = res { ... } } Но это ломает else (с таким вариантом его надо дублировать во все сложенные if'ы). Это всё настолько печально, что есть даже крейт if_chain с макросом который разбирается со всеми этими проблемами. Ну и фича которую вот стабилизировали — if let chains, которая позволяет писать вот так: if let Some(x) = opt && let Ok(y) = res { ... } 😌
17 jul 2022, 08:12

#prog #rust 🎉
17 jul 2022, 08:12

👍 Завтрак пиццей 👎 Горло болит так, что не хочется лишний раз говорить
17 jul 2022, 07:10

Похвастаюсь и здесь что-ли: я реализовал Rust RFC 3216. Вот прям PR уже смерджили. TL;DR: фича позволяет явно писать лайфтайм параметры для замыканий:
let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) };
//       ^^^^^^^^^^^--- new!

https://github.com/rust-lang/rust/pull/98705
16 jul 2022, 07:33

#prog #rust 🎉
16 jul 2022, 07:33

#video The Difference Between A Dork And A Nerd. Don McMillan, или как притащить PowerPoint на стендап (успешно)
15 jul 2022, 15:13

Кстати, напоминаю про очень важный опрос
14 jul 2022, 12:10

Repost from N/a
photo content
14 jul 2022, 11:14

#prog #rust #rustlib #article Gaffer: A prioritised micro-batch scheduler in rust ...I looked at existing schedulers but didn't find any which had features which allowed us to take advantage of these optimisation opportunities, so I took this as an opportunity to build a new scheduler and publish my first rust crate, deciding that it needed this set of features: * Job enqueuing: jobs can be enqueued from other threads using a Clone + Send sender. * Recurring jobs: in case a job is not enqueued by some maximum timeout, a job can be automatically enqueued. * Futures: other threads which enqueue jobs should be able to await the results. * Prioritisation: the job queue is executed in priority, followed by submission order * Job merging: any jobs with the same effect should be merged in the queue to avoid unnecessary load. This is probably the most important feature and it brings with it some extra challenges for the other features: * merged jobs with differing priority levels must be merged into the highest priority level * merged jobs with futures awaiting them need to awaken both with the result of the combined job, so the result needs to implement `Clone` so that it can be provided to both. * Parallel execution: multiple worker threads are processing the jobs * Concurrent exclusion: but some jobs need to acquire some lock and so can't run at the same time as each other * Priority throttling: and to leave capacity ready for higher priority jobs we can limit the number of threads which run the lower priority jobs.
13 jul 2022, 16:47

#prog #cpp #article Concept archetypes Concepts in the form added in C++20 used to be called lite. This is because they do not provide one quite important functionality: having the compiler check if the author of a constrained template is only using operations and types allowed by the constraining concept. In other words, we can say that our template only requires operations A and B to be valid, but we can still use some other operations inside and this is fine with the compiler. In this post we will show how this is problematic, even for programmers aware of the issue, and how to address it with 'concept archetypes'.
13 jul 2022, 16:00

#science johnedchristensen.github.io/WebbCompare — сайт, на котором можно наглядно сравнить разницу в качестве снимков телескопов Hubble и Webb. (thanks @bapno_bush)
13 jul 2022, 12:50

Тем временем Windows встретила меня при запуске сообщением о том, что поддержка Windows 8.1 прекратится 10 января 2023 года. Без возможности бесплатно обновиться до версии поновее. А, и ещё рекомендуют купить новый комп для Windows 11 — мол, без этого не будет нормально работать. В число минимальных системных требований входит TPM. Ага, отлично, чтобы на моём компе DRM без нареканий работал. Идите нахер, мелкомягкие. Вместе со своим кривым сайтом, который ссылки на английской версии автоматически перенаправляет на русские, причём на общий раздел, а не на нужную страницу.
13 jul 2022, 09:48

photo content
13 jul 2022, 08:56

#meme
13 jul 2022, 08:56

#prog #rust #cpp #article Building a Cloud Database from Scratch: Why We Moved from C++ to Rust As an early-stage database startup, we entirely deleted our C++ codebase after 7 months of development and rewrote everything from scratch in Rust programming language. Here's how we arrived at a decision and why we think this was one of the best decisions ever. --- Since C++ is not a bad choice for building a database system, why did we rewrite the whole codebase again? Was it due to the same reason as the majority: it is cool? The answer is no; we decide to move to Rust after careful consideration. --- Rust can be challenging for beginners. But our interns proved otherwise. They picked up Rust within one or two weeks — even with no prior Rust/C++ expertise — because there are fewer implicit conversion and overload resolution rules to remember. --- Due to the conservative nature of Rust's static analyzer, we may encounter situations where only unsafe Rust can make the impossible possible. A classic example is creating a self-referential type. Or we must gain extra performance by unsafe, i.e., directly manipulating bits in a compacted memory representation. In either case, it is reasonable for skeptics to ask: will this make the codebase vulnerable? For RisingWave, empirically, no. Two major use cases are LRU cache and Bitmap, which take less than 200 lines out of 170000 lines of code in total.
12 jul 2022, 19:21

#prog #rust #rustlib PGFPlots — a Rust library to generate publication-quality figures. This crate is a PGFPlots code generator, and provides utilities to create, customize, and compile high-quality plots. Пример: use pgfplots::axis::plot::Plot2D; let mut plot = Plot2D::new(); plot.coordinates = (-100..100) .into_iter() .map(|i| (f64::from(i), f64::from(i*i)).into()) .collect(); plot.show()?;
12 jul 2022, 19:07

#prog #rust #article Две совершенно конкретные статьи о том, как ускорить сборку Rust-кода на CI. How I speeded up my Rust builds on GitHub ~30 times Build Rust container images faster using layer caching
12 jul 2022, 19:00