1.83K subscribers
3.3K photos
131 videos
15 files
3.57K links
Блог со звёздочкой.

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

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

Статья о том, как переписали с нуля плеер asciinema на Rust (с компиляцией в WASM) и Solid.js и получили прирост производительности в 50 раз.

(thanks @theLastOfCats)

Цитаты:

"At first I planned to implement the terminal emulation part in Rust without any optimizations, just write idiomatic Rust code, then revisit the tricks from the old implementation. The initial benchmarks blew my mind though, showing that spending additional time on optimizing the emulation part is absolutely unnecessary."

"I still thought I may need to implement some form of terminal state snapshot/restore to support the “seeking” feature. This feature requires feeding the terminal emulator with the whole text stream between the current position and the desired position, or in the worst case when you’re seeking back, feeding the emulator with the whole text from the very beginning of the recording up to the desired position. Optimizing this could be done, for example, by keeping snapshot of the terminal emulator state at multiple time points, sort of like having key-frames every couple of seconds. In ClojureScript implementation this came for free, thanks to the immutable data structures. In the new JS+Rust implementation this would have required extra work, but it turned out, that’s not needed either - clicking on the progress bar in the new player, to jump to the desired time in the recording, results in instantaneous jump, even when it has to feed the emulator with megabytes of data to parse and interpret."
Блог* pinned «Я, кстати, там докладчик, так что это ещё и шанс увидеться со мной вживую. Я бы сказал, какой доклад мой, но вы найдите сами, благо, зная меня, это не сложно.»
#prog #c #article

Статья (от человека из комитета, если что) о том, почему в C всё так плохо и в обозримом будущем не поменяется.
Forwarded from Санечка Ъысь (Anna Weiss)
Forwarded from вафля'
Rust be like: use super::* (use super star)
В СМЫСЛЕ УЖЕ ДЕКАБРЬ
#prog #rust

Да ну надо же!
ДА ВЫ ШУТИТЕ

take* МЕТОДЫ У СЛАЙСА ОДОБРИЛИ С 4-Й ПОПЫТКИ АААААААА

Мне кажется я ждал этого почти пару лет
Идея о том, что человек может (и уж тем более должен) любить только кого-то одного — ограничена и вредна.
#prog #c #article

Статья-руководство из документации к ядру Linux, рассказывающая о том, почему volatile почти никогда не нужен и часто даже вреден.
#prog #rust #rustreleasenotes

Поздравляю Вафеля с вкладом, который добрался до release notes
Тем временем вышел Rust 1.57 (анонс).

tl;dr несколько заинтересовавших меня штук:

panic!/todo!/assert! макросы в константных контекстах
— кастомные профили компиляции (как dev, release, test и bench, но произвольные)
try_reserve методы для коллекций (которые могут вернуть ошибку, если память выделить не получилось)
Iterator::map_while, смесь map и take_while (которую я добавил в стандартную библиотеку!)
Ещё пара моментов, которые я упустил в предыдущем посте:
— Вопрос после вызовов макросов с {} теперь валиден (можно писать m!{...}?)
— Unicode 14.0
— Много функций пометили #[must_use]
Vec::leak теперь не реалоцирует (кто-нибудь знал что он так делал??)
Ordering теперь #[repr(i8)]

Ну и ссылки на полные чейнджлоги (ставьте лайк если тоже забыли про их существование):
Rust: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1570-2021-12-02
Cargo: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-157-2021-12-02
Clippy: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-157