Блог*
Ir al canal en Telegram
Блог со звёздочкой. Много репостов, немножко программирования. Небольшое прикольное комьюнити: @decltype_chat_ptr_t Автор: @insert_reference_here
Mostrar más1 923
Suscriptores
-124 horas
-27 días
-630 días
Archivo de publicaciones
1 923
Repost from Awful Rust snippets for fun and profit
parsing sequences (like dates or version strings) by matching on part index
playground
original example
thanks to @kanashimia for suggesting this one!
1 923
#prog #rust #article
Fish 4.0: The Fish Of Theseus
Довольно подробно описывают различные моменты, возникшие во время переписывания. Советую к прочтению — возможно, портирование далеко не так сложно для вашего проекта, как кажется.
The port wasn’t without challenges, and it did not all go entirely as planned. But overall, it went pretty dang well. We’re now left with a codebase that we like a lot more, that has already gained some features that would have been much more annoying to add with C++, with more on the way, and we did it while creating a separate 3.7 release that also included some cool stuff.
(thanks @teamerlin)
1 923
#prog #rust #article
Compiling C to Safe Rust, Formalized (PDF)
<...> We instead explore a different path, and explore what it would take to translate C to safe Rust; that is, to produce code that is trivially memory safe, because it abides by Rust's type system without caveats. Our work sports several original contributions: a type-directed translation from (a subset of) C to safe Rust; a novel static analysis based on "split trees" that allows expressing C's pointer arithmetic using Rust's slices and splitting operations; an analysis that infers exactly which borrows need to be mutable; and a compilation strategy for C's struct types that is compatible with Rust's distinction between non-owned and owned allocations.
We apply our methodology to existing formally verified C codebases: the HACL* cryptographic library, and binary parsers and serializers from EverParse, and show that the subset of C we support is sufficient to translate both applications to safe Rust. Our evaluation shows that for the few places that do violate Rust's aliasing discipline, automated, surgical rewrites suffice; and that the few strategic copies we insert have a negligible performance impact.
По понятным причинам подход авторов покрывает лишь некоторое подмножество C, но вроде достаточно обширное для написания реалистичных программ.
Парочка претензий:
1. Написанный авторами инструмент пока что отсутствует в публичном доступе, поскольку "will be made public after the review process" (который, судя по всему, ещё не пройден).
2. Два примера кодовых баз, на которых автора проверяли свой инструмент, не были написаны изначально на C, а были написаны, как DSL в F* (для верификации одновременно с трансляцией в C) — на более реалистичных программах подход может показать себя менее эффективно.
1 923
#prog #rust #article
Four limitations of Rust's borrow checker
In this post, I’ll cover four surprising limitations of the borrow checker that I ran into in the course of my work.
Also note that when I say something can’t be done, I mean that it can’t be done in a way that leverages Rust’s type system, i.e. with static type checking. <...>. It’s never the case that you literally can’t solve a problem at all, since there are always those escape hatches (and I’ll even show examples of an escape hatch I used below), but it is impossible to solve the problem in a way that makes Rust Rust.
1 923
Repost from N/a
Короче.
У нас по соседству с кладбищем находится цирк.
И если это не объясняет всю нашу жизнь, то что тогда.
1 923
#prog #rust #article
Thoughts on Rust hashing
Или о том, как дизайн API для хеширования в Rust напрямую ведёт к неэффективностям.
1 923
#prog #article
Storing currency values: data types, caveats, best practices
This article is not the final source of the truth, but it contains useful information that you should take into consideration when designing software.
¡Ya disponible! Investigación de Telegram 2025 — los principales insights del año 
