From nobody Mon Aug 5 22:06:43 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wd9Wp6JtVz5SmsV for ; Mon, 05 Aug 2024 22:06:46 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wd9Wp2G72z46Fn for ; Mon, 5 Aug 2024 22:06:46 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 5D143892B6; Mon, 05 Aug 2024 22:06:44 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 475M6h8E067967; Mon, 5 Aug 2024 22:06:43 GMT (envelope-from phk) Message-Id: <202408052206.475M6h8E067967@critter.freebsd.dk> To: Warner Losh cc: Steffen Nurpmeso , Cy Schubert , freebsd-hackers@freebsd.org, Bakul Shah Subject: Re: The Case for Rust (in the base system) In-reply-to: From: "Poul-Henning Kamp" References: <704D020F-78A4-4926-AE3C-41F7FD619A89@cschubert.com> <20240805210149.nrkHN3j3@steffen%sdaoden.eu> <202408052127.475LROnE067608@critter.freebsd.dk> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <67965.1722895603.1@critter.freebsd.dk> Date: Mon, 05 Aug 2024 22:06:43 +0000 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU] X-Rspamd-Queue-Id: 4Wd9Wp2G72z46Fn -------- Warner Losh writes: > > > Most user space tools could be written in lua. > > > > That /exact/ same argument was made for Perl :-) > > Lua's been in the base since I imported it for the boot loader, though... Lua is is much more "language" than "eco-system", by design as I understand it, so that is a different situation than Perl or Rust. I personally do not subscribe to to the "let's rewrite all the 50 year old source code to make it more safe" philosophy, but there are valid arguments when the old code is horrible. But there are some wrinkles. First: Anything setuid/setgid is off-limits. There are good reasons why we dont have setuid shell-scripts (any more!) I guess with most systems being effectively single-user these days, that may not be as much a security focus as it was back in the 1990ies. Second: Performance. I cannot remember the exact subset of bin programs somebody did in Perl as proof of concept, but it slowed down buildworld a LOT to fire up all of Perl to do trivial stuff like "echo", "chown" and "mkdir". Lua may be cheaper than Perl, but it will still be measurable. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.