From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Allred Newsgroups: gmane.emacs.devel Subject: Re: Consideration for Rust contributions in Emacs Date: Sun, 22 Jan 2023 20:00:49 -0600 Message-ID: <878rhuc79x.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7187"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.0; emacs 28.1 Cc: emacs-devel@gnu.org To: Troy Hinckley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 23 04:21:51 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJnP5-0001gY-4J for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Jan 2023 04:21:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJnOI-0003Tl-PI; Sun, 22 Jan 2023 22:21:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJmb1-0004Ri-Gw for emacs-devel@gnu.org; Sun, 22 Jan 2023 21:30:07 -0500 Original-Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJmaz-0004u4-Rg for emacs-devel@gnu.org; Sun, 22 Jan 2023 21:30:07 -0500 Original-Received: by mail-io1-xd33.google.com with SMTP id j1so5049750iob.6 for ; Sun, 22 Jan 2023 18:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=5VnBLKV0qOH9PParIXytrPINjb2KPjpYkfOXxg1u8r0=; b=CrmCRaXeYstdQ7BOULL+3KZw4CVCu54cODhkE0AsGevzJUzkR+x7HOD9cFMHuTH1uD ghKolXYWUVF3SBCCrmcPNLVjoN+LK/PjVGBl7GRwoJsmYAvxETiVrbb37jEVVKiAjrXc oMqKjuI4+ZTcRLLyW40tYBheoRQwrCEE0fqrBC9AHG/J3enBpA/cYmdPSFAp86yUoX8W NHkj7ku+37Ogb2T+LtPFAJpqTpxHBwj0jrXtQuTia7cZhdkQ4+IgD5KaR8HTnMRSDgoP 6zk7fp8YZ9j5HtShlIYQMiJ1VEk4Oz7H/e7XphHlfbDRFbIj8zQwWOfVAtgKdt8JQncf HK3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5VnBLKV0qOH9PParIXytrPINjb2KPjpYkfOXxg1u8r0=; b=sK3qKJempRaQrNkcjBvdDL6NcjoMXZHD8158tiT45Ha5zUhjgnz6xtdBLaxkFaklGO p3hn4ktSkaTT2FGbHK022EeuCUJCZUKPZSnaTfy7PKuYqcLvMhh5lJ/k+/NRP/0VY0ZV rjwYMv4ykxGcM9X9CVVw2k+t6ecT96XGI8qn3Q+uuCtdn+s/Wai2XVIM9UA0Ngo4DDC4 /Bsz8UoNEavLL7F74B9IR2jfNGLBL0ZVDrQzRrhL4O70eVPQQ6ZiVJdNIglv9TbWqVAW GpZwnwg/Hz0r/w+8ETtsf+yhKl5V4/S8eP6nt2c1fqBbMcgX7V40A7y6IKAowH1ioS+b TFQA== X-Gm-Message-State: AFqh2koKPEN22sZaOFAxeqvQyyg8hoGh+GM5Qyz4Pfj1RZhmtb6xRmSY 5i0zsNAlvG3Kw+lNqvpEjAddjMaoYZY= X-Google-Smtp-Source: AMrXdXvDasMIjsdrsufAiMz3lwDQlsbcHQ3kJfU2wxJF6DHomAonp1keF3MCaKqaiGo3wfyPTuwzlQ== X-Received: by 2002:a6b:3c13:0:b0:6df:128f:ca12 with SMTP id k19-20020a6b3c13000000b006df128fca12mr2557397iob.1.1674441003594; Sun, 22 Jan 2023 18:30:03 -0800 (PST) Original-Received: from stargate ([2620:72:0:a40:a4f2:f04:1f26:7472]) by smtp.gmail.com with ESMTPSA id y27-20020a056638229b00b0038a416931edsm7034774jas.91.2023.01.22.18.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 18:30:03 -0800 (PST) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::d33; envelope-from=allred.sean@gmail.com; helo=mail-io1-xd33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 22 Jan 2023 22:21:01 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302603 Archived-At: Hi Troy! Thanks for raising the topic. I think this is my first time posting on the list, but this is a topic that means quite a bit to me (and is something I've had some experience with in other projects). Using Rust in Emacs is an exciting prospect that draws on the general buzz that Rust has been generating. I personally enjoy using Rust for personal and professional projects alike. As you've noticed, though, its use in Emacs is not without its concerns. Troy Hinckley writes: > I've had a discussion with several people recently about future > possibilities of Rust in GNU Emacs core. I could not find an answer to > this on the archives, so if it has been resolved previously please > point me to that thread. > > Let assume for the sake of this discussion that there was a some Rust > code that someone wanted to contribute and the maintainers wanted the > functionality it provided. What would be the consideration/objections? I would add to your list of considerations that Rust is designed for an almost singular purpose that it performs very well: memory-safety. I don't pay *that* much attention to this list, but I also haven't seen many bug reports concerning memory mismanagement -- and I certainly haven't experienced any such bugs myself. I suspect this is due to the relatively small C core that provides a memory-safe runtime for the elisp that comprises the rest of emacs. Assuming memory-safety isn't a demonstrated problem that emacs development struggles with, incorporating Rust into its dev pipeline is going to be a very hard sell: Does Rust actually solve a problem emacs has? I don't know that the answer is 'no'. Frankly, I don't think I'm qualified to offer an opinion here. More importantly to your goals, I don't see where you've shown why you believe the answer is 'yes'. In general (and this certainly doesn't apply to just emacs), to introduce a new technology into a stable system, you'll need to be able to demonstrate concrete gains that *measurably* outweigh the costs. Introducing a new technology will inherently destablize any affected components of the system -- this is very difficult to justify in any large project. Feel-good syntax isn't usually a compelling reason -- especially in a project that's developed a lisp runtime where syntax is already cheap to develop. The last significant endeavor in this direction that I'm aware of was Remacs -- but it appears development has petered out for one reason or another. I don't think it's a lost cause in the grand scheme of things, but this clearly is not a ship that can/would/should change course very easily. -- If it is something you are comfortable using and they meet your goals, I'd like to point out the recent support for dynamic modules. Rust has pretty solid FFI support in my experience. If needed, you may(?) have better luck submitting patches to hook into / advise core functions in lisp -- and then using those hooks in a dynamic module implemented in the language of your choice. -Sean -- Sean Allred