📰 newsreader

hackernews score 1.60 好み 0.62 en

Rust言語の問題点

原題: Problems with the Rust Language

rustrust foundationmemory-safetycorporate influencesoftware rewritesopen source licensingcompiler securityprogramming languages
原文 ↗

日本語訳

# Rust言語における問題点

メモリ安全性は素晴らしい考えだと思います。私は主にC言語のプログラマーであり、メモリ問題のデバッグという「楽しみ」にはあまりにも慣れすぎています。しかし、Rustが採用されているペースは、以下の理由から危険であると考えています。

RustはRust Foundationによって管理されており、同財団は「Rustプログラミング言語によって支えられた、安全でセキュア、かつ持続可能な未来にコミットする独立した非営利団体」と自らを定義しています。なるほど、それは結構なことです。しかし、Rust Foundationを所有しているのは誰でしょうか?その設立メンバーはAmazon、Google、Huawei、Microsoft、そしてMozillaです。「独立」や「非営利」という言葉の意味については一日中議論できるでしょうが、5つの企業が自社に利益をもたらさないと信じてプロジェクトを管理するために集まると考えるのは、あまりに甘いと思います。Rustは、最初から企業の利益に基づいて成長してきた言語です。Rust Foundationの理事会の議席は、年間32万5000ドルという「控えめな」金額で購入できます。

Rustの普及には、ある種の「社会的勢い」があります。取り残されることへの恐怖(FOMO)、古いものを新しいものに置き換える文化、そしてトレンドです。Rustは、他の新しい技術と同じように、疑いの目を持って見られるべきだと私は信じています。Rustは、いつの間にか自分を定義するためのラベルになってしまいました。単にRustを使っているだけで、その人は賢く、進歩的で、安全であると見なされることがあります。Rustは、一部のプログラマーに対して、それが唯一の進むべき道であり、そのトレードオフを批判的に考えることなく使用すべきであると納得させてしまったのです。

Rustコミュニティの主な娯楽の一つであり、今やミームとなっているのが、既存のプロジェクトをRustで書き直すことです。これは私の意見では、セキュリティを高めるための最悪の方法です。Rustの利点を享受することなく、Rustの使用率を高めるための最良の方法なのかもしれません。Rustは魔法ではありません。論理的なエラーを修正することはできません。Rustプログラマーも、依然として優れたプログラマーである必要があります。しかし、車輪の再発明を命じられたとき、優れたプログラマーの力も限定的になります。長年にわたるバグ修正を経て、信頼されテストされてきたソフトウェアを、完全に新しい書き直し版に置き換えることが、いつから望ましいことになったのでしょうか?それが一体どのように安全だというのでしょうか?

この既存プロジェクトを書き直す文化は、(再び)企業に利益をもたらしていると私は信じています。現在、Rustで書き直されることになるプロジェクトの多くは、最初はGPLライセンスで始まり、最終的にはMITライセンスになります。企業は、何らかの形で貢献することなしに、GPLプロジェクトのコードを使用することはできません。Rustによる書き直しを通じてライセンスがMITに変更されると、そのプロジェクトは企業にとって最も利益となるあらゆる目的で使用できるようになります。例えば、ロックダウンされたLinuxディストリビューションを作成し、「デジタル監獄」を作ることなどが挙げられます。要するに、Rustプログラマーは、自社製品にGPLコードを組み込むことによる反発を恐れる企業のために、無償の労働を提供しているのです。彼らは「安全性」や「効率性」という名目のもと、自分自身のために監獄を作るよう騙されているのです。この議論はJody Bruchonによるものです。

Rustのコンパイラにバックドアが含まれている可能性は十分にあります。そして、誰もそれに気づかないでしょう。この最後の点は非常に推測に基づいた陰謀論的なものですが、懸念しているのは私だけではありません。Rustのコンパイラをコンパイルする唯一の方法は、Rust Foundationがリリースした以前のバージョンのバイナリパッケージを使用することです。理論上、このバイナリリリースにはバックドアが含まれている可能性があり、それがブートストラップ中に後続のあらゆるバージョンのコンパイラにコピーされる可能性があります。もちろん、バイナリリリースが完全に問題ないということも十分にあり得ます。それが問題なのです。完全に機能し、使用可能なRustコンパイラの実装が一つしか存在しない以上、Rust Foundationを信頼しなければなりません。その歴史、所有者、そして管理不足による問題の履歴を考えると、私はそれを全く信頼することが難しいと感じます。

