1.96K subscribers
3.91K photos
149 videos
15 files
4.06K links
Блог со звёздочкой.

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

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
Опросы на работе би лайк
🌚23🍌6😁3
OOP stands for "Overly obfuscated programming"

#предложка
💯24🫡4👍2❤‍🔥1
#prog #rust #meme

r/rustjerk, откуда ж ещё
12😭4
Forwarded from trace!("TheBestTvarynka") (Pavlo Myroniuk)
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.
👍63
#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 позволяет указывать на полях, в каких модулях его можно изменять:

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 напрямую.
👍8👎4
👁👄👁
😁31🍌5🔥1
😁38😭4
Отвратительно
😁13
#article

Some thoughts on writing (от Dan Luu)

I see a lot of essays framed as writing advice which are actually thinly veiled descriptions of how someone writes that basically say "you should write how I write" <...>

<...> if you're trying to figure out what stylistic choices are right for you, you should start from your goals and what you're good at and go from there, not listen to somebody who's going to tell you to write like them. Besides being unlikely to work for you even if someone is able to describe what makes their writing tick, most advice is written by people who don't understand how their writing works.

Как это часто у Dan Luu бывает, у эссе несколько дополнений, некоторые из которых с основной темой связаны несколько косвенно.
8
😁31
😁27🤣5
— Why do you like him so much?
— Because he
11🤮5😁2👎1💩1
#prog #amazingopensource

typos — source code spell checker

Finds and corrects spelling mistakes among source code:

* Fast enough to run on monorepos
* Low false positives so you can run on PRs

github.com/crate-ci/typos

Разумеется, можно настроить исключения, на которые линтер не будет реагировать.
🤔8👍4🔥2
Блог*
#prog #rust #article Rust threads on the GPU
#prog #rust #article

Rust SIMD on the GPU

Код на Rust, использующий core::simd, может быть использован на GPU без изменений на уровне исходников!

К сожалению, на текущий момент применимость этого подхода несколько ограничена, поскольку core::simd всё ещё закрыта за фичей portable_simd, и авторам пришлось внести изменения в компилятор для устранения оверхеда.
🔥5👍32
#meme про европейских мужчин
13🤷5💯4😁3🖕2👍1🤔1💩1
Forwarded from pride memes
Папа Франциск в автобиографии сообщил что быть геем ок. Это русский перевод
😢17😁8🤮6💩3🌚1
#meme про... Wrong
23😁1
#prog #rust #article

Downcasting Arcs in Rust

...И о том, как можно (небезопасно) сделать это настолько дешёвым, насколько возможно
👍1🤔1