Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1277026pxb; Thu, 15 Apr 2021 19:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpOsfgHMJvv0cv7d1cTmWcjmY5KFgLOehqbVov3FXQso8cgXFsgVKE1tHiaeLb5zWHnpfR X-Received: by 2002:a17:902:c183:b029:ea:c15a:c6e9 with SMTP id d3-20020a170902c183b02900eac15ac6e9mr7383784pld.14.1618541576210; Thu, 15 Apr 2021 19:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618541576; cv=none; d=google.com; s=arc-20160816; b=mtJ6W0w2BDTeq3nBseHWkBcbuFT3gbIwfUpGSuLnH6+GFzFv1MF3E6VAJfTABcDw5W 6x0+5Tgn9FKH9Th4MGzkCy0xXbE7H43tcX36eGPOb2rc3CEO3locsNZtILlnWDPWhRVK 0YCvJmcnqogrGlE38wBh50uokgRMxZGPQOm+RgygKmts/hKpL7DtzKXIz0na1I+v3bCt TfyZ1PEV2y2Wdr+BBfkD+N3aWnMaZDOIWKx416dDjLL/4trO46sjlstY74Eg2sli3RXC hEv8YTAIU0yl9vGo7g4Y1JqkIKpEbFgXXzTamHxV+b/4YkCopQ5p1aqEC7pp/P3US+3j FalA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RDRWGt7xOekmwUKUE2JEVIaFGKRBsEO59DpsTnWgs/0=; b=BS0G4KeWZu+volQSNVYJSKVeRq9cqTou+WPOIWAOYtE5LJxMm65cISMGNhoKztvtFo j3eipNInwF4uctwHHse0sAfC15wqQziHtRWfviLxIgidpfI9TW/e9EIb6H2xa1Zgh8Oo U4P+oKhTjrIf728tjiWuSWuiQxQ72tisVDukt0fyp3L342U9mt2CqioQF0TXZKk2j3FL iJRN7NMClNI94nmt0P8BEadTpLcvcPAzqH7GdFSFNR5ggfoBEXpi6fwfdjosr7QUBdJ8 Bith8HcczSU8sMEpI2D6kMkvldWXUNY2UkXLoJDlOVbs3BCCvcus5tMjIy3YXzLSci/8 Ga/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZfOxa43A; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o3si4701447pgc.591.2021.04.15.19.52.43; Thu, 15 Apr 2021 19:52:56 -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=@google.com header.s=20161025 header.b=ZfOxa43A; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237042AbhDPCWs (ORCPT + 99 others); Thu, 15 Apr 2021 22:22:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235809AbhDPCWr (ORCPT ); Thu, 15 Apr 2021 22:22:47 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F202EC061760 for ; Thu, 15 Apr 2021 19:22:22 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id n10-20020a05600c4f8ab0290130f0d3cba3so1733735wmq.1 for ; Thu, 15 Apr 2021 19:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RDRWGt7xOekmwUKUE2JEVIaFGKRBsEO59DpsTnWgs/0=; b=ZfOxa43AWeSHjHBGW3m2xxgRn0MKBaCittzuqp5UzO77kBOKY+usslGnGnAr/bGr9r Y/FlasLuieWL3Lhp+NU27g3OBnXe07L7YygtbptzZRtIj+cm6dx2dOyRfgtMiScUNN3W Qm0cSyWf8oYh8NRjHjanPlsTr3KlqE2xCblcaA7wbs5sauhyiW6t8wqTVxa8/bdxETOj DJFHBnwCjdVHdB7lQFpVM/1+0fwY/FFQGmF6ec7cG08xt6EQkbgRa0ZDbgvWCY3AZa01 t/eax8nlE9M8mgTwNUtBaHqr4JuErCH+9oM60bW2CZrMcCT/7nlOiovQwH3V7tGcuk6w A+Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RDRWGt7xOekmwUKUE2JEVIaFGKRBsEO59DpsTnWgs/0=; b=FWv6nOmBmJro7yjlmDZ6EKb4MH2+0vPLfFv81y/7yhAIWeo5vRmW+OT+PlHJ0UhUfQ KkTaTUhW6GmXClWaEWzVRQdReEV61SmP0IdxOJ8mZqSe6alslJNWGaqhSW3pf7pFXbzx +kI5wnMPK5qdxpBXh0Mw9biT5XKJ2aAtvsFkwpBF/gVS48ouP2+NqKlpSCkJw/Ku0RIq FnJPlySzSZkUpyuIO84Y3pT3qiPiKBwfLlcvRZzI0LUTkoNnvBLayy2po9Anlcqv52Nq so6caimtd12KqMinyIBYJ/ULURalDogrbhQ/oihCp0/lNJDUImfPdBxiLVjVJfzKFe5/ 5fSA== X-Gm-Message-State: AOAM531LY9QJ+RMurABb0eJtqnUBpbWbItgu9blPgBvRjXm5eab+FkgC dt8BgBsCumG7mBBWHHuPhHEi X-Received: by 2002:a7b:c5c8:: with SMTP id n8mr5790600wmk.63.1618539741456; Thu, 15 Apr 2021 19:22:21 -0700 (PDT) Received: from google.com ([2a00:79e0:d:209:9d22:ab98:31ab:7a9d]) by smtp.gmail.com with ESMTPSA id f7sm3679602wrp.48.2021.04.15.19.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Apr 2021 19:22:21 -0700 (PDT) Date: Fri, 16 Apr 2021 03:22:16 +0100 From: Wedson Almeida Filho To: Peter Zijlstra Cc: ojeda@kernel.org, Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/13] [RFC] Rust support Message-ID: References: <20210414184604.23473-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 08:58:16PM +0200, Peter Zijlstra wrote: > On Wed, Apr 14, 2021 at 08:45:51PM +0200, ojeda@kernel.org wrote: > > > Rust is a systems programming language that brings several key > > advantages over C in the context of the Linux kernel: > > > > - No undefined behavior in the safe subset (when unsafe code is > > sound), including memory safety and the absence of data races. > > And yet I see not a single mention of the Rust Memory Model and how it > aligns (or not) with the LKMM. The C11 memory model for example is a > really poor fit for LKMM. We don't intend to directly expose C data structures to Rust code (outside the kernel crate). Instead, we intend to provide wrappers that expose safe interfaces even though the implementation may use unsafe blocks. So we expect the vast majority of Rust code to just care about the Rust memory model. We admittedly don't have a huge number of wrappers yet, but we do have enough to implement most of Binder and so far it's been ok. We do intend to eventually cover other classes of drivers that may unveil unforeseen difficulties, we'll see. If you have concerns that we might have overlooked, we'd be happy to hear about them from you (or anyone else). > HTML is not a valid documentation format. Heck, markdown itself is > barely readable. Are you stating [what you perceive as] a fact or just venting? If the former, would you mind enlightening us with some evidence? > It is really *really* hard to read. It has all sorts of weird things, > like operators at the beginning after a line break: > > if (foo > || bar) > > which is just wrong. And it suffers from CamelCase, which is just about > the worst thing ever. Not even the C++ std libs have that (or had, back > when I still did knew C++). > > I also see: > > if (foo) { > ... > } > > and > > if foo { > } > > the latter, ofcourse, being complete rubbish. There are advantages to adopting the preferred style of a language (when one exists). We, of course, are not required to adopt it but I am of the opinion that we should have good reasons to diverge if that's our choice in the end. "Not having parentheses around the if-clause expression is complete rubbish" doesn't sound like a good reason to me.