Блог*
رفتن به کانال در Telegram
Блог со звёздочкой. Много репостов, немножко программирования. Небольшое прикольное комьюнити: @decltype_chat_ptr_t Автор: @insert_reference_here
نمایش بیشتر2 000
مشترکین
+224 ساعت
+147 روز
+2130 روز
آرشیو پست ها
1 993
#prog #rust
Call for testing: Restricting trait implementability and field mutability
Две фичи на nightly.
impl_restriction позволяет указать на определении трейта, в каких модулях можно писать его реализацию.
pub mod foo {
pub mod bar {
pub(crate) impl(super) trait Foo {}
}
// `Foo` may be implemented here.
impl bar::Foo for i8 {}
}
// Error: `Foo` cannot be implemented here.
impl foo::bar::Foo for u8 {}
`mut_restriction позволяет указывать на полях, в каких модулях его можно изменять:
``rust
pub mod foo {
pub struct Bar {
pub mut(self) alpha: &'static str,
}
impl Bar {
pub fn mutate_inner(&mut self) {
// alpha may be mutated here.
self.alpha = "inner";
}
}
}
impl foo::Bar {
pub fn mutate_outer(&mut self) {
// Error: alpha cannot be mutated here.
self.alpha = "outer";
}
}
`
Первая фича с `impl(crate)` позволяет выразить паттерн sealed trait напрямую.1 993
Repost from trace!("TheBestTvarynka")
Another interesting tool that I found in the Rust Ukrainian Community chat: https://niche.rs/
Rust type layout & niche optimization visualizer.You type any Rust type and it will visualize that type layout. Pretty interesting to watch and experiment. If I had known about the
niche earlier, I would have used it to teach students about structure layout, padding, and related optimizations.1 993
Бесит, когда игроки отказываются приходить на ролёвки по надуманным поводам. Типа "у меня завал по работе", или "я не в стране", или вообще "у нас в семье новый ребёнок"
1 993
#science #video
Немного о том, насколько странно вибрируют струны музыкальных инструментов
youtu.be/sYdXa_yp0fc
1 993
Repost from Технологический Болт Генона
Кто там жаловался на инсталляцию вида
curl https://... | sh?
Вот вам вариант получше
> SQL interface for Ghidra program databases. Query functions, cross-references, types, decompilation output, and more using standard SQL.
https://github.com/0xeb/ghidrasql
Install with an AI agent (recommended) The fastest way to get ghidrasql running end-to-end is to point an AI coding agent (Claude Code, Cursor, Codex, Aider, etc.) at the bundled installer prompt: install-prompt.md
1 993
Repost from N/a
Снова порадовался тому, что Safari хранит историю в SQLite, хоть и добраться до файла не так уж и просто из-за огораживания macOS.
У меня отключена очистка истории в настройках браузера, уж и не помню с каких пор. И когда я перключаю настройку в "забывать всё, спустя год", Safari говорит, мол, ты точно хочешь удалить 100000 записей? При этом сам Safari колдобится от такого объёма истории, но продолжает терпеть, раз я решил хранить всё 🤪
Короче говоря, я периодически хожу и грохаю поиски, ссылки на youtube, на Gmail. Последний вообще любит намусорить в историю, хотя сама идея вынести состояние в URL и неплохая. Вот и сегодня я сходил, для разнообразия с помощью duckdb, вспомнил схему, прогнал парочку "
DELETE FROM ... WHERE url LIKE ...", а потом полирнул с помощью VACUUM. Прямо приятно стало от такой мощи в моих ручищах!1 993
#prog #zig #article
Собственно, именно по этой причине в Zig запретили использование LLM вообще.
Contributor Poker and Zig's AI Ban
TL;DR: Zig foundation заинтересованы в том, чтобы контрибуторы вовлекались в сообщество и набирались экспертизы, а использование LLM очень часто на практике означает отсутствие желания разбираться и оставаться с сообществом.
1 993
#prog #rust
rust-lang/rust is adopting an LLM policy
TL;DR: политика формализует правила, которые уже были неофициально.
I've seen LLMs causing three main issues for our community: * Polished technical products no longer indicate effort and understanding. * Making code easier to write exacerbates our existing issues with review bandwidth. * People mechanically copy-pasting to and from an LLM is a waste of our time. As time went on, these issues grew and grew, until we had to create dedicated channels and moderation policy for how to deal with them. However, those channels work against our goals of being transparent and welcoming, because new contributors have no idea what the rules are. The new policy formalizes those rules publicly, so that new contributors know how to join our community without getting their PRs closed for reasons they don't understand, and so that existing reviewers can easily point to the rules as an actionable reason when closing PRs that don't follow them.
1 993
Repost from HN Best Comments
Re: Google fixed more Chrome bugs in June than over the past two years, thanks to AI
To me this merely signals how broken C++ development really is. Most if not all of the bugs being uncovered are memory related and therefore intimately tied to the mental memory model of C and C++, namely manual memory management.
It's fine for a C or C++ program encompassing a couple hundred lines but beyond that it's a liability.
C and C++ are simply not fit for purpose when large scale software projects are concerned. All of these need to be ported to Rust or another memory-safe language ASAP to prevent mayhem.
The hundreds if not thousands of developers working on Chrome weren't idiots who didn't know what they're doing. The complexity of programming in C/C++ is simply beyond most intelligent individuals' ability to get perfect all the time.
hn_submit, 1 day ago
