Блог*
الذهاب إلى القناة على Telegram
Блог со звёздочкой. Много репостов, немножко программирования. Небольшое прикольное комьюнити: @decltype_chat_ptr_t Автор: @insert_reference_here
إظهار المزيد1 924
المشتركون
+124 ساعات
-17 أيام
-830 أيام
أرشيف المشاركات
1 925
#prog #go #article
What’s New in Go 1.22: slices.Concat
<...>
Early versions of the
Concat proposal included a destination slice argument, like append. (Concat(dest []T, ss ...[]T) []T.) Why doesn’t the final version of slices.Concat have a destination argument to allow users to reuse an existing slice as backing?
The issue goes back to what is called the problem of aliasing. <...> But what if you are concatenating the parts of a slice onto itself? Take this example:
s := []int{1, 2, 3, 4}
_ = slices.ConcatWithDestination(s[:0], s[3:4], s[2:3], s[1:2], s[0:1])
// What is s now?
A naïve implementation of slices.ConcatWithDestination would clobber the 1 at the start of the slice with 4 before copying it onto the end of the slice, so that you end up with 4, 3, 3, 4 instead of 4, 3, 2, 1 as intended.
<...>
In the end, it was decided that just always returning a new slice would keep the implementation of slices.Concat simpler and help prevent any issues with accidentally aliasing a slice and getting unexpected results, so the destination slice argument was dropped.1 925
Repost from Дневник ChatGPT
Если бы наша жизнь была телесериалом, то последний сезон был бы таким странным, что даже создатели 'Твин Пикс' сказали бы: 'Это уже чересчур'.
1 925
Repost from N/a
скажите честно, а вы тоже считаете себя самым охренительным в мире инженером, а не average айтишником?
1 925
#prog #rust #article
Writing your own Rust linter
Из-за завязанности на внутренности компилятора по понятным причинам итоговый линтер требует конкретную версию nightly, из-за чего несколько страдает UI, но в целом процесс довольно прямолинейный.
1 925
#prog #rust #article
Making Rust binaries smaller by default
TL;DR: в не-debug профилях теперь по умолчанию убираются отладочные символы из std. С ними hello world в профиле release весит ≈4.3MiB, без них — на порядок меньше.
Смешное:
Funnily enough, this change also made compilation time of tiny crates (like helloworld) up to 2x faster on Linux! How could that be, when we’re doing more work, by including stripping in the compilation process? Well, it turns out that the default Linux linker (bfd) is brutally slow5, so by removing the debug symbols from the final binary, we actually reduce the amount of work the linker needs to perform, which makes compilation faster.
1 925
#prog #rust #rustasync #article
https://xuanwo.io/2024/01-why-sql-hang-for-exactly-940s/
TL;DR: неправильно реализован таймаут в футуре. Почему не использовали timeout из tokio — неясно.
متاح الآن! بحث تيليغرام 2025 — أهم رؤى العام 
