Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Aug 2024 22:06:43 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Steffen Nurpmeso <steffen@sdaoden.eu>, Cy Schubert <Cy.Schubert@cschubert.com>, freebsd-hackers@freebsd.org, Bakul Shah <bakul@iitbombay.org>
Subject:   Re: The Case for Rust (in the base system)
Message-ID:  <202408052206.475M6h8E067967@critter.freebsd.dk>
In-Reply-To: <CANCZdfrh-74M0L-Z%2BOOnqSD6xO3PyaUXWc8LPWxtRbsWawu4qA@mail.gmail.com>
References:  <CAOtMX2hAUiWdGPtpaCJLPZB%2Bj2yzNw5DSjUmkwTi%2B%2BmyemehCA@mail.gmail.com> <vdmg5zocd6wqcwc2bvzvzqn4bii2pwdc2r4mgnisukfkboj6nf@f7lv5quu4fjx> <CAOtMX2iDK3uN_oQgzzZAdoOZCfNsnvpefeZvKoTCRmPBhZywzA@mail.gmail.com> <CANCZdfqB1%2B-8BkpKwKoCM%2BzM4mCOFy63yHr1Pco7MnT1DFkb4w@mail.gmail.com> <EF084C36-D2EA-4194-B30F-253B0E8D5B4D@iitbombay.org> <704D020F-78A4-4926-AE3C-41F7FD619A89@cschubert.com> <20240805210149.nrkHN3j3@steffen%sdaoden.eu> <202408052127.475LROnE067608@critter.freebsd.dk> <CANCZdfrh-74M0L-Z%2BOOnqSD6xO3PyaUXWc8LPWxtRbsWawu4qA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202408052206.475M6h8E067967>