#prog #rust #article
How to speed up the Rust compiler in April 2022 — продолжение серии статей от nnethercote. В этот раз Николас взялся, помимо всего прочего, за оптимизацию декларативных макросов — как их парсинг в самом компиляторе, так и сами эти макросы в популярных библиотеках.
Из-за этой статьи я узнал, что макрос quoteнаписан Толяном является декларативным макросом, а не процедурным, да ещё и использует особую технику для парсинга токенов с контекстом, которая эквивалентна по выразительной силе tt-munchers, но, в отличие от них, не является квадратичной (которую Николас, кстати, и задокументировал).
How to speed up the Rust compiler in April 2022 — продолжение серии статей от nnethercote. В этот раз Николас взялся, помимо всего прочего, за оптимизацию декларативных макросов — как их парсинг в самом компиляторе, так и сами эти макросы в популярных библиотеках.
Из-за этой статьи я узнал, что макрос quote
Nicholas Nethercote
How to speed up the Rust compiler in April 2022
In my last post I introduced the Compiler performance roadmap for 2022. Let’s see how things are progressing. Normally in these posts I mostly write about my own work, but there is enough interesting stuff going on that I will mention work done by other people…
👍5
Forwarded from Кресты на моей кукухе
C++ это очень классный язык
Мой код: пик 1
Результат запуска: пик 2
Перевод ко второй пикче: он здох при попытке создать
Мой код: пик 1
Результат запуска: пик 2
Перевод ко второй пикче: он здох при попытке создать
std::cout
. Как? Я даже знать не хочу🤮9😁4
#prog #rust #c #article
Pointers Are Complicated III, or: Pointer-integer casts exposed
Очередная статья от Ральфа о том, какую семантику должны иметь касты между указателями и числами — предложенный вариант должен существенно упростить абстрактную машину Rust (и C, пусть и в меньшей степени).
Pointers Are Complicated III, or: Pointer-integer casts exposed
Очередная статья от Ральфа о том, какую семантику должны иметь касты между указателями и числами — предложенный вариант должен существенно упростить абстрактную машину Rust (и C, пусть и в меньшей степени).
www.ralfj.de
Pointers Are Complicated III, or: Pointer-integer casts exposed
In my previous blog post on pointer provenance, I have shown that not thinking carefully about pointers can lead to a compiler that is internally inconsistent: programs that are intended to...
👍2🔥1
#prog #rust #article
Improved portability and performance 🦀
Выдержки:
* Why?
In short: There's no standard for building C programs. It's a non-portable mess, and a time sink. Cross-compilation of OpenMP was the last straw. Rust/Cargo is much more dependable, and enables me to support more features on more platforms.
* The platonic ideal portable C exists only as a hypothetical construct in the C standard. The C that exists in the real world is whatever Microsoft, Apple, and others have shipped. That C is a mess of vendor-specific toolchains, each with its own way of doing things, missing features, broken headers, and leaky abstractions. Shouting "it's not C's fault, screw <insert vendor name>!" doesn't solve the problem, but switching to Rust does.
* rayon is a substantial library with thread pools, work-stealing queues, parallel iterators, and many generic interfaces. It being smaller than the "compiler-native" OpenMP was a nice surprise too.
* The hash table implementation in Rust's standard library uses a state-of-the art algorithm, and my C didn't. In theory, nothing stopped me from using the same algorithm in C. In practice, lack of a useful standard library, lack of templates/generics, and the dreadful state of C dependency management did.
Improved portability and performance 🦀
Выдержки:
* Why?
In short: There's no standard for building C programs. It's a non-portable mess, and a time sink. Cross-compilation of OpenMP was the last straw. Rust/Cargo is much more dependable, and enables me to support more features on more platforms.
* The platonic ideal portable C exists only as a hypothetical construct in the C standard. The C that exists in the real world is whatever Microsoft, Apple, and others have shipped. That C is a mess of vendor-specific toolchains, each with its own way of doing things, missing features, broken headers, and leaky abstractions. Shouting "it's not C's fault, screw <insert vendor name>!" doesn't solve the problem, but switching to Rust does.
* rayon is a substantial library with thread pools, work-stealing queues, parallel iterators, and many generic interfaces. It being smaller than the "compiler-native" OpenMP was a nice surprise too.
* The hash table implementation in Rust's standard library uses a state-of-the art algorithm, and my C didn't. In theory, nothing stopped me from using the same algorithm in C. In practice, lack of a useful standard library, lack of templates/generics, and the dreadful state of C dependency management did.
Forwarded from Life of Tau
GitHub
feat: Import cargo-add into cargo by epage · Pull Request #10472 · rust-lang/cargo
Motivation
The reasons I'm aware of are:
Large interest, see #5586
Make it easier to add a dependency when you don't care about the version (instead of having to find it or just using the ...
The reasons I'm aware of are:
Large interest, see #5586
Make it easier to add a dependency when you don't care about the version (instead of having to find it or just using the ...
👍2
Forwarded from Experimental chill
https://danlark.org/2022/04/20/changing-stdsort-at-googles-scale-and-beyond/
В общем, вот. Мы меняем сортировку в libcxx. Это был годовой 20%-й проект у меня, я к нему возвращался и бросал. Я его любил и ненавидел. Я ненавижу все ваши golden тесты до единого, я смеялся с некоторых багов. Я нашёл 15 критичных просто походив по github, в репозиториях с 5к+ звездами :)
Я видел как бинари падают в проде, когда сортировали 31 элемент, а когда сортировали 30, работали дальше.
Я понял, что даже самые простые изменения базовых вещей требуют огромного количества времени, усилий, и все возможные поведения будут увидены и сломаны. Мы точно сделали что-то полезное, я точно сдвинул какой-то неприподъемный груз, который нарабатывался 15 лет в стандартной библиотеке. И мне хочется рассказать как это делать. Перф тоже есть, но он не так важен как возможность получить перф как только кто-то придумает более быструю сортировку.
Пораньше получилось. Устал я это писать, 7к слов почти :)
Have fun
https://news.ycombinator.com/item?id=31098822
В общем, вот. Мы меняем сортировку в libcxx. Это был годовой 20%-й проект у меня, я к нему возвращался и бросал. Я его любил и ненавидел. Я ненавижу все ваши golden тесты до единого, я смеялся с некоторых багов. Я нашёл 15 критичных просто походив по github, в репозиториях с 5к+ звездами :)
Я видел как бинари падают в проде, когда сортировали 31 элемент, а когда сортировали 30, работали дальше.
Я понял, что даже самые простые изменения базовых вещей требуют огромного количества времени, усилий, и все возможные поведения будут увидены и сломаны. Мы точно сделали что-то полезное, я точно сдвинул какой-то неприподъемный груз, который нарабатывался 15 лет в стандартной библиотеке. И мне хочется рассказать как это делать. Перф тоже есть, но он не так важен как возможность получить перф как только кто-то придумает более быструю сортировку.
Пораньше получилось. Устал я это писать, 7к слов почти :)
Have fun
https://news.ycombinator.com/item?id=31098822
Experimental chill
Changing std::sort at Google’s Scale and Beyond
TL;DR; We are changing std::sort in LLVM’s libcxx. That’s a long story of what it took us to get there and all possible consequences, bugs you might encounter with examples from open so…
Forwarded from Технологический Болт Генона
Тред в Мастодоне
https://mastodon.ml/@vladimir/108140472475210443
Происходит так конечно же не только в СНГ. Но GPL, есть GPL, код надо открывать.
https://gitlab.com/fdroid/fdroidclient под лицензией GPLv3
https://gitlab.com/fdroid/fdroidserver под лицензией AGPLv3
В оригинальном посте неправильная ссылка, правильная будет https://ruplay.market/
https://mastodon.ml/@vladimir/108140472475210443
Происходит так конечно же не только в СНГ. Но GPL, есть GPL, код надо открывать.
https://gitlab.com/fdroid/fdroidclient под лицензией GPLv3
https://gitlab.com/fdroid/fdroidserver под лицензией AGPLv3
В оригинальном посте неправильная ссылка, правильная будет https://ruplay.market/