From owner-freebsd-hackers@freebsd.org Wed Jan 2 11:40:56 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 5726814408D1 for ; Wed, 2 Jan 2019 11:40:56 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621F988498 for ; Wed, 2 Jan 2019 11:40:55 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-oi1-x242.google.com with SMTP id c206so24900482oib.0 for ; Wed, 02 Jan 2019 03:40:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=4mS4uXtVieiBuyCpeomyy/AGZZOVM+Ln1+n34QmJIaM=; b=ssRjicYiLbJ6mPn0yXuPgBjVIkQx1wkRh/Ri7Ld/Azcp6pjZ9ibwI3xn5BPC3mXJLb mWF9wqiBhSxdeEtgtp25aI5hCXyB6oHexL6GHLrKXNmcoaQpPOXr0lZKr2oUA/LhtX2d UchTLWAqbPr19HNb58yAGBdUS6JhfWxXg5UcT2m/Gju77PBPUficE5C4AcAZS9exZ+dI VwAxi1U+dYE7ojTOeLhOoFEu5fHOnJ/7rE1mGEy6xYmTHPx26I3/kLBXi6+gq0cJ/Nja 0Hdb8GuFUA/PuGT4PL7sV0NlUC7uJghSt2XHIrg+NpSlFaI84u/WW5gmCuV1IUqMDyEV u5Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=4mS4uXtVieiBuyCpeomyy/AGZZOVM+Ln1+n34QmJIaM=; b=qlvd4bJWUEXh1tFZ/3ZuiO2/FDewRFENjXQh2xr5cUNVYvnUy3wSFaonr9WpbO+1j0 CUSXX1SX5wOZVPi2J8/BeE5HeQM3g9Lv0qlCLqskDi+I6PoUvDiDgaMOLJNF9/FPwMM7 /VHdAW+cV0du+XOpt+7Ybg+mZ08P+m5y9Q28SX/vsbRsH9SrXXpkBIqs8mHWY+IYiotY VSfTC5c+jofg0/3NhmogEq8O0qXUIjUJg+Zpo5yMG+ZhoLYkJ+mzwo+07uKHiK5Amoz9 XGoLa70iglMldFPviHnJBqeP7j3xxue8klcdtm8H7r65MyS9QWlGu4s+dEGUyYELcyQ+ FmdQ== X-Gm-Message-State: AA+aEWZ2ujeh2XO80oqa1Dlf09i+oICO96ogZKgZa/0p3j7/NpIuSZxv sKyLGN3dagz5Rz4B1/p66BIy/Blc X-Google-Smtp-Source: AFSGD/XzCf2fYk01qrOHa9ATpK7nsrl+UIj892buQcuBZNEwGqUiLh529edVdOa1AaxbAFqdqcFaSQ== X-Received: by 2002:aca:53cd:: with SMTP id h196mr30748461oib.355.1546429254359; Wed, 02 Jan 2019 03:40:54 -0800 (PST) Received: from [192.168.1.33] ([81.174.250.12]) by smtp.gmail.com with ESMTPSA id q128sm26050672oia.4.2019.01.02.03.40.53 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jan 2019 03:40:53 -0800 (PST) Subject: Re: Speculative: Rust for base system components To: Garance A Drosehn Cc: freebsd-hackers@freebsd.org References: <20190101045638.D280E1F56@spqr.komquats.com> <4ea0612bbad08e61a15d495459b2bede@rpi.edu> <804bd7ee-d9c3-08ba-031f-df0348860d35@gmail.com> From: Johannes Lundberg Message-ID: Date: Wed, 2 Jan 2019 11:40:51 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 621F988498 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ssRjicYi; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of johalun0@gmail.com designates 2607:f8b0:4864:20::242 as permitted sender) smtp.mailfrom=johalun0@gmail.com X-Spamd-Result: default: False [-3.97 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.90)[-0.897,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.06)[ip: (3.45), ipnet: 2607:f8b0::/32(-2.08), asn: 15169(-1.61), country: US(-0.08)] 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: Wed, 02 Jan 2019 11:40:56 -0000 On 1/2/19 11:28 AM, Garance A Drosehn wrote: > On 2 Jan 2019, at 6:06, Johannes Lundberg wrote: > >> On 1/2/19 12:35 AM, Conrad Meyer wrote: >>> All are dynamically linked and stripped amd64 binaries. Ripgrep >>> (Rust) is 48x the binary size of ag and 37x that of grep(1). Like >>> grep(1), 'ag' is written in C. >> Rust by default statically link everything in executable binaries. >> This is comparable to statically link in libc and all other >> dependencies in your C program. You can have Rust programs link >> against shared rust libraries (std, etc) and get the size down >> to basically same as C. >> >> If Rust is used in base and everything is built at the same time, >> with same version compiler, it would make sense to link dynamically >> I think. >> >> Switching topic a bit. Just wanted to also add my contribution, >> a simple sysctl Rust library >> https://github.com/johalun/sysctl-rs . > Personally I think it's interesting and helpful to see some more > projects like this, so we can get a better understanding of how > well the language works for systems-level programs. I'm going to > take a look at this, just for my own curiosity. Thanks! > You're welcome! Oh, I forgot my most recent tool: https://github.com/johalun/pperf It's similar to iperf and useful for simulating many clients making short connections to ranges of IP addresses. The source code is ridiculously short and simple, showing how powerful Rust is when writing (safe and bug free) multi-threaded programs (of course with the use of some 3rd party crates).