Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp948813rdb; Fri, 1 Dec 2023 03:06:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEe7YU5zIx0LwCvYMMONaEZhNzIwewzbRiGJr+yaaHY3KHG1LPfxSrmDtxuuEWoBbK8+bHf X-Received: by 2002:a05:6358:2624:b0:16d:f932:b5f with SMTP id l36-20020a056358262400b0016df9320b5fmr19120559rwc.30.1701428801497; Fri, 01 Dec 2023 03:06:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701428801; cv=none; d=google.com; s=arc-20160816; b=aG0nwlI4TSPCcat6GEz3OCkgw0j/zusqq+nWPiQ7lVuG8yrvCKr44DOaFklFKkRVyG //9zrm5ZAKrshDB5S+39gv5FQA7Ar/h3Mt4aJV+ZvLzb1N15poQpw127qVM4shhObkPK FdHjWVCj9jlzILuJMciFuA7WXpnOQNcU7ope1fGMF9dbSa8bi6FNuzpGFdHHUDny190o igw3IIU//rerx7hyfHjxgiKoL7tYz3kP6AwcDv4u2MHAT6vkY9R58NOeiEaHq8U52vjQ UR2e477/1xe++qrhn0s0ahpQEhAaEtm2zyvQPPNUQkc3YlI/Mgyw+wHWmi5wD99IY8Di os7Q== 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=W/R8UYys4SGiq+EL0cKD7bv2DTCPsH+ysS3QMINnXNI=; fh=/prSlm0yH8eSVsoWN6q6zd6qsK7qKo7bNvp3ZizMj1c=; b=DMLtMmgd0jlAAxMKJaaWoB5G5E/OhOOu8G89jV+PvSM+iuf/1F+02DyfJwK/784xhF DXATTKOZq6aVti62EsLMxPbbxWm97GHz1DExCovBnqcjRN0NQcrMBwRPGbe6IWS7fows yRi+syp2i8ImQaweygB7047HMS4h5Bw7fFqxwxr8vsUHmWTR4BOUb/PYX+Z7I4hHhqNe V7kR5SluWOn23yn642my5Ayoyv6ta4akk/zZqvPMEAmAJsJq1Fjxo9R0aNwBQ4hitPQl rc3AvyYJe2sMC53FdTavIRawU6YIMNrfffmTBRIQLGvXksuEeEZw/8o1iKAXjWfw+WXG NqqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vFeFsAAu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bw5-20020a056a00408500b006c3b70b6433si3219871pfb.206.2023.12.01.03.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 03:06:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vFeFsAAu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 225628456515; Fri, 1 Dec 2023 03:06:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378448AbjLALF7 (ORCPT + 99 others); Fri, 1 Dec 2023 06:05:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378403AbjLALF6 (ORCPT ); Fri, 1 Dec 2023 06:05:58 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F3F7193; Fri, 1 Dec 2023 03:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=W/R8UYys4SGiq+EL0cKD7bv2DTCPsH+ysS3QMINnXNI=; b=vFeFsAAuEBm7doVSgHeCiN4mbf zFz7Ek0nWIBL9GmXQ4924mMJxfvTAcJzAmMKfFiaVhjxbATGsvPAUYltCUrEN6SqodKtHcsdx7XjW icIW6qO2Tq9ggJmAxw74G/NR0KDNuX6sSrc3IzVMtaYbDIMwGhU3XEskgsvpKnRLIlhwr7P4/zX02 t/ntG1SecxFyMcctuunNFXGI5P92zX3KLjdePAJQMdGQ4rL8zRM/JODW99dLD1nm6YOhGFw1O5JNz J8TgFytunO7NrPL8+hFngLedaz+ITnQNudOp+FgAQuz5Mi/HrmObAcI3wmH33ajDGUxVDycJlPFgx LztV0+sQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r91Ks-00FSO0-UK; Fri, 01 Dec 2023 11:05:31 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id DCAA530040C; Fri, 1 Dec 2023 12:05:29 +0100 (CET) Date: Fri, 1 Dec 2023 12:05:29 +0100 From: Peter Zijlstra To: Boqun Feng Cc: Matthew Wilcox , Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alexander Viro , Christian Brauner , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Dan Williams , Kees Cook , Thomas Gleixner , Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org, Josh Triplett Subject: Re: [PATCH 1/7] rust: file: add Rust abstraction for `struct file` Message-ID: <20231201110529.GK3818@noisy.programming.kicks-ass.net> References: <20231129-alice-file-v1-1-f81afe8c7261@google.com> <20231129152305.GB23596@noisy.programming.kicks-ass.net> <20231130104226.GB20191@noisy.programming.kicks-ass.net> <20231201085328.GE3818@noisy.programming.kicks-ass.net> <20231201094037.GI3818@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 03:06:18 -0800 (PST) On Fri, Dec 01, 2023 at 02:36:40AM -0800, Boqun Feng wrote: > I don't speak for the Rust langauge community, but I think this is > something that they should improve. I understand it could be frustrating > that we find out the new stuff doesn't support good old tools we use > (trust me, I do!), but I believe you also understand that a higher level > language can help in some places, for example, SBRM is naturally > supported ;-) This answers half of the question: "Why are we even trying > to use it again?". C++ does that too (and a ton of other languages), and has a much less craptastic syntax (not claiming C++ syntax doesn't have problems, but at least its the same language family). Now I realize C++ isn't ideal, it inherits much of the safety issues from C. But gah, rust is such a royal pain. > The other half is how languages are designed is different in these days: > a language community may do a better job on listening to the users and > the real use cases can affect the language design in return. While we > are doing our own experiment, we might well give that a shot too. Well, rust was clearly not designed to interact with C/C++ sanely. Given the kernel is a giant C project, this is somewhat of an issue IMO. IIRC the way Chrome makes it work with C++ is by defining the interface in a *third* language which compiles into 'compatible' Rust and C++, which is total idiocy if you ask me. Some langauges (Zig IIUC) can consume regular C headers and are much less painful to interact with (I know very little about Zig, no endorsement beyond it integrating much better with C). > And at least the document admits these are "future possibilities", so > they should be more motivated to implement these. > > It's never perfect, but we gotta start somewhere. How about they start by using this LLVM goodness to implement the rust equivalent of Zig's @cImport? Have it use clang to munge the C/C++ headers into IR and squash the lot into the rust thing. The syntax is ofcourse unfixable :-(