From nobody Tue Sep 03 11:31:39 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 4Wyk3j36vBz5Mr6x for ; Tue, 03 Sep 2024 11:31:45 +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 4Wyk3j0tmxz4Mdm for ; Tue, 3 Sep 2024 11:31:43 +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 1C4B3892B6; Tue, 03 Sep 2024 11:31:41 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 483BVdax004602; Tue, 3 Sep 2024 11:31:39 GMT (envelope-from phk) Message-Id: <202409031131.483BVdax004602@critter.freebsd.dk> To: fvalasiad cc: "lain." , freebsd-hackers@freebsd.org Subject: Re: The Case for Rust (in the base system) In-reply-to: From: "Poul-Henning Kamp" References: 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="UTF-8" Content-ID: <4600.1725363099.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 03 Sep 2024 11:31:39 +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: 4Wyk3j0tmxz4Mdm -------- fvalasiad writes: > This is rather pessimistic though, just because a kernel was initially w= ritten > in C, means that it won't ever have a chance at another language? History is very close to a total confirmation on that hypothesis, but that may not be predictive of the future. All the kernels I know about, which have changed programming language, have amounted to total rewrites, partly because humans were faster at reinterpreting than converting the old source to the new, but mostly because the languages had different and non-compatible calling conventions. DARPAs "Convert C to Rust" call for research is =E2=80=A6 ehh =E2=80=A6 am= bitious? =E2=80=A6 but it may actually make that part of the process less critical. You would of course still end up with a Rust kernel using C ABI, but I can imagine much worse. But first and foremost: There has to be a good enough reason. A very large part of that is convincing people they're not about to detour into a cul-de-sac from which it will very hard to get out[1] When you have been around the blocks for a few decades, you will have noticed that "The New Solution to Everything" is like chicadas: Every 7 or 8 years there is a LOT of noise and it generates a LOT of garbage before it is over. But every so often, one of them succeeds and stick around and it is seldom the obvious one[2]. SqLite vs MySQL - Who ordered that? Outside its "cult" I dont think a majority is yet convinced that Rust is going to be around ten or twenty years from now, whereas I doubt anybody seriously expect we'll get rid of C that fast. The best way to make Rust stick around, is to build a better mousetrap and make a lot of people use it, rather than try to convert people. But personally I wouldn't be at all surprised if ten years from now, Rust will be firefox's MUMPS. Poul-Henning [1] It says a lot about our civilization that there is now an internationally recognized road-sign for "If you are following your GPS: STOP and TURN AROUND", because there is a small Welsh village you can get an 18-wheeler into. [2] Many who knew, will have forgotten, and most are too young to know, but back in the 1980'ies all the smart money were on PROLOG and MODULA-3 as the Object Oriented Languages To Solve All Our Problems. C++, initially called "C with classes", were ridiculed as a futile attempt to keep C relevant in The Century of the Fruitbat. -- = 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= .