From nobody Thu Sep 05 20:21:51 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 4X09kj5GvGz5TqqJ for ; Thu, 05 Sep 2024 20:22:05 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X09kj3YlQz4mdG for ; Thu, 5 Sep 2024 20:22:05 +0000 (UTC) (envelope-from bakul@iitbombay.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-71790698b22so143593b3a.1 for ; Thu, 05 Sep 2024 13:22:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20230601.gappssmtp.com; s=20230601; t=1725567724; x=1726172524; darn=freebsd.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7f1uCPIAYkZHdvYd8IMaObZTiYZHBR6C8TYfGojEiPo=; b=fOc/d+qF1lMUWCIUAN2EV1GsJmlNNODVupob6orF/gqFh2vXlDqmjNxvNQWEpuAsLj 5FkSVh+pGDH3lYiRz6/96dx05OLp8aj4pShZQffjSWU+esibkKydmrmz6d4OIrjZWKFD VnhUELILIXa9CMwSGivluu7UDivsdO0jihTJ6zBYF8lubOo3094RjkaDPrrvbqEBZJzH DEV6ZnsVJT7dwHFBfCQjcU5km9ueZ3zqXOwJrMKGhJMFKfQ8BnRcVVg1NkViJV4ojPKg ZQA2ufX2E8f806k9NdDm01xH9l3QnOOSgvpRKsXY2Nu39WJGcnt4qR1gVTvM/d83Lov8 5ExA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725567724; x=1726172524; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7f1uCPIAYkZHdvYd8IMaObZTiYZHBR6C8TYfGojEiPo=; b=dUbQ1PBjjn478k1Owu973jHzyYpbWa6OOiVYlLr1RybffOOUdNLYoAuFSkIuMsSzeN rRcwVr4O30gcTHBywl7wv4Pd2t6unzUGflTDab/Xd71iPASpRqX3gnrNCFbjjW2pCyLD gBPBsKzUlFlj/7cH009YBjHWHy6flmsmKDs+eJ8iiy9p0XG06RDvChL8zn6p1ugnlEjX o530n7t3ovOB+gQ9ovIyKQKplA30xDhO2zV+Ryj3jzmP1q9+mRAtZ5SSRNUElZv2/yal 8lhDQBbCiUiNM4+Bhmc6dJkvJmIGVapA6Yl98uwEeHgniAxvb3VQqt9ktV7BPyJhDrQs lVpQ== X-Forwarded-Encrypted: i=1; AJvYcCVuc42Z5okkBDam2iDX9wDI4aoC4dexCinngp/qqVn75CJgg4NiQAcNwDpUoLx6zoYX+CZmnOI1dD2jJ3D+c1U=@freebsd.org X-Gm-Message-State: AOJu0YyfOMeDXe1yrNp9X8Wc3PsDpXkLCf8vZ+m5NzdEfIyE0/akjaMm ll7Y1wUw+ANn1loMRJOJydTHM/pAnjT835CDFodvnMnPEx2phd6oG5y6Auvnuw== X-Google-Smtp-Source: AGHT+IEX3wefZezq3e65gnxIwGNWd4lLvQHtr2E+TOWgpChzWhPRStjyWU5r2L3mdwV0snglOOY8Lg== X-Received: by 2002:a17:902:ce8b:b0:205:76f3:fc22 with SMTP id d9443c01a7336-206f051f759mr1568035ad.3.1725567723519; Thu, 05 Sep 2024 13:22:03 -0700 (PDT) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-206aea69ad8sm32258865ad.287.2024.09.05.13.22.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Sep 2024 13:22:03 -0700 (PDT) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: The Case for Rust (in any system) From: Bakul Shah In-Reply-To: Date: Thu, 5 Sep 2024 13:21:51 -0700 Cc: Alan Somers , FreeBSD Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <4634B979-4EB9-41AE-A9FE-14ACC9A4324A@iitbombay.org> References: To: Tomek CEDRO X-Mailer: Apple Mail (2.3776.700.51) 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:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X09kj3YlQz4mdG On Sep 5, 2024, at 11:34=E2=80=AFAM, Tomek CEDRO = wrote: >=20 > wow! this is undeniable argument even for someone who opposes the idea = (like me) :-) Not really! Showing that a present system has issues does not imply in any way that a proposed new system (or major change) will fix the said problems! This is a common fallacy that people fall for. Many people. Many many people :-) Nor does it say anything about the cost & disruption of making such a change, or how long will it take for the change to realize the promise. I did a quick check to see how code size has increased (just focusing on the kernel): Snapshot LoC R2.1.0: 464163 R3.1.0: 1036969 R4.1.0: 1364739 R5.1.0: 2183960 R6.1.0: 2718891 R7.1.0: 3396813 R8.1.0: 4029778 R9.1.0: 5436430 R10.1.0: 6268965 R11.1.0: 7902854 R12.1.0: 8216741 R13.1.0: 8900711 R14.1.0: 9769864 current: 9899932 (as of this morning) On average about 775K lines are added per release, with a couple of increases over a million. So even if *all* the new code that gets added is in Rust and is totally bugfree, it will take a further 12-13 years before the bugprone C code goes down to 50%. [By then Rust may not longer be a hot language but that is for another thread (or async/await)] The point being, even if you add Rust, there is a long term need to "do better" in the C code. > maybe this is time to simply crate a new Open-Source OS from scratch = written in Rust? >=20 > manual rewrite of existing code seems too complex from a technical = standpoint. sometimes it's just easier to start from scratch? This would be about as quixotic as DARPA's TRACTOR program (TRanslate All C code TO Rust)! No such AI exists today. Any auto translated code needs to be hand checked. I suspect you're better off teaching the AI about the common code bugs in C and how to fix them or at least detect them.