From owner-freebsd-questions@freebsd.org Mon Jan 27 17:01:25 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE59E1FCA8B for ; Mon, 27 Jan 2020 17:01:24 +0000 (UTC) (envelope-from ihor@antonovs.family) Received: from mail.antonovs.family (mail.antonovs.family [100.25.240.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485wxv389Rz4bdG for ; Mon, 27 Jan 2020 17:01:23 +0000 (UTC) (envelope-from ihor@antonovs.family) Received: from localhost (localhost [127.0.0.1]) by mail.antonovs.family (Postfix) with ESMTP id 55CB9138A1C; Mon, 27 Jan 2020 17:01:22 +0000 (UTC) Received: from mail.antonovs.family ([127.0.0.1]) by localhost (mail.antonovs.family [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id uOw5kiGib7OH; Mon, 27 Jan 2020 17:01:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.antonovs.family (Postfix) with ESMTP id 41B34138A98; Mon, 27 Jan 2020 17:01:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.antonovs.family 41B34138A98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antonovs.family; s=D65AA412-CB7F-11E9-A561-802C9D403B77; t=1580144481; bh=+nBIeHRc+p6s9UEjp/nQm5/d8+qrBMqUnMKPtdtvON8=; h=Date:From:To:Message-ID:MIME-Version; b=RFjnD0nxOxW9So1AryLa94cHZ9B8tuDc61QkwsO9Tc3XTVhTNxzgGOrUXMmAHu5XN XjVP1FsZzc1csltEgcb2zD9UbY48pZHjxP9Ei7KXG0jeW8P9suAgXyAScFkiFJJOxK bAo2vrqg8b5eOEK/CvCQIHVmCjdErboOF9gCKquKyKqe0e2S2QXfBq0qkQ5vf9A2hY n/hXwTgv6vpweaKTkxO44Wpk2MZ3OaMfuCu9XGYoCqM+nC1wKpdgadinusn+PA+Ba5 xoPnhcdC3VGzOe2eoNaCmPBq6tCpfqU8MXXnKYszp0u7+E2wgxMmF81mPSI0kyaxCz Ys891kLLpTeAg== X-Virus-Scanned: amavisd-new at antonovs.family Received: from mail.antonovs.family ([127.0.0.1]) by localhost (mail.antonovs.family [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zqpRwIHiYkv7; Mon, 27 Jan 2020 17:01:21 +0000 (UTC) Received: from localhost (c-73-83-210-79.hsd1.wa.comcast.net [73.83.210.79]) by mail.antonovs.family (Postfix) with ESMTPSA id E70A6138A1C; Mon, 27 Jan 2020 17:01:20 +0000 (UTC) Date: Mon, 27 Jan 2020 09:01:18 -0800 From: Ihor Antonov To: David Demelier Cc: freebsd-questions@freebsd.org Subject: Re: Rust in base Message-ID: <20200127170118.n3yrrtvu5n5n6uxe@sea-ll-10936> References: <775662956.5865.1579896175788.JavaMail.zimbra@antonovs.family> <9c564fd6-54e7-218d-dad5-4251488b812c@malikania.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9c564fd6-54e7-218d-dad5-4251488b812c@malikania.fr> Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 485wxv389Rz4bdG X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=antonovs.family header.s=D65AA412-CB7F-11E9-A561-802C9D403B77 header.b=RFjnD0nx; dmarc=pass (policy=none) header.from=antonovs.family; spf=pass (mx1.freebsd.org: domain of ihor@antonovs.family designates 100.25.240.195 as permitted sender) smtp.mailfrom=ihor@antonovs.family X-Spamd-Result: default: False [-5.60 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[antonovs.family:s=D65AA412-CB7F-11E9-A561-802C9D403B77]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-3.10)[ip: (-8.52), ipnet: 100.24.0.0/13(-3.88), asn: 14618(-3.04), country: US(-0.05)]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[antonovs.family:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[antonovs.family,none]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14618, ipnet:100.24.0.0/13, country:US]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jan 2020 17:01:25 -0000 On 2020-01-27 08:56, David Demelier wrote: > Le 24/01/2020 =C3=A0 21:02, Ihor Antonov a =C3=A9crit=C2=A0: > > Hi folks, > >=20 > > As I was reading this article [1] I started wondering what would it t= ake to bring Rust into base? >=20 > That would be a very bad idea. Thanks for your answer, I see your point, although there are things that are technically not correct in your statement, and I'd like to comment on them - too many people have misconceptions about Rust. > Rust is big beast, it does not support the same number of platforms as > FreeBSD does=20 FreeBSD uses clang to compile, and clang uses LLVM as a backend, so as Rust. So theoretical number of platforms that both platforms support are the same. Looking at links below I think it is not fair to say that FreeBSD supports more platforms: https://www.freebsd.org/platforms/ https://forge.rust-lang.org/release/platform-support.html > and is utterly complex. Well so is clang and llvm, but these are in base. And there are people who would like to have options to have a slimmer base (embedded as an example) >=20 > Not mentioning that cargo, the package manager for Rust is built upon t= he > same philosophy as npm, aka having a separate module for minimalistic > functions. That means even small applications like alacritty requires a= round > ~50 dependencies which is totally insane. Also, building a Rust applica= tion > without internet connection is quite hard (but still feasible). It speaks more about disadvantage of C than anyting else. In C you have only 2 options - hope that necessary dependency is supplied by your operating system (or system's package manager) or bundle the dependecy whith your code. The latter is especially bad because it prevents code re-use, and such dependencies often left unmaintained, because they are hardly relevant to the goal of the main part of the codebase (look at ema= cs for example). With rust you have these options too, but also you have language package manager, so you can re-use the code that is maintained by someone. > Rust is far more complicated language to learn than C. C is so minimal = and > low level that you have already almost the view of what will the code l= ook > like in assembly when writing C, thus being the best fit for kernel and > drivers. I can argue that writing kernel or dirviers requires fair amount of knowledge and skill too, and complexity of Rust in this comparison looks tiny. And Rust's complexity comes with memory safety guarantees, and as we all know memory related bugs are very common in C (simply because humans can't write safe C in general). As Polytropon said - FreeBSD is moving towards modularization of base. So rustc is not going to be included, even more so, I think even clang, sendmail and other non-essential things will be modularized and become optional. My question was not about adding rustc to base. It is more about how to allow low-level software written in Rust available to users. How FreeBSD project can stimulate and ecourage those who want to write kernel modules in Rust: https://kth.diva-portal.org/smash/get/diva2:1238890/FULLTEXT01.pdf Without community support these efforts will remain academia experiments and will be forgotten. It is sad to observe how people in this thread unilaterrally sceam "NO!", without even reading into the question. >=20 > --=20 > David > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd= .org"