From owner-freebsd-hackers@freebsd.org Tue Jan 1 00:26:29 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F4D14207EB for ; Tue, 1 Jan 2019 00:26:29 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 552B38BBCE; Tue, 1 Jan 2019 00:26:29 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from [192.168.2.1] (unknown [IPv6:2620:0:2820:2:795b:61b7:2dc4:6168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gad/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1A5E91CE92; Tue, 1 Jan 2019 00:26:29 +0000 (UTC) (envelope-from gad@FreeBSD.org) From: "Garance A Drosehn" To: "Alan Somers" Cc: freebsd-hackers@freebsd.org Subject: Re: Speculative: Rust for base system components Date: Mon, 31 Dec 2018 19:26:28 -0500 X-Mailer: MailMate (1.12.3r5579) Message-ID: <2C39D05E-E855-4FCE-82CF-83EA4AE9F84A@FreeBSD.org> In-Reply-To: <5B476178-4D09-486F-AC58-47CB04965335@FreeBSD.org> References: <5B476178-4D09-486F-AC58-47CB04965335@FreeBSD.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 552B38BBCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 00:26:30 -0000 On 31 Dec 2018, at 17:44, Garance A Drosehn wrote: >> On Mon, Dec 31, 2018 at 12:17 AM Conrad Meyer wrote: >> >> Do you have any data to support the claim of slow build times? >> I know it's very hard to do an apples-to-apples comparison of build >> times between different languages, but I would be interested to see >> somebody try. > > I know that it takes a very long time to build rust (the compiler > itself) on my mac, and FreeBSD's buildworld always starts out by > building the compilers that it needs. So adding rust to the base > system is going to cause an immediate and noticeable increase in > the time used by buildworld. > On 31 Dec 2018, at 9:21, Igor Mozolevsky wrote: >> >> Does the generated code size increase or decrease and does the >> data-path get longer or shorter with switch from C to Rust with >> all the "great features" of Rust? Are there any metrics for >> these? If a CPU cache gets trashed repeatedly or data takes >> massive detours that would be a significant downside, wouldn't it? > > I've been somewhat interested in Rust for awhile, although I haven't > had the time to do much of anything with it. Part of the answer to > your questions will depend on how good the programmers are. There's two questions wrt performance. One is how long it takes to compile some program, and then the other is how fast the code is which is produced by the compiler. A note on both of those: Rust has the notion of "building for release", in which case the compile-time step takes *much* longer, but all that extra time goes into producing better code in the resulting program. So if you think the compiler is fast but that it's generating very slow programs, then it might be that you're not doing "a release build". There's one program written in rust which I use a lot, which is called 'ripgrep' (or 'rg' for short). It's one of the few programs which I install via pre-compiled pkgs, because I don't want to wait for all the time it takes to compile a release-build. But I'm very happy with how fast the program runs. -- Garance Alistair Drosehn = drosih@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA