Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp5051534pxy; Tue, 27 Apr 2021 19:52:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR4Zlwj6HzOc0oShCMEy4tKnDRQVkFUHEDN3+MTyMbymwzM3thk2WLqzJ7SZZGGV8h/l5s X-Received: by 2002:a17:90a:5907:: with SMTP id k7mr1576280pji.197.1619578364836; Tue, 27 Apr 2021 19:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619578364; cv=none; d=google.com; s=arc-20160816; b=KJrZR8QqUchO5QaZ9Boa8NStbY4ZByJAxylo/2vvA733IS4uK8zkANwa1fPmREjrR+ QHsOKxxGGQfmi7MZ5WBo6ofT7mQraGN6ix2abWg75D7TZ5zd3QviZpKkp+lsNkWyQMwR vShot/zEIVlm77IZ6KPv7mzJau8yl3yBu1zaJc7iZOE7OkCyyhxfoHONIGYVg/NcULNt kHWmen0ZHspd3K+zOUo2vy4nyoE903+MoB2wTjulzx++DQ2eDz3Ip2SS5C+VbT9rWtTf XXGe9beX4YlkBMB0ybRhSoWkPz/7fmlthpniuZwu3kM+m9yMCDcLhDtBCjvKHVJ6I8kr E39A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=COKqeIfX+x/8KkgUZa6JpkF1XncnNdp8WaLgOOuA0IY=; b=nW0IuCh4DIwDL8zbkbaHaf1j8dSd91r0svpCkapOZYb1xL3FQW1PI5zL1/18SiIO5p 0xIBXZRYaQYbUX5vbguAt3/hRPMPYtC5NyHvRiExkKfqVa47FI61D+LkWy17/khl3RfP Zr806ncwlkX4x7YgKgMQV2PBxOTSyT7ZKwPlMfWpLttT9StPsVX/jYNzDuhPogM4Ng1Y kXpk7zlJO9KYOJh1BpaHM/isyYTxEUXKn5WVgPP+gpmYHrOX5bx2dB22QM4h42rWhNZJ 1Z3cr4tP+bbZ/5ku7bWmtTG57AmKYlzMvcjlzOcIZHqDnt3k6PU6/nsnQILUct9Q79gW Eepg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Trt07zXk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si1525734ply.431.2021.04.27.19.52.32; Tue, 27 Apr 2021 19:52:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Trt07zXk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239561AbhD1Cwk (ORCPT + 99 others); Tue, 27 Apr 2021 22:52:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235839AbhD1Cwj (ORCPT ); Tue, 27 Apr 2021 22:52:39 -0400 Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B184C061574; Tue, 27 Apr 2021 19:51:55 -0700 (PDT) Received: by mail-vs1-xe32.google.com with SMTP id w24so7158988vsq.5; Tue, 27 Apr 2021 19:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=COKqeIfX+x/8KkgUZa6JpkF1XncnNdp8WaLgOOuA0IY=; b=Trt07zXkQCd5/Gl6NZgnfd/L8C5o0jd2A4Kkux953c/3b26vUROyGKl2so7L2TRp6a geqWh9KkxDQjE6shN9l8XILV8gUaasgMCUOHd2nmkhjPNg2sFz/WK2MrAcGFh4k+TvSW KxDQ5JALCp+SZoIw7Mr+CVVo1bydvqGFxv38wO4pftFP/og83TFCg2Mnk1M4EM4iW02g H4rzQUuUOTR9v+iR1rySoG9qgr3UmCuq5sFneAofLfMl+yfoedylwSWcrq5+OhJ7KzLv uG6LwqqLGTNsOAZKV8W4LNPYZj5dwKbjhvPoWA2ysULq7XXT/mpB5USp+GXSnqfD7+c8 SXKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=COKqeIfX+x/8KkgUZa6JpkF1XncnNdp8WaLgOOuA0IY=; b=AajeDCLF7fA6nwVJsWSH5TYIS8KZP/olrRTDTquoaaXxyR+4JF3/uE2FjpJFogc2fe ZLJ/o2FXZr+kF6/Wy/mr5CNvCQIURVZo3rauJgrYQePGFSQh0POmjXcFp82BtRme8+k/ rMNI6o6ZzocYOMI86Lc40Zfn8az+3tU5K06WlkN2LCyLuujsfgDJ4t2qK6RK/rrG4EsE 0BxVKhQlDXv3tDVrOUePl15RYWF+4qUdmTjPXGkCHIJs/Illr1b2qZVhgibcuwG8Kmcb E2g98pIVxTR+cGtBF12AJiQ9/OIsfjnGndE7j7hWry0FU0TVvwLYyQsPImjGW3D8gmvM 3KZg== X-Gm-Message-State: AOAM531C+lSesUxSl4aFRMRLlRsRnoKteCkzqffJiDxyqmrY1tdxyq+/ ccU13bF65lC0DEF5+0tygvvRAJC1DQ5qCjfFEDQ= X-Received: by 2002:a67:f503:: with SMTP id u3mr22446168vsn.3.1619578314269; Tue, 27 Apr 2021 19:51:54 -0700 (PDT) MIME-Version: 1.0 References: <20210414184604.23473-1-ojeda@kernel.org> In-Reply-To: From: Kyle Strand Date: Tue, 27 Apr 2021 20:51:43 -0600 Message-ID: Subject: Re: [PATCH 00/13] [RFC] Rust support To: Linus Walleij Cc: Miguel Ojeda , Wedson Almeida Filho , Peter Zijlstra , Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , linux-kbuild , Linux Doc Mailing List , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, I wanted to shed some light on one specific point of your criticism of The Rust Programming Language: > What I find very disturbing is that the authors of the Rust language did NOT write it. Rust, unlike C when the K&R book was written, has already had a pretty large number of people contribute to its development. Steve Klabnik and Carol Nichols are 6th and 11th, respectively, on the list of contributors with the most commits in the Rust compiler & standard library (from the official "thanks" page, excluding the top committer "bors", which is part of Rust's CI automation: https://thanks.rust-lang.org/rust/all-time/). I hope this clears up some confusion. > What we need is a good resource to learn it, that skips the trivial aspects of the language and goes immediately for the interesting details. I realize that what is "trivial" and what is "interesting" is subjective, but if you find the explanation of traits in the Book difficult to understand, I would recommend revisiting the earlier sections in order to be certain you understand the foundations for the explanation of traits. For what it's worth, since you would specifically like a lower-level perspective, in addition to looking at the Reference (as previously suggested), I recommend trying O'Reilly's Programming Rust by Jim Blandy and Jason Orendorff. Kyle Strand On Tue, Apr 27, 2021 at 5:14 AM Linus Walleij wrote: > > On Mon, Apr 26, 2021 at 8:18 PM Miguel Ojeda > wrote: > > On Mon, Apr 26, 2021 at 2:31 AM Linus Walleij wrote: > > > > > > I think the Rust proponents should be open to the fact that their > > > work will eventually depend on themselves or someone else > > > fixing a working compiler for the maintained architectures in > > > the Linux kernel one way or the other, so they will be able to > > > work with Rust project anywhere in the kernel. > > > > > > For example m68k is not going away. Avoiding this question > > > of compiler support, just waiting and hoping that these old > > > architectures will disappear is the wrong idea. The right idea > > > is to recognize that LLVM and/or GCC Rust needs to > > > support all these architectures so they can all use Rust. > > > Someone needs to put in the effort. > > > > The RFC does not avoid the question -- please note it explicitly > > mentions the architecture/platform support issue and the current > > dependency on LLVM, as well as the possible ways to solve it. > > OK true. Sorry for being sloppy. > > Actually my reply to Wedson brought up a new issue, which is the > quality of learning resources and the lack of an equivalent to > The C Programming Language book. > > > But even if we did not have the issue today, it seems like starting > > with drivers and other "leaf" modules is a better approach. There are > > several reasons: > > > > - If for reason reason we wanted to remove Rust from the kernel, > > then it would be easier to do so if only "leaf" bits had been written. > > > > - We cannot compile the Rust support without nightly features yet, > > so it does not seem wise to make it a hard requirement right away. > > > > - Kernel developers need time to learn a bit of Rust, thus writing > > subsystems or core pieces of the kernel in Rust would mean less people > > can understand them. > > > > Given that drivers are a big part of the new code introduced every > > release, that they are "leaf" modules and that in some cases they are > > only intended to be used with a given architecture, they seem like a > > good starting point. > > I'm not sure I agree with this. > > I think a good starting point would be to either fix Rust support in > GCC or implement some more important ISAs in LLVM, > whichever is easiest. I don't mind having just *one* compiler but > I mind having *a* compiler for every arch we support. > > The situation for LLVM is very well described in the Wikipedia > entry for LLVM: "but most of this hardware is mostly obsolete, > and LLVM developers decided the support and maintenance > costs were no longer justified" - this is what I would call > deprecationism (deletionism). I think this is a detrimental force > for both compilers and kernels. It encourages developers of > compilers and kernels to do the wrong thing: instead of > rewriting their compiler and kernel infrastructure such that > maintenance of older ISAs and architectures becomes a bliss > they do what mathematicians do "let's assume a simpler > version of the problem". And this results in a less versatile > infrastructure and less adaptable code in the end. Which will > affect how agile and adaptive the software is. And when > something new comes along it hits you in the head. > > Portability to old systems and ISAs is a virtue in itself > because of the effect it has on code quality, not necessarily > for the support itself. > > Deprecationism is more the side effect of a certain business > strategy to toss new technology out every quarter without > having to care about aftermarket or postmarket too much. > This irritates people to the extent that there is now even > a project called "PostmarketOS" (Linux based). It is not > sustainable to use an emotional argument, but that is really > not my point, I care about code quality and diversity of > ISAs and target systems improves code quality in my book. > > I might be an extremist, but I do need to state this point. > > Yours, > Linus Walleij