1.83K subscribers
3.29K photos
130 videos
15 files
3.56K links
Блог со звёздочкой.

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

Небольшое прикольное комьюнити: @decltype_chat_ptr_t
Автор: @insert_reference_here
Download Telegram
#prog #rust #rustlib

syntactic-for — a syntactic "for" loop Rust macro.

Take the sum of the bit-length of four integer types:

let sum = syntactic_for!{ ty in [ u8, u16, u32, u64 ] {
[$( <$ty>::BITS ),*].into_iter().sum::<u32>()
}};
assert_eq!(sum, 120);

Implement a trait for a set of types:

syntactic_for!{ ty in [ u8, u16, u32, u64, u128 ] {$(
impl MyTrait for $ty {
// snip.
}
)*}}

В README есть больше примеров, где такой макрос может пригодиться.
👍15🤯2
No content is NSFW if you W from home
🥴18👍8🤨2🌚1
#prog #article

What if two programs did this?

Или о принципе, который позволяет отвергнуть добавление определённых фич в программную систему.
👍1
#music

Это прекрасно
#meme

Увы, правда
Forwarded from я что-то �� и всё ����
👍14
Forwarded from Санечка Ъысь
😁16👍3
Forwarded from Leslie🌿🇨🇦
😁10
Forwarded from Andrey
Блог*
Photo
ChatGPT — это студент на экзамене?
😁18
Forwarded from ТГ Шевченка
🔥2
Если коротко, то проблема ошибок работы с памятью в том, что они добавляют в программу новые пути исполнения, которых нет в исходнике
🤔13👍7
#prog #article

YAGNI exceptions (перевод)

I'm essentially a believer in You Aren't Gonna Need It — the principle that you should add features to your software — including generality and abstraction — when it becomes clear that you need them, and not before.

However, there are some things which really are easier to do earlier than later, and where natural tendencies or a ruthless application of YAGNI might neglect them. This is my collection so far
...
👍9😁1
#prog #rust #article

Zero To Production in Rust book review

<...>

It provides a comprehensive overview of how to make an API endpoint secure. The section covers Basic Authentication, password verification and storage, password reset, cookies, Session-based authentication, and building an Admin dashboard. I think most of us understand these concepts in abstract terms but implementing it from scratch helps you assimilate that knowledge. IMO it's worth buying the book for this chapter alone.

<...>

If you are stuck, you can join the Discord channel run by the author to ask for help or advice

<...>

One of the things I appreciated most about 'Zero to Production' was the author's emphasis on practical, real-world advice. He provides clear, actionable steps for achieving specific goals. In addition to being a valuable resource for developers, its also an enjoyable read. The writing style is clear and engaging, and is sprinkled with personal anecdotes and light humour to keep things interesting.
#prog #rust #article

Using Rust to write a Data Pipeline. Thoughts. Musings.

<...>

You know, it went better than I expected. Especially for someone like me who has only written about 3 Rust scripts in my entire life. I do have to say, it was not the result I was expecting. I fully intended to find out Rust would be a horrible choice to do normal Data Engineering tasks like HTTP, File Systems, Database calls, etc.

I found the opposite. There was nothing overall complex about any of the code, not tons of boilerplate crud that I expected to encounter with talking with Postgres or getting a file over the wire.

I’m I convinced to throw Python to the trash heap for the mundane Data Engineering tasks and switch to Rust? No. Python’s development and iteration lifecycle is way too easy, you can’t just walk away from that. Is Rust easy to use, easier than most people think, and capable of replacing other code for everyday tasks? Yes.