これまでの問題に関するとりとめのない話も、解決策を提示しなければ不完全でしょう。私の提案は、「スピードを落とすこと」です。まず、コミュニティは他のプロジェクトを書き換えることで「改善」しようとするのではなく、Rust言語そのものの向上に集中すべきです。私は、そのエネルギーを「GCC Front-End for Rust」プロジェクトに充てることを提案します。これは代替コンパイラであり、バックドアが存在する可能性への懸念を軽減できるものです。現在は開発の初期段階にあります。

これらの問題のどれもが、Rust言語そのもの(Rustがどのように書かれるかを定義する実際の形式文法としての「言語」)の問題ではない、と言えるかもしれません。それは事実です。個人的には、純粋に技術的な観点から見れば、Rustは間違いなくC++よりも改善されていると信じています。しかし、テクノロジーは人間に依存しています。そして、Rustに関連する人々は、必ずしも最善の意図を持っているようには見えませんし、あるいは自分で考えることなく単にトレンドに従っているだけのように見えます。

Rustの言語設計に関する問題について学ぶには、Nimfsoftのブログ記事を読むことをお勧めします。

原文(英語)を表示

I think memory-safety is a great idea. I’m mainly a C programmer and I’m all too familiar with the “fun” of debugging memory issues. But I believe the pace at which Rust is being adopted is dangerous for the following reasons:

-

Rust is managed by the Rust Foundation, which defines itself as “an independent nonprofit committed to a safe, secure, and sustainable future powered by the Rust programming language”. Alright, fair enough. But who owns the Rust Foundation? Its founding members are Amazon, Google, Huawei, Microsoft, and Mozilla. The semantics of “independent” and “nonprofit” could be argued about all day, but I think it would be naïve to trust that five corporations would come together to manage a project without believing it would benefit them. Rust is a language that has been growing from corporate interests since the very beginning. A dedicated seat on the Rust Foundation Board of Directors can be bought for the modest sum of $325,000 per year.1

-

There is a certain “social momentum” when it comes to the spread of Rust. A fear of missing out, a culture of replacing the old with the new, a trend. I believe Rust should be viewed the same way as any new technology—with suspicion. Rust has somehow become a label to identify yourself with. A person can be viewed as smart, progressive, safe, if they simply use Rust. It has managed to convince some programmers that it’s the only way forward, and that it should be used without thinking critically of its trade-offs.2

-

One of the Rust community’s main passtimes, a meme at this point, is rewriting existing projects into Rust. This is in my opinion the absolute worst way to go about increasing security. It might just be the best way to increase Rust usage without receiving any of its benefits. Rust is not magic, it can’t fix logical errors. Rust programmers still need to be good programmers. But even a good programmer’s power is limited when tasked with reinventing the wheel. When did it become desirable to replace reliable, tested software that has been subjected to years and years of bugfixes, with completely new rewrites? How is that safe at all?

-

I believe this culture of rewriting existing projects benefits corporations (again). Currently, projects that usually end up being rewritten in Rust start off with a GPL license, and end up with MIT. Corporations can’t use code from GPL projects without contributing to them in some way. Once the license is changed to MIT through a Rust rewrite, the project is free to be used for whatever purpose benefits corporations the most. An example would be creating locked-down Linux distributions, creating digital prisons. In short, Rust programmers are doing free labor for corporations that fear repercussions from embedding GPL code into their products. They are being tricked into creating a prison for themselves under the guise of “safety” and “efficiency”. I owe this argument to Jody Bruchon.3

-

It’s completely possible that Rust’s compiler contains a backdoor. And nobody would know. Now this last point is highly speculative and conspiratorial, but I’m not the only one concerned about it.4 The only way to compile Rust’s compiler is using a binary package of the previous version released by the Rust Foundation. In theory, this binary release could contain a backdoor that gets copied into any subsequent version of the compiler during bootstrapping. It’s also entirely possible that the binary release is completely fine. That’s the problem. Since there exists only a single fully-functional, usable implementation of the Rust compiler, the Rust Foundation must be trusted. Considering its history, owners, and track record of issues with mismanagement,5 I find it hard to trust it at all.

Now all this babbling about problems would be incomplete without outlining a solution. My suggestion is: slow down. First, the community should focus on improving the Rust language itself instead of trying to “improve” other projects by rewriting them. I propose using that energy to help the GCC Front-End for Rust project6—an alternative compiler which would alleviate the concerns for the possible presence of a backdoor. Currently, it’s in an early phase of development.

It could be said that none of these issues are problems with the Rust language itself—the “language” being the actual formal grammar that defines how Rust is written. This is true. Personally, I believe Rust is undeniably an improvement over C++ on a purely technical basis. But technology relies on people. And the people associated with Rust often don’t seem to have the best intentions in mind, or are just following a trend without thinking for themselves.

To learn about issues with Rust’s language design, I suggest reading Nimfsoft’s blog post.7

← 一覧に戻る