#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/
Forwarded from мне не нравится реальность
Все же уже слышали про новый формат QOI (quite ok image format, qoiformat.org), который lossless сжимает картинки +- так же хорошо, как PNG, но при этом в 20-50 раз быстрее, а его спецификация умещается на одну страницу?
Хотели бы кодинг стрим где я бы подумал вслух и написал бы реализацию энкодера/декодера? 👀
Хотели бы кодинг стрим где я бы подумал вслух и написал бы реализацию энкодера/декодера? 👀
👍9👎3
Forwarded from мне не нравится реальность
👎3👍1
А всё же некоторая польза от [спецоперации] есть: по отношению к ней очень легко понять, кто нормальный человек, а кто — полоумный патриорк
👍24
Forwarded from Таксики и лытдыбр σποραδικος
Анекдот из жизни принесла. Две тётки ругаются в очереди к психиатру. Опуская предысторию, апогей конфликта:
— Вот и правильно вас тут лечат, психованную!
— Да я справку для работы пришла получать! Это тебя тут правильно лечат!
— Да мне рецепт для лежачего нужен!
Внезапно поднимается молчавший мужик:
— Вот меня тут лечат. И если вы не замолчите, я вас обеих покусаю! У меня справка есть, мне можно!
— Вот и правильно вас тут лечат, психованную!
— Да я справку для работы пришла получать! Это тебя тут правильно лечат!
— Да мне рецепт для лежачего нужен!
Внезапно поднимается молчавший мужик:
— Вот меня тут лечат. И если вы не замолчите, я вас обеих покусаю! У меня справка есть, мне можно!
😁24👍3