#prog #cpp #article
On push_back_unchecked: Performance with FromIterator and Collect
TL;DR: в другом посте предлагали добавить в вектор операцию
On push_back_unchecked: Performance with FromIterator and Collect
TL;DR: в другом посте предлагали добавить в вектор операцию
push_back_unchecked, которая не проверяет ёмкость перед записью (и, соответственно, на полном векторе даёт UB). Замеры показали, что это даёт ускорение по сравнению с push_back в цикле. Автор же этой статьи сделал API FromIterator (взятый из std Rust) для своей библиотеки контейнеров и показал, что для таких юзкейсов можно добиться сопоставимого ускорения по сравнению с std::vector без возможности вляпаться в UB.An Update on Writing Memory Safety Bugs
On push_back_unchecked: Performance with FromIterator and Collect
Encapsulating Undefined Behaviour in the C++ Standard Library for Performance with Safety
🔥8❤1
#prog #rust #rustlib #article
Surelock
Работает и на no_std, полагается на lock_api для абстрагирования от реализации взаимной блокировки.
Surelock
Deadlocks are a solved problem in theory — we’ve known how to prevent them since 1971. The challenge is making that prevention ergonomic enough that people actually use it. Surelock is my attempt at that: lean into Rust’s type system to make the correct thing the easy thing, and make the wrong thing a compiler error.
Работает и на no_std, полагается на lock_api для абстрагирования от реализации взаимной блокировки.
👍6
Forwarded from елуп
До сих пор у некоторых висит
Вчера все большие бренды России (и каналы, включая моего) случайно прорекламировали криптоказино. Это крупнейшая подстава в истории Telegram.
После того, как все запостили свои посты с эмодзи «Черновик:», создатель набора продал его криптоказино. В названии набора сразу же появился ник со ссылкой на канал этого криптоказино.
В результате в вечер пятницы сотням СММщиков пришлось делать новый пак, чтобы избавиться от троянского коня. При этом маркетинговый трюк для казино не сработал — у них как был маленький канал, так и остался.
Вчера все большие бренды России (и каналы, включая моего) случайно прорекламировали криптоказино. Это крупнейшая подстава в истории Telegram.
После того, как все запостили свои посты с эмодзи «Черновик:», создатель набора продал его криптоказино. В названии набора сразу же появился ник со ссылкой на канал этого криптоказино.
В результате в вечер пятницы сотням СММщиков пришлось делать новый пак, чтобы избавиться от троянского коня. При этом маркетинговый трюк для казино не сработал — у них как был маленький канал, так и остался.
😁33
#prog #article
ntoh*/hton* is a bad API
ntoh*/hton* is a bad API
But my point is not to bash C.
My point is that this API quirk fundamentally changes how people think about endianness, making them commit mistakes they wouldn’t make otherwise. Many people think integers have an intrinsic endianness, or prefer textual formats to seemingly avoid dealing with endianness, and I have held all these convictions myself at some point.
It’s not that people are stupid. It’s borderline impossible to make the same mistakes if you treat endianness as a parameter of a serialization format. But C doesn’t want you to think about it this way, and so you never realize you were lied to until you get a reason to think hard about it.
🔥7👍5👏1🤡1
Forwarded from Dani-myte 🧨 (Dolores Dei)
I'm not sexually active nor inactive
I'm sexually passive aggressive
I'm sexually passive aggressive
👌4🌚4❤1
Forwarded from Programming sucks
It took thousands of talented people decades of hard work and innovation to build the giant and deep iceberg, that is the computer software infrastructure of today. I know that you are ignorant of the complexity of what you can’t comprehend, but if you think a fancy autocomplete machine has the slightest chance of maintaining this monumental human achievement, expand on it and keep it running for the years to come, then you might be in for an unpleasant surprise.
https://www.atns.net/post/don-t-vibe-over-what-you-don-t-understand
Confessions on a keyboard
Don’t vibe over what you don’t understand
I was in my first year of college studying programming. Not to brag, but it wasn’t very challenging because I started writing code at 13 and it was breezy. I was sitting with a dorm buddy of mine who was studying mechanical engineering and we were having…
👍6
Forwarded from Влад не шутит
Проджект-менеджеры раньше: девять женщин смогут родить ребенка за месяц.
Проджект-менеджеры сейчас: восемь ИИ-агентов и одна женщина наконец сократит ТТМ и сможет родить ребенка за месяц.
Проджект-менеджеры сейчас: восемь ИИ-агентов и одна женщина наконец сократит ТТМ и сможет родить ребенка за месяц.
😁31💯5
Forwarded from AlexTCH
https://elixir-lang.org/blog/2026/01/09/type-inference-of-all-and-next-15/
For about five years Elixir contributors have been working on integrating a type system into the language and tooling. Starting with the development of a pretty novel and unorthodox type system.
I'm fascinated by several things:
— they still haven't dropped the project. Despite slow progress and obstacles in performance and usability they systematically overcome.
— they are deeply committed to the soundness of their gradual type system, which is tricky (and to my eyes they sometimes confuse soundness and completeness in the blogs at least)
— they put end-user (developer) usability front and center, in terms of speed and responsiveness, type inference to reduce annotation burden, meaningful error messages, etc.
Towards that goals the post references their work on
https://elixir-lang.org/blog/2023/09/20/strong-arrows-gradual-typing/
and the development of
https://elixir-lang.org/blog/2025/12/02/lazier-bdds-for-set-theoretic-types/
which are cool in their own right.
For about five years Elixir contributors have been working on integrating a type system into the language and tooling. Starting with the development of a pretty novel and unorthodox type system.
I'm fascinated by several things:
— they still haven't dropped the project. Despite slow progress and obstacles in performance and usability they systematically overcome.
— they are deeply committed to the soundness of their gradual type system, which is tricky (and to my eyes they sometimes confuse soundness and completeness in the blogs at least)
— they put end-user (developer) usability front and center, in terms of speed and responsiveness, type inference to reduce annotation burden, meaningful error messages, etc.
Towards that goals the post references their work on
https://elixir-lang.org/blog/2023/09/20/strong-arrows-gradual-typing/
and the development of
https://elixir-lang.org/blog/2025/12/02/lazier-bdds-for-set-theoretic-types/
which are cool in their own right.
The Elixir programming language
Type inference of all constructs and the next 15 months
Today we celebrate 15 years since Elixir’s first commit! To mark the occasion, we are glad to announce the first release candidate for Elixir v1.20, which performs type inference of all language constructs, with increasing precision.
🔥5👍2
Forwarded from partially unsupervised
Семь лет назад я занимался AR примеркой обуви. Однажды к нам пришел один из VC партнеров и спросил: "а почему у вас в приложении нет allbirds? В Долине все только их и носят".
Процедура добавления новой модели предполагала покупку физической пары, потом их сканировали, делали фотограмметрию, а результат доводили до ума руками. Так на полке со скопившейся обувью осталась пара allbirds ровно моего размера, и при увольнении мне ее подарили.
С тех пор я стоптал пар пять этих прекрасных кроссовок разных цветов, они подходили мне идеально. И вот эпоха ушла: allbirds официально переключаются с обуви на GPU инфраструктуру. Раньше мы нагружали видеокарты, чтобы рендерить их кроссовки, теперь они сами будут продавать GPU-часы.
Процедура добавления новой модели предполагала покупку физической пары, потом их сканировали, делали фотограмметрию, а результат доводили до ума руками. Так на полке со скопившейся обувью осталась пара allbirds ровно моего размера, и при увольнении мне ее подарили.
С тех пор я стоптал пар пять этих прекрасных кроссовок разных цветов, они подходили мне идеально. И вот эпоха ушла: allbirds официально переключаются с обуви на GPU инфраструктуру. Раньше мы нагружали видеокарты, чтобы рендерить их кроссовки, теперь они сами будут продавать GPU-часы.
🤩8