LINUX.ORG.RU
Форум — Talks  

Вот и mold переписали на Rust'е

 ,


0

2

Собссна, сабж.

we have rewritten mold from C++ to Rust, and this is the first release of the Rust version. 2.42.1 is the last release of the C++ version. we have rewritten mold from C++ to Rust, and this is the first release of the Rust version. 2.42.1 is the last release of the C++ version.

mold is now built with Cargo instead of CMake. It requires Rust 1.95 or later and a C compiler. Run cargo build --release to build mold and ./install-mold.sh to install it; the install script accepts PREFIX and DESTDIR. The CMake options have been removed.

https://github.com/rui314/mold/releases/tag/v3.0.0

★★

Последнее исправление: Ololo_Trololo (всего исправлений: 1)

Ещё бы написать, что за mold такой…

mold is a high-performance drop-in replacement for existing Unix linkers, designed to speed up builds.

Понятно, что-то на низкоуровневом. Нам, python-падаванам ненужное :)

Ну переписали, и переписали, может и не плохо. Лишь бы не с закрытыми глазами отдали ии с шептанием Клод, Клод, Клод…

skyman ★★★★★
()
Ответ на: комментарий от buddhist

Когда компилируешь большую программу типа браузера, на линковку довольно ощутимое время уходит.

unC0Rr ★★★★★
()
Ответ на: комментарий от Ololo_Trololo

Если модный и быстрый, то всё логично. Должен быть на расте.

bbc69
()

И теперь линкер на расте стал бесполезным для быстрой сборки дистрибутивов с «нуля». Пока соберутся все зависимости для так называемого языка «системного программирования» раст, используя стандартный линкер, то выигрыша по времени потом с mold уже практически и нет.

Having to build all dependencies of rust including python and openssl and everything else before being able to use mold erases most of the full-tree build speedups as the path to rust is already about 80% of the full tree build time.

https://news.ycombinator.com/item?id=49969363

Rust requires python and perl and musl and openssl and 80% of the entire wall time of building the whole tree.
Rust is the single most expensive thing to bootstrap in any given linux distro.

https://news.ycombinator.com/item?id=49969446

The earliest we can bootstrap a go compiler is about 10 minutes. It builds directly from tinycc. Add 6 hours for our fastest compile of the shortest path to rust, with 192 cores.
I am a rust fan too, but it is the worst language to bootstrap, which is why for systems programming I still must often revert to C to have a small and reviewable and fast to build dependency surface.

https://news.ycombinator.com/item?id=49969714

Начало драмы:

https://news.ycombinator.com/item?id=49967270

P.S. Хочется верить, что где-то там тихо уже работают над заменой раста как языка системного программирования.

gag ★★★★★
()
Ответ на: комментарий от gag

уже работают над заменой раста как языка системного программирования

…на еще более жирное поделие.

wandrien ★★★★
()

В https://github.com/rui314/mold/releases/tag/v2.42.1 он интереснее написал:

...
Rewrite in Rust
We are rewriting mold from C++ to Rust, and 2.42.1 is likely to be the last C++ version of the linker unless we need to make another patch release. The Rust version of mold will be released as mold 3.0. A tool like mold needs to be developed with the expectation that it may remain in use for decades. Given that expected lifespan, mold is still relatively early in its life, and we believe that rewriting it in Rust at this point is the right decision.

When I started developing mold in 2020, Rust was still a relatively new language. By 2026, however, Rust has matured into a practical choice for systems software. Rust offers performance comparable to C++ while providing strong safety guarantees such as memory safety. If a C++ program can be rewritten in Rust without too much difficulty, rewriting it in Rust has become an increasingly attractive option.

Rewriting an established program like mold carries risks. Recent advances in AI-assisted coding have made large-scale rewrites considerably more practical, but they do not eliminate those risks, and we do not take them lightly. We understand that the stakes are high. People trust mold because it just works, and we cannot afford to lose that trust. Some users may understandably be concerned about this change, and we will keep that in mind throughout the rewrite. Our goal is that, from a user's perspective, mold 3.0 will continue to work just as before, with only the implementation under the hood having changed.
...
dataman ★★★★★
()
Ответ на: комментарий от gag

P.S. Хочется верить, что где-то там тихо уже работают над заменой раста как языка системного программирования.

Вот только киллер фичей раста заявлялось совсем другое.

bbc69
()

Дипсик по умолчанию всегда в начале предлагает питон
Потом, когда упираешься в производительность, он начинает предлагать си
Потом вдруг оказывается, что си нифига не быстрее
И ты ему - а давай ка дружок перепишем на расте
И как правило, это всегда быстрее всего

kto_tama ★★★★★
()
Ответ на: комментарий от gag

стал бесполезным для быстрой сборки дистрибутивов с «нуля»

Трагедия-то какая

moonmadness ★
()
Ответ на: комментарий от buddhist

Я на проекте из всего полусотни модулей упираюсь в производительность GNU Make. Правда, в основном, под виндой, в линуксе ещё пристойно… Ну и задумчивость компоновщика тоже видел (под всеми ОС).

hobbit ★★★★★
()
Ответ на: комментарий от kto_tama

Потом вдруг оказывается, что си нифига не быстрее
И ты ему - а давай ка дружок перепишем на расте

С этого двустишия поподробнее, пожалуйста.

Ты про время сборки своего проекта или про время работы? (Если первое, то охотно верю, кстати. Даже древний турбопаскаль в сборке был заметно шустрее тогдашнего си. Потому, что там, как и в расте, были нормальные модули, а не страшные препроцессорные костыли на изоленте из времён K&R.) А вот если про второе – сильно интересно…

hobbit ★★★★★
()
Ответ на: комментарий от hobbit

Я про время работы
Он сначала написал питоновскую версию с использованием библиотеки numba
Потом написал сишную версию в связке C+GMP
И внезапно сишная версия по скорости работы оказалась медленнее

kto_tama ★★★★★
()

https://github.com/rui314/mold/commit/6c0d6889667b2070046ec8923724df64bc035eff

Drop ARM64 BTI, PAC and GCS support This reverts f03b745, 48428d3 and 3a1b9c6, which merged GNU_PROPERTY_AARCH64_FEATURE_1_AND, emitted BTI PLTs and landing pads for range extension thunks, and added -z force-bti, pac-plt, gcs, bti-report and gcs-report.

GCC 16 no longer records -mbranch-protection in .note.gnu.property but in AArch64 build attributes, which we don’t read, so outputs silently lost the BTI, PAC and GCS bits and -z force-bti warned about every object file. We’ll bring the feature back with build attribute support after 3.0.0. Until then, ARM64 outputs have no .note.gnu.property, as in 2.42.1.

Начал он с того, что дропнул всё что не мейнстрим. Наверное токены закончились и не смог починить.

PPP328 ★★★★★
()
Ответ на: комментарий от dataman

Там буквально коммиты от Claude и Authored-By Claude.

PPP328 ★★★★★
()
Ответ на: комментарий от PPP328

Начал он с того, что дропнул всё что не мейнстрим.

Помянем.

wandrien ★★★★
()

переписали

ок

А где вопли про 100500 use after free, или это не обязательное условие? С какой целью переписывали?

ant1
()
Ответ на: комментарий от unC0Rr

Когда компилируешь среднюю программу на rust, на линковку довольно ощутимое время уходит.

fix.

AlexVR ★★★★★
()
Вы не можете добавлять комментарии в эту тему: только для зарегистрированных, score>=50